-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adopt horizontal layout * Display MemoryViz logo * Change sample input and rendering options sections into dropdown menus
- Loading branch information
Showing
20 changed files
with
318 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from "react"; | ||
import { Box, Link, Stack, Typography } from "@mui/material"; | ||
import image from "../../assets/logo_square.png"; | ||
|
||
export default function Header() { | ||
return ( | ||
<header className="container"> | ||
<Stack direction={"row"} justifyContent={"space-between"}> | ||
<Box> | ||
<h1 style={{ marginBottom: 0 }}>MemoryViz Demo</h1> | ||
<Typography variant="subtitle1"> | ||
Demos of the{" "} | ||
<Link | ||
href="https://github.com/david-yz-liu/memory-viz" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
MemoryViz | ||
</Link>{" "} | ||
Javascript library for visualizing Python memory. Click{" "} | ||
<Link | ||
href="https://www.cs.toronto.edu/~david/memory-viz/docs/api/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
here | ||
</Link>{" "} | ||
for documentation. | ||
</Typography> | ||
</Box> | ||
<img | ||
src={image} | ||
alt="MemoryViz Logo" | ||
style={{ | ||
width: "100px", | ||
objectFit: "contain", | ||
}} | ||
/> | ||
</Stack> | ||
</header> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React, { ReactNode, useState } from "react"; | ||
import { Box, Button, Menu } from "@mui/material"; | ||
import ExpandMoreRoundedIcon from "@mui/icons-material/ExpandMoreRounded"; | ||
import "./css/styles.css"; | ||
|
||
type MemoryModelsMenuPropTypes = { | ||
menuName: string; | ||
testId: string; | ||
menuItems: ReactNode; | ||
}; | ||
|
||
export default function MemoryModelsMenu(props: MemoryModelsMenuPropTypes) { | ||
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null); | ||
const open = Boolean(anchorEl); | ||
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => { | ||
setAnchorEl(event.currentTarget); | ||
}; | ||
const handleClose = () => { | ||
setAnchorEl(null); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Button | ||
onClick={handleClick} | ||
data-testid={props.testId} | ||
className={`menu-button ${open ? "open" : ""}`} | ||
> | ||
{props.menuName} | ||
<ExpandMoreRoundedIcon /> | ||
</Button> | ||
<Menu anchorEl={anchorEl} open={open} onClose={handleClose}> | ||
<Box>{props.menuItems}</Box> | ||
</Menu> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.