Skip to content

Commit

Permalink
Rename package to memory-viz (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-yz-liu authored Apr 15, 2024
1 parent 09ddb71 commit becfe7b
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 42 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Memory model diagrams
# MemoryViz: Creating memory model diagrams

This package generates memory model diagrams for Python code in the style of CSC110/111/148 at the University of Toronto.
This uses the [Rough.js](https://roughjs.com/) Javascript library to emulate the look of hand-drawn diagrams.
Expand All @@ -8,10 +8,10 @@ This uses the [Rough.js](https://roughjs.com/) Javascript library to emulate the
## Installation (users)

1. Install [Node.js](https://nodejs.org/en/).
2. Install the `memory-models-rough` package from GitHub (it is currently not on npm):
2. Install the `memory-viz` package from GitHub (it is currently not on npm):

```console
$ npm install git+https://github.com/david-yz-liu/memory-models-rough.git -g
$ npm install git+https://github.com/david-yz-liu/memory-viz.git -g
```

_Note_: omit the `-g` flag if you want to install the package into just the current working directory.
Expand Down Expand Up @@ -89,7 +89,7 @@ Before showing the full capabilities of the project, here is a simple example to
one stack-frame and two objects.

```javascript
const { draw } = require("../../dist/memory_models_rough.js");
const { draw } = require("../../dist/memory_viz.js");

const objects = [
{
Expand Down
10 changes: 5 additions & 5 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "memory-models-rough-demo",
"name": "memory-viz-demo",
"version": "0.1.0",
"description": "Demo website for memory-models-rough",
"description": "Demo website for memory-viz",
"scripts": {
"test": "jest --no-cache",
"test-cov": "jest --no-cache --coverage",
Expand All @@ -10,15 +10,15 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/david-yz-liu/memory-models-rough.git"
"url": "git+https://github.com/david-yz-liu/memory-viz.git"
},
"author": "David Liu",
"license": "MIT",
"bugs": {
"url": "https://github.com/david-yz-liu/memory-models-rough/issues"
"url": "https://github.com/david-yz-liu/memory-viz/issues"
},
"private": true,
"homepage": "https://github.com/david-yz-liu/memory-models-rough#readme",
"homepage": "https://github.com/david-yz-liu/memory-viz#readme",
"devDependencies": {
"@babel/core": "^7.23.6",
"@babel/preset-env": "^7.23.6",
Expand Down
2 changes: 1 addition & 1 deletion demo/src/MemoryModelsUserInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function MemoryModelsTextInput(props: MemoryModelsTextInputPropTypes) {
);
}

//TODO: Retrieve min and max seeds from memory-models-rough
//TODO: Retrieve min and max seeds from memory-viz
function MemoryModelsConfigInput(props: MemoryModelsConfigInputPropTypes) {
const handleSeedChange = (event) => {
event.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion demo/src/SvgDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function SvgDisplay(props: SvgDisplayPropTypes) {
useEffect(() => {
if (props.jsonResult !== null) {
// deep copy jsonResult as mem.draw mutates input JSON
// https://github.com/david-yz-liu/memory-models-rough/pull/20#discussion_r1513235452
// https://github.com/david-yz-liu/memory-viz/pull/20#discussion_r1513235452
const jsonResultCopy = structuredClone(props.jsonResult);
const m = mem.draw(jsonResultCopy, props.configData.useAutomation, {
...props.configData.overallDrawConfig,
Expand Down
5 changes: 2 additions & 3 deletions demo/src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
<h1><%= htmlWebpackPlugin.options.title %></h1>
<p>
Demos of the
<a
href="https://github.com/david-yz-liu/memory-models-rough"
>memory-models-rough</a
<a href="https://github.com/david-yz-liu/memory-viz"
>MemoryViz</a
>
Javascript library for visualizing Python memory.
</p>
Expand Down
2 changes: 1 addition & 1 deletion demo/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = [
},
plugins: [
new HtmlWebpackPlugin({
title: "Memory Models Rough Demo",
title: "MemoryViz Demo",
filename: "./index.html",
template: "./src/html/index.html",
}),
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/99-api/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: "index"
title: "memory-models-rough"
title: "MemoryViz"
sidebar_label: "Readme"
sidebar_position: 0
custom_edit_url: null
Expand All @@ -16,10 +16,10 @@ This uses the [Rough.js](https://roughjs.com/) Javascript library to emulate the
## Installation (users)

1. Install [Node.js](https://nodejs.org/en/).
2. Install the `memory-models-rough` package from GitHub (it is currently not on npm):
2. Install the `memory-viz` package from GitHub (it is currently not on npm):

```console
$ npm install git+https://github.com/david-yz-liu/memory-models-rough.git -g
$ npm install git+https://github.com/david-yz-liu/memory-viz.git -g
```

_Note_: omit the `-g` flag if you want to install the package into just the current working directory.
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/99-api/modules.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: "modules"
title: "memory-models-rough"
title: "MemoryViz"
sidebar_label: "Exports"
sidebar_position: 0.5
custom_edit_url: null
Expand Down Expand Up @@ -32,4 +32,4 @@ the produced canvas

#### Defined in

[user_functions.ts:29](https://github.com/david-yz-liu/memory-models-rough/blob/bc37a9e/src/user_functions.ts#L29)
[user_functions.ts:29](https://github.com/david-yz-liu/memory-viz/blob/bc37a9e/src/user_functions.ts#L29)
14 changes: 7 additions & 7 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { themes as prismThemes } from "prism-react-renderer";

/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Memory Models Rough",
title: "MemoryViz",
tagline: "Generator for Python memory model diagrams",
favicon: "img/favicon.ico",

// Set the production url of your site here
url: "https://www.cs.toronto.edu/",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/~david/memory-models-rough/",
baseUrl: "/~david/memory-viz/",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down Expand Up @@ -44,7 +44,7 @@ const config = {
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
"https://github.com/david-yz-liu/memory-models-rough/tree/main/docs",
"https://github.com/david-yz-liu/memory-viz/tree/main/docs",
},
blog: false,
// blog: {
Expand All @@ -67,9 +67,9 @@ const config = {
// Replace with your project's social card
image: "img/docusaurus-social-card.jpg",
navbar: {
title: "Memory Models Rough",
title: "MemoryViz",
logo: {
alt: "Memory Models Rough Logo",
alt: "MemoryViz Logo",
src: "img/logo.svg",
},
items: [
Expand All @@ -80,7 +80,7 @@ const config = {
label: "Docs",
},
{
href: "https://github.com/david-yz-liu/memory-models-rough",
href: "https://github.com/david-yz-liu/memory-viz",
label: "GitHub",
position: "right",
},
Expand Down Expand Up @@ -124,7 +124,7 @@ const config = {
// },
{
label: "GitHub",
href: "https://github.com/david-yz-liu/memory-models-rough",
href: "https://github.com/david-yz-liu/memory-viz",
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "memory-models-rough-docs",
"name": "memory-viz-docs",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ This uses the [Rough.js](https://roughjs.com/) Javascript library to emulate the

## Installation

You can install the `memory-models-rough` package from GitHub (it is currently not on npm):
You can install the `memory-viz` package from GitHub (it is currently not on npm):

```console
$ npm install git+https://github.com/david-yz-liu/memory-models-rough.git
$ npm install git+https://github.com/david-yz-liu/memory-viz.git
```

## Example
Expand All @@ -24,7 +24,7 @@ Here's an example of using this package in a Javascript file executed by NodeJS.

```javascript
// simple_demo.js
const { draw } = require("memory_models_rough");
const { draw } = require("memory_viz");

const objects = [
{
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "memory-models-rough",
"name": "memory-viz",
"version": "0.1.0",
"description": "Library for creating Python memory model diagrams that look hand-drawn.",
"main": "dist/memory_models_rough.js",
"description": "Library for creating beginner-friendly memory model diagrams.",
"main": "dist/memory_viz.js",
"scripts": {
"test": "jest --no-cache",
"test-cov": "jest --no-cache --coverage",
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ module.exports = [
entry: path.resolve(__dirname, "src/index.ts"),
output: {
path: path.resolve(__dirname, "dist"),
filename: "memory_models_rough.js",
filename: "memory_viz.js",
library: {
name: "MemoryModelsRough",
name: "MemoryViz",
type: "umd",
export: "default",
},
Expand Down

0 comments on commit becfe7b

Please sign in to comment.