From ae40d3735dacff33422aebb64516ebf3fe950964 Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Fri, 31 May 2024 13:41:40 -0400 Subject: [PATCH 01/11] add type annotations and interfaces --- memory-viz/src/style.ts | 79 ++++++++++++++++++++++++++++++++--------- 1 file changed, 62 insertions(+), 17 deletions(-) diff --git a/memory-viz/src/style.ts b/memory-viz/src/style.ts index 407409dc..042431b4 100644 --- a/memory-viz/src/style.ts +++ b/memory-viz/src/style.ts @@ -1,8 +1,33 @@ import merge from "deepmerge"; import { config } from "./config"; +interface DrawnObject { + isClass: boolean; + name: string; + x: number; + y: number; + id: number | string; + value: any; + stack_frame: boolean; + show_indexes: boolean; + style: Style; +} + +interface AttributeStyle { + [propName: string]: string | number; +} + +interface Style { + text_id?: AttributeStyle; + text_type?: AttributeStyle; + text_value?: AttributeStyle; + box_id?: AttributeStyle; + box_type?: AttributeStyle; + box_container?: AttributeStyle; +} + // Built-in style for drawing text on canvas (if no style is provided by the user). -const default_text_style = { +const default_text_style: AttributeStyle = { fill: config.text_color, "text-anchor": "middle", "font-family": "Consolas, Courier", @@ -10,7 +35,7 @@ const default_text_style = { }; // Default style attributes that apply universally to any type of data. -const common_style = { +const common_style: Style = { text_id: { fill: config.id_color, "text-anchor": "middle", @@ -33,7 +58,7 @@ const common_style = { box_type: {}, }; -const category_specific_styles = { +const category_specific_styles: Record = { collection: { text_value: { fill: config.id_color }, }, @@ -48,22 +73,37 @@ const category_specific_styles = { }, }; -const immutable = ["int", "str", "tuple", "None", "bool", "float", "date"]; -const collections = ["list", "set", "tuple", "dict"]; +const immutable: Array = [ + "int", + "str", + "tuple", + "None", + "bool", + "float", + "date", +]; +const collections: Array = ["list", "set", "tuple", "dict"]; -const primitives = ["int", "str", "None", "bool", "float", "date"]; +const primitives: Array = [ + "int", + "str", + "None", + "bool", + "float", + "date", +]; /** * Populates a user-passed style object --to the extent needed-- with default data (to adhere to the interface of the * style object). Needed to avoid errors of the type "TypeError: Cannot set properties of undefined (setting 'x')", as * well as many more. - * @param {Object} object : the object that represents a Python object the user wants drawn. The style object + * @param {DrawnObject} object : the object that represents a Python object the user wants drawn. The style object * corresponding to 'object' will be extracted be doing object.style. * @param {Number} seed : a numeric seed. If valued between 1 and 2^31, RoughJS will generate the exact same shape(s) * when provided with the same seed. If valued at 0, RoughJS will generate random shape(s). - * @returns {Object} + * @returns {Style} */ -function populateStyleObject(object, seed) { +function populateStyleObject(object: DrawnObject, seed: Number) { let style_so_far = common_style; let object_type; @@ -90,25 +130,30 @@ function populateStyleObject(object, seed) { } // Constants employed to establish presets for styles. -const HIGHLIGHT_TEXT = { "font-weight": "bolder", "font-size": "22px" }; -const FADE_TEXT = { /*'font-weight': "normal",*/ "fill-opacity": 0.4 }; -const HIGHLIGHT_BOX_LINES = { roughness: 0.2, strokeWidth: 4 }; -const HIGHLIGHT_BOX = { +const HIGHLIGHT_TEXT: AttributeStyle = { + "font-weight": "bolder", + "font-size": "22px", +}; +const FADE_TEXT: AttributeStyle = { + /*'font-weight': "normal",*/ "fill-opacity": 0.4, +}; +const HIGHLIGHT_BOX_LINES: AttributeStyle = { roughness: 0.2, strokeWidth: 4 }; +const HIGHLIGHT_BOX: AttributeStyle = { roughness: 0.2, strokeWidth: 4, fill: "yellow", fillStyle: "solid", }; -const FADE_BOX_LINES = { roughness: 2.0, strokeWidth: 0.5 }; -const FADE_BOX = { +const FADE_BOX_LINES: AttributeStyle = { roughness: 2.0, strokeWidth: 0.5 }; +const FADE_BOX: AttributeStyle = { roughness: 2.0, strokeWidth: 0.5, fill: "rgb(247, 247, 247)", fillStyle: "solid", }; -const HIDE_BOX = { fill: "white", fillStyle: "solid" }; +const HIDE_BOX: AttributeStyle = { fill: "white", fillStyle: "solid" }; -const presets = { +const presets: Record = { highlight: { text_value: HIGHLIGHT_TEXT, text_id: HIGHLIGHT_TEXT, From e0e05cb30756bd2788a40268bf340571894e0774 Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Tue, 4 Jun 2024 12:54:48 -0400 Subject: [PATCH 02/11] Make relevant attributes optional and update automate.ts to properly render blank objects --- memory-viz/src/automate.ts | 4 ++-- memory-viz/src/style.ts | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/memory-viz/src/automate.ts b/memory-viz/src/automate.ts index 6f42b770..68fa1ac1 100644 --- a/memory-viz/src/automate.ts +++ b/memory-viz/src/automate.ts @@ -73,7 +73,7 @@ function drawAutomatedStackFrames(stack_frames, configuration) { let width; let height; - if (stack_frame.name !== "BLANK") { + if (stack_frame.type !== "BLANK") { const size = getSize(stack_frame); height = size.height; width = size.width; @@ -87,7 +87,7 @@ function drawAutomatedStackFrames(stack_frames, configuration) { required_width = width; } - if (stack_frame.name !== "BLANK") { + if (stack_frame.type !== "BLANK") { stack_frame.x = configuration.left_margin; stack_frame.y = min_required_height; draw_stack_frames.push(stack_frame); diff --git a/memory-viz/src/style.ts b/memory-viz/src/style.ts index 32d570d9..a54f7a86 100644 --- a/memory-viz/src/style.ts +++ b/memory-viz/src/style.ts @@ -3,14 +3,15 @@ import { config } from "./config"; interface DrawnObject { isClass: boolean; - name: string; - x: number; - y: number; + name?: string; + type?: string; + x?: number; + y?: number; id: number | string; value: any; stack_frame: boolean; show_indexes: boolean; - style: Style; + style?: Style; } interface AttributeStyle { From 4ad4b47300463dbc8bf4e778f0dfc8203a2fddba Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Tue, 4 Jun 2024 14:27:00 -0400 Subject: [PATCH 03/11] Move type interfaces into a new file --- memory-viz/src/style.ts | 27 +-------------------------- memory-viz/src/types.ts | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 memory-viz/src/types.ts diff --git a/memory-viz/src/style.ts b/memory-viz/src/style.ts index a54f7a86..f5df04a2 100644 --- a/memory-viz/src/style.ts +++ b/memory-viz/src/style.ts @@ -1,31 +1,6 @@ import merge from "deepmerge"; import { config } from "./config"; - -interface DrawnObject { - isClass: boolean; - name?: string; - type?: string; - x?: number; - y?: number; - id: number | string; - value: any; - stack_frame: boolean; - show_indexes: boolean; - style?: Style; -} - -interface AttributeStyle { - [propName: string]: string | number; -} - -interface Style { - text_id?: AttributeStyle; - text_type?: AttributeStyle; - text_value?: AttributeStyle; - box_id?: AttributeStyle; - box_type?: AttributeStyle; - box_container?: AttributeStyle; -} +import "./types.ts"; // Built-in style for drawing text on canvas (if no style is provided by the user). const default_text_style: AttributeStyle = { diff --git a/memory-viz/src/types.ts b/memory-viz/src/types.ts new file mode 100644 index 00000000..fafb8690 --- /dev/null +++ b/memory-viz/src/types.ts @@ -0,0 +1,25 @@ +interface DrawnObject { + isClass: boolean; + name?: string; + type?: string; + x?: number; + y?: number; + id: number | string; + value: any; + stack_frame: boolean; + show_indexes: boolean; + style: Style; +} + +interface AttributeStyle { + [propName: string]: string | number; +} + +interface Style { + text_id?: AttributeStyle; + text_type?: AttributeStyle; + text_value?: AttributeStyle; + box_id?: AttributeStyle; + box_type?: AttributeStyle; + box_container?: AttributeStyle; +} From 8415a5826ef18733bb434b7767bb3ebd44450fb3 Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Wed, 5 Jun 2024 11:15:11 -0400 Subject: [PATCH 04/11] Make show_indexes and style attributes optional --- memory-viz/src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memory-viz/src/types.ts b/memory-viz/src/types.ts index fafb8690..1eebd1cf 100644 --- a/memory-viz/src/types.ts +++ b/memory-viz/src/types.ts @@ -7,8 +7,8 @@ interface DrawnObject { id: number | string; value: any; stack_frame: boolean; - show_indexes: boolean; - style: Style; + show_indexes?: boolean; + style?: Style; } interface AttributeStyle { From 403cc5cdbce003c1751ad2df64db357d2346d875 Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Wed, 5 Jun 2024 11:32:18 -0400 Subject: [PATCH 05/11] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ca450d8..a513b343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Added style and automatic layout tests for the `draw` function. - Updated documentation, tests, and examples to reflect the `isClass` attribute being optional and set to `false` by default. - Removed unused imports in `demo_C.js`. +- Added type interfaces and type annotations to `style.ts`. ## [0.1.0] - 2024-04-16 From 1f3ee04b84d86583d410f56e1191ff932bdec8bf Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Thu, 6 Jun 2024 01:32:04 -0400 Subject: [PATCH 06/11] Rename DrawnObject to DrawnEntity and fix imports/exports --- memory-viz/src/style.ts | 6 +++--- memory-viz/src/types.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/memory-viz/src/style.ts b/memory-viz/src/style.ts index e6e779db..17575fb9 100644 --- a/memory-viz/src/style.ts +++ b/memory-viz/src/style.ts @@ -1,6 +1,6 @@ import merge from "deepmerge"; import { config } from "./config"; -import "./types.ts"; +import { DrawnEntity, AttributeStyle, Style } from "./types"; // Built-in style for drawing text on canvas (if no style is provided by the user). const default_text_style: AttributeStyle = { @@ -73,13 +73,13 @@ const primitives: Array = [ * Populates a user-passed style object --to the extent needed-- with default data (to adhere to the interface of the * style object). Needed to avoid errors of the type "TypeError: Cannot set properties of undefined (setting 'x')", as * well as many more. - * @param {DrawnObject} object : the object that represents a Python object the user wants drawn. The style object + * @param {DrawnEntity} object : the object that represents a Python object the user wants drawn. The style object * corresponding to 'object' will be extracted be doing object.style. * @param {Number} seed : a numeric seed. If valued between 1 and 2^31, RoughJS will generate the exact same shape(s) * when provided with the same seed. If valued at 0, RoughJS will generate random shape(s). * @returns {Style} */ -function populateStyleObject(object: DrawnObject, seed: Number) { +function populateStyleObject(object: DrawnEntity, seed: Number) { let style_so_far = common_style; let object_type; diff --git a/memory-viz/src/types.ts b/memory-viz/src/types.ts index 1eebd1cf..6f7d624c 100644 --- a/memory-viz/src/types.ts +++ b/memory-viz/src/types.ts @@ -1,4 +1,4 @@ -interface DrawnObject { +export interface DrawnEntity { isClass: boolean; name?: string; type?: string; @@ -11,11 +11,11 @@ interface DrawnObject { style?: Style; } -interface AttributeStyle { +export interface AttributeStyle { [propName: string]: string | number; } -interface Style { +export interface Style { text_id?: AttributeStyle; text_type?: AttributeStyle; text_value?: AttributeStyle; From a17f8725b42b70f06709ec74b80f0ea44784cf69 Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Fri, 7 Jun 2024 11:00:56 -0400 Subject: [PATCH 07/11] Add DrawnEntity type annotation to source code files --- memory-viz/src/automate.ts | 11 ++++++----- memory-viz/src/memory_model.ts | 3 ++- memory-viz/src/user_functions.ts | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/memory-viz/src/automate.ts b/memory-viz/src/automate.ts index 68fa1ac1..9e204aab 100644 --- a/memory-viz/src/automate.ts +++ b/memory-viz/src/automate.ts @@ -1,10 +1,11 @@ import { MemoryModel } from "./memory_model"; import { config } from "./config"; +import { DrawnEntity } from "./types"; /** * Draws the objects given in the path in an automated fashion. * - * @param {object[]} objects - The list of objects that will be drawn on the canvas. + * @param {DrawnEntity[]} objects - The list of objects that will be drawn on the canvas. * @param {Object} configuration - The configuration settings defined by the user. * @param {number} width - User-defined width of the canvas. * @returns {MemoryModel} - The memory model that is created according to the objects given in the path (the JSON @@ -43,7 +44,7 @@ function drawAutomated(objects, width, configuration) { * of the input such that the x and y coordinates of the stack-frames are determined automatically. * * @param {Object} configuration - The configuration set by the user. - * @param {Object[]} stack_frames - The list of stack-frames that will be drawn + * @param {DrawnEntity[]} stack_frames - The list of stack-frames that will be drawn * (without the specified x and y coordinates) * @returns {Object} - Returns the object consisting of three attributes as follows: stack-frames which will be drawn, * the minimum required height of the canvas for drawing stack frames and required width for drawing all the stack @@ -112,7 +113,7 @@ function drawAutomatedStackFrames(stack_frames, configuration) { * desired canvas width, this function mutates the passed list to equip each object with coordinates (corresponding to * the top-left corner of the object's box in the canvas). * - * @param {[object]} objs - list of objects in the format described in MemoryModel.drawAll + * @param {DrawnEntity} objs - list of objects in the format described in MemoryModel.drawAll * @param {number} max_width - the desired width of the canvas * @param {*} sort_by - the sorting criterion; must be "height" or "id", otherwise no sorting takes place. * @param {object} config_aut - additional configuration options, such as margins, paddings, e.t.c. @@ -244,7 +245,7 @@ function drawAutomatedOtherItems( * The returned object has two attributes as 'stack_frames' and 'other_items'. * Each of these attributes are a list of objects that were originally given by the user. * - * @param {object[]} objects - The list of objects, including stack-frames (if any) and other items, that + * @param {DrawnEntity[]} objects - The list of objects, including stack-frames (if any) and other items, that * will be drawn * @returns {object} an object separating between stack-frames and the rest of the items. */ @@ -276,7 +277,7 @@ function separateObjects(objects) { * Return the dimensions that the passed object will have if drawn on a canvas (in the context of the MemoryModel class). * This function can be used to determine how much space an object box will take on canvas (like a dry-run), given the * implementations of the 'draw' methods in MemoryModel. - * @param {object} obj - an object as specified in MemoryModel.drawAll, except that coordinates are missing. + * @param {DrawnEntity} obj - an object as specified in MemoryModel.drawAll, except that coordinates are missing. * @returns {object} the width and the height the drawn object would have. */ function getSize(obj) { diff --git a/memory-viz/src/memory_model.ts b/memory-viz/src/memory_model.ts index 8060909f..b71fb8f7 100644 --- a/memory-viz/src/memory_model.ts +++ b/memory-viz/src/memory_model.ts @@ -11,6 +11,7 @@ import { } from "./style"; import { config } from "./config"; import { DOMImplementation, XMLSerializer } from "@xmldom/xmldom"; +import { DrawnEntity } from "./types"; // Dynamic import of Node fs module let fs; @@ -756,7 +757,7 @@ export class MemoryModel { /** * Create a MemoryModel given a list of JS objects. * - * @param {object[]} objects - the list of objects (including stack-frames) to be drawn. + * @param {DrawnEntity[]} objects - the list of objects (including stack-frames) to be drawn. * Each object in 'objects' must include the following structure: * @param {boolean} objects[*].isClass = false - Whether a user-defined class (or a stack-frame) or a built-in * object will be drawn. Pass true to draw a class or a stack-frame, diff --git a/memory-viz/src/user_functions.ts b/memory-viz/src/user_functions.ts index dd9d1ee8..e4e97fac 100644 --- a/memory-viz/src/user_functions.ts +++ b/memory-viz/src/user_functions.ts @@ -1,5 +1,6 @@ import { MemoryModel } from "./memory_model"; import { drawAutomated, getSize } from "./automate"; +import { DrawnEntity } from "./types"; // Dynamic import of Node fs module let fs; @@ -12,7 +13,7 @@ if (typeof window === "undefined") { * * The format of the array of objects must adhere to the description provided in MemoryModel.drawAll. * - * @param {string | object[]} objects - The array of objects to be drawn: this could be passed as an actual JavaScript + * @param {string | DrawnEntity[]} objects - The array of objects to be drawn: this could be passed as an actual JavaScript * array of objects, or as a JSON file containing the object array. This array of objects may also include the * user-defined style configuration. See the demo files and style.md file for details. * @param {boolean} automation - Whether the coordinates (of the objects on the canvas) should be automatically From 8e08aad421c4121ada8c16c5513ec2b995ee0907 Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Fri, 7 Jun 2024 11:04:58 -0400 Subject: [PATCH 08/11] Remove isClass and stack_frame attributes from DrawnEntity --- memory-viz/src/types.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/memory-viz/src/types.ts b/memory-viz/src/types.ts index 6f7d624c..ecf394e6 100644 --- a/memory-viz/src/types.ts +++ b/memory-viz/src/types.ts @@ -1,12 +1,10 @@ export interface DrawnEntity { - isClass: boolean; name?: string; type?: string; x?: number; y?: number; id: number | string; value: any; - stack_frame: boolean; show_indexes?: boolean; style?: Style; } From bd91cdd2a8cad227b7fb4ff8a64f40fd890e37b6 Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Mon, 10 Jun 2024 21:16:59 -0400 Subject: [PATCH 09/11] Add type annotations to source files --- memory-viz/src/automate.ts | 12 ++++++------ memory-viz/src/types.ts | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/memory-viz/src/automate.ts b/memory-viz/src/automate.ts index 6ef6175f..7073deaf 100644 --- a/memory-viz/src/automate.ts +++ b/memory-viz/src/automate.ts @@ -11,7 +11,7 @@ import { DrawnEntity } from "./types"; * @returns {MemoryModel} - The memory model that is created according to the objects given in the path (the JSON * file) */ -function drawAutomated(objects, width, configuration) { +function drawAutomated(objects: DrawnEntity[], width, configuration) { const { stack_frames, other_items } = separateObjects(objects); // Assigning the objects with coordinates. @@ -51,7 +51,7 @@ function drawAutomated(objects, width, configuration) { * frames. Notably, the last two attributes will be useful in terms of dynamically deciding the width and the height * of the canvas. */ -function drawAutomatedStackFrames(stack_frames, configuration) { +function drawAutomatedStackFrames(stack_frames: DrawnEntity[], configuration) { for (const req_prop of [ "padding", "top_margin", @@ -113,7 +113,7 @@ function drawAutomatedStackFrames(stack_frames, configuration) { * desired canvas width, this function mutates the passed list to equip each object with coordinates (corresponding to * the top-left corner of the object's box in the canvas). * - * @param {DrawnEntity} objs - list of objects in the format described in MemoryModel.drawAll + * @param {DrawnEntity[]} objs - list of objects in the format described in MemoryModel.drawAll * @param {number} max_width - the desired width of the canvas * @param {*} sort_by - the sorting criterion; must be "height" or "id", otherwise no sorting takes place. * @param {object} config_aut - additional configuration options, such as margins, paddings, e.t.c. @@ -123,7 +123,7 @@ function drawAutomatedStackFrames(stack_frames, configuration) { * dynamically determined height the canvas will need to be. */ function drawAutomatedOtherItems( - objs, + objs: DrawnEntity[], max_width, sort_by, config_aut: any = {} /* to avoid undefined error */, @@ -245,7 +245,7 @@ function drawAutomatedOtherItems( * The returned object has two attributes as 'stack_frames' and 'other_items'. * Each of these attributes are a list of objects that were originally given by the user. * - * @param {DrawnEntity[]} objects - The list of objects, including stack-frames (if any) and other items, that + * @param {Object[]} objects - The list of objects, including stack-frames (if any) and other items, that * will be drawn * @returns {object} an object separating between stack-frames and the rest of the items. */ @@ -282,7 +282,7 @@ function separateObjects(objects) { * @param {DrawnEntity} obj - an object as specified in MemoryModel.drawAll, except that coordinates are missing. * @returns {object} the width and the height the drawn object would have. */ -function getSize(obj) { +function getSize(obj: DrawnEntity) { // The x and y values here are unimportant; 'obj' must simply have these properties for processing by 'drawAll'. obj.x = obj.x || 10; obj.y = obj.y || 10; diff --git a/memory-viz/src/types.ts b/memory-viz/src/types.ts index ecf394e6..eccb2a4b 100644 --- a/memory-viz/src/types.ts +++ b/memory-viz/src/types.ts @@ -7,6 +7,9 @@ export interface DrawnEntity { value: any; show_indexes?: boolean; style?: Style; + height: number; + width: number; + rowBreaker: boolean; } export interface AttributeStyle { From 07846c778514c9be2ea01184deaeaead465d0e4c Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Mon, 10 Jun 2024 21:19:50 -0400 Subject: [PATCH 10/11] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 970e6c27..4cb5f654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Updated documentation, tests, and examples to reflect the `isClass` attribute being optional and set to `false` by default. - Removed unused imports in `demo_C.js`. - Added type interfaces and type annotations to `style.ts`. +- Added `DrawnEntity` type annotations to source code files. ## [0.1.0] - 2024-04-16 From fef988a3a3f8c53deeed65b8406e35781f511ca0 Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Tue, 11 Jun 2024 19:22:05 -0400 Subject: [PATCH 11/11] Make new DrawnEntity attributes optional and fix annotation in types.ts --- memory-viz/src/automate.ts | 4 ++-- memory-viz/src/types.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/memory-viz/src/automate.ts b/memory-viz/src/automate.ts index 7073deaf..cfb1d928 100644 --- a/memory-viz/src/automate.ts +++ b/memory-viz/src/automate.ts @@ -245,11 +245,11 @@ function drawAutomatedOtherItems( * The returned object has two attributes as 'stack_frames' and 'other_items'. * Each of these attributes are a list of objects that were originally given by the user. * - * @param {Object[]} objects - The list of objects, including stack-frames (if any) and other items, that + * @param {DrawnEntity[]} objects - The list of objects, including stack-frames (if any) and other items, that * will be drawn * @returns {object} an object separating between stack-frames and the rest of the items. */ -function separateObjects(objects) { +function separateObjects(objects: DrawnEntity[]) { let stackFrames = []; let otherItems = []; diff --git a/memory-viz/src/types.ts b/memory-viz/src/types.ts index eccb2a4b..5608cb93 100644 --- a/memory-viz/src/types.ts +++ b/memory-viz/src/types.ts @@ -7,9 +7,9 @@ export interface DrawnEntity { value: any; show_indexes?: boolean; style?: Style; - height: number; - width: number; - rowBreaker: boolean; + height?: number; + width?: number; + rowBreaker?: boolean; } export interface AttributeStyle {