Skip to content

Commit

Permalink
update styles, add style demo to sample
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTallJerry committed Apr 5, 2024
1 parent fa86d9c commit 724d9a5
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 3 deletions.
8 changes: 7 additions & 1 deletion demo/src/MemoryModelsSample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ export default function MemoryModelsSample(props: MemoryModelsSamplePropTypes) {
const [clickedBtnIndex, setClickedBtnIndex] = useState<Number>(null);

useEffect(() => {
const samples = ["automation", "blankspace", "manual", "simple"];
const samples = [
"automation",
"blankspace",
"manual",
"simple",
"style",
];
const tempFileContents = {};
for (const sample of samples) {
//TODO: better way to read plain text of the object json files?
Expand Down
11 changes: 10 additions & 1 deletion demo/src/sample/automation/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"useAutomation": true
"useAutomation": true,
"overallDrawConfig": {
"width": 1300,
"padding": 30,
"top_margin": 30,
"bottom_margin": 40,
"left_margin": 20,
"right_margin": 30,
"sort_by": "id"
}
}
9 changes: 8 additions & 1 deletion demo/src/sample/blankspace/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"useAutomation": true
"useAutomation": true,
"overallDrawConfig": {
"width": 1300,
"padding": 30,
"right_margin": 20,
"bottom_margin": 20,
"sort_by": null
}
}
12 changes: 12 additions & 0 deletions demo/src/sample/style/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"useAutomation": true,
"overallDrawConfig": {
"width": 1300,
"padding": 30,
"top_margin": 30,
"bottom_margin": 40,
"left_margin": 20,
"right_margin": 30,
"sort_by": "id"
}
}
63 changes: 63 additions & 0 deletions demo/src/sample/style/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[
{
"isClass": true,
"x": 25,
"y": 200,
"name": "__main__",
"id": null,
"value": { "lst1": 82, "lst2": 84, "p": 99, "d": 10, "t": 11 },
"stack_frame": true,
"style": ["highlight"]
},
{
"isClass": false,
"x": 350,
"y": 350,
"name": "list",
"id": 54,
"value": [19, 43, 28, 49],
"style": {
"text_id": { "font-style": "italic", "font-size": "x-large" }
}
},
{
"isClass": false,
"x": 750,
"y": 500,
"name": "str",
"id": 43,
"value": "David is cool",
"style": "highlight"
},
{
"isClass": false,
"x": 1050,
"y": 260,
"name": "set",
"id": 90,
"value": [36, 49, 64]
},
{
"isClass": false,
"x": 1050,
"y": 500,
"name": "dict",
"id": 10,
"value": { "x": 81, "y": 100, "z": 121 },
"style": { "text_id": { "font-style": "italic" } }
},
{
"isClass": false,
"x": 750,
"y": 750,
"name": "None",
"id": 13,
"value": "None",
"style": {
"text_value": { "font-style": "italic" },
"box_id": { "fill": "red", "fillStyle": "dots" },
"box_type": { "fill": "red", "fillStyle": "solid" },
"box_container": { "fill": "black", "fillStyle": "solid" }
}
}
]

0 comments on commit 724d9a5

Please sign in to comment.