You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With SnapshotTracer, if there is a reassignment, the old value disappears, which does not match the notes in CSC110. This means across snapshots, it's possible for the id of a value to change, even though there was no reassignment. In the course notes, the list and its values still exist after reassignment of s
Snapshot
If there is a variable x=1, 1 will be given its own primitive type box. If another variable y also get assigned y=1, both x and y will point to the same primitive value. For example, the code
x= [1, 2, 3]
y= [1, 2, 3]
z=x
produced this:
However for y, each of 1, 2, 3 should have its own box instead of referring to the existing primitives.
Memory Model Layouts
There are two ways to organize the boxes in the output - manually inputting the x and y coordinates, or use automate and use blank boxes. An improvement could be to define rows and columns, similar to the css grid to make organizing the boxes easier.
It may make it easier to find variables if we group the variables with the frames they came from. Currently, the frames are put on top of each other which creates a lot of vertical space. The objects are put to the right of the frames, and they usually don't take as much vertical space as the frames. In this following example, func2 is placed at the very bottom, but its variables are all the way at the top making it difficult to find related variables.
Errors
An error Error: Reduce of empty array with no initial value is thrown when an empty JSON [] is passed as a value
When a list type is used and the value is not a list, the error TypeError: element_ids.forEach is not a function will occur. Need to confirm if this is a behavior we chose not to handle because we assume users to provide valid objects.
Codebase
For DrawnEntity.type, we could use better documentation for the special types, like .frame or .blank. These types are mentioned in the doc and exist in the demo, but there is no dedicated place for all the special types.
In general, add types to function parameters for type hinting and more robust code. For example, there is a package for the styles tag, which we can use to replace AttributesStyle in styles.ts. Another good place for typing is the configuration parameter for draw. This would allow the users to see what options are supported as they are using it.
Due of the lack of types, I wasn't sure what values are allowed for the configuration parameter for draw. I also wasn't able to find documentations for the configuration object other than its usage in the demos. This would be fixed if the parameter is typed.
Arrays that defines if a type isimmutable, collections, or primitives are exported from styles.ts which appears to be containing style presets.
Misc
Not all presets in 05-presets.md have an example image
The documentation website linked in README.md and on the demo page points to 404.
Need to confirm these behaviors are intended
ids are allowed to be strings.
The background of the boxes are transparent.
When using draw, there is no way to specify the output path like you could with the CLI.
It’s possible to have variables that points to ids that are non-existent.
The same Id is allowed to appear multiple times in the diagram.
The text was updated successfully, but these errors were encountered:
leowrites
changed the title
MemoryViz improvement discoveries
PyTA & MemoryViz improvement discoveries
Oct 7, 2024
Improvements
SnapshotTracer
SnapshotTracer
, if there is a reassignment, the old value disappears, which does not match the notes in CSC110. This means across snapshots, it's possible for the id of a value to change, even though there was no reassignment. In the course notes, the list and its values still exist after reassignment ofs
Snapshot
x=1
,1
will be given its own primitive type box. If another variabley
also get assignedy=1
, bothx
andy
will point to the same primitive value. For example, the codeproduced this:
However for
y
, each of 1, 2, 3 should have its own box instead of referring to the existing primitives.Memory Model Layouts
x
andy
coordinates, or useautomate
and use blank boxes. An improvement could be to define rows and columns, similar to the css grid to make organizing the boxes easier.func2
is placed at the very bottom, but its variables are all the way at the top making it difficult to find related variables.Errors
Error: Reduce of empty array with no initial value
is thrown when an empty JSON[]
is passed as a valuelist
type is used and the value is not a list, the errorTypeError: element_ids.forEach is not a function
will occur. Need to confirm if this is a behavior we chose not to handle because we assume users to provide valid objects.Codebase
DrawnEntity.type
, we could use better documentation for the special types, like.frame
or.blank
. These types are mentioned in the doc and exist in the demo, but there is no dedicated place for all the special types.styles
tag, which we can use to replaceAttributesStyle
instyles.ts
. Another good place for typing is theconfiguration
parameter fordraw
. This would allow the users to see what options are supported as they are using it.configuration
parameter fordraw
. I also wasn't able to find documentations for theconfiguration
object other than its usage in the demos. This would be fixed if the parameter is typed.immutable
,collections
, orprimitives
are exported fromstyles.ts
which appears to be containing style presets.Misc
05-presets.md
have an example imageNeed to confirm these behaviors are intended
id
s are allowed to be strings.draw
, there is no way to specify the output path like you could with the CLI.The text was updated successfully, but these errors were encountered: