Skip to content

Commit cf1edf9

Browse files
committed
update doc
1 parent 6a9db66 commit cf1edf9

2 files changed

Lines changed: 47 additions & 46 deletions

File tree

‎v3/docs/make_visualizations.md‎

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,43 @@ For the example we assume the `.html` files are `file1.html`, `file2.html` and `
2121

2222
The following is a possible example for `make_viz.json`
2323

24-
{
25-
"visualizer_url":
26-
"http://my.local.server/visualize.html",
27-
28-
"default_viz_config":
29-
{
30-
"embeddedMode": true,
31-
"codeDivWidth": 500
32-
},
33-
34-
"file1.html":
35-
[
36-
"js/file1.js",
37-
{
38-
"examples/prog1_1.py":{},
39-
"examples/prog1_2.py":{"codeDivWidth": 400}
40-
}
41-
],
42-
43-
# hash to end of line is a comment
44-
45-
"file2.html":
46-
[
47-
"js/file2.js",
48-
{
49-
"examples/prog2_1.py":{}
50-
}
51-
],
52-
53-
"file3.html":
54-
[
55-
"js/file3.js",
56-
{
57-
"examples/prog3_1.py":{"codeDivWidth": ""}
58-
}
59-
]
60-
}
24+
{
25+
"visualizer_url":
26+
"http://my.local.server/visualize.html",
27+
28+
"default_viz_config":
29+
{
30+
"embeddedMode": true,
31+
"codeDivWidth": 500
32+
},
33+
34+
"file1.html":
35+
[
36+
"js/file1.js",
37+
{
38+
"examples/prog1_1.py":{},
39+
"examples/prog1_2.py":{"codeDivWidth": 400}
40+
}
41+
],
42+
43+
# hash to end of line is a comment
44+
45+
"file2.html":
46+
[
47+
"js/file2.js",
48+
{
49+
"examples/prog2_1.py":{}
50+
}
51+
],
52+
53+
"file3.html":
54+
[
55+
"js/file3.js",
56+
{
57+
"examples/prog3_1.py":{"codeDivWidth": ""}
58+
}
59+
]
60+
}
6161

6262
The first entry specifies the location of the server. If this is not present, the default is http://pythontutor.com/visualize.html.
6363

‎v3/make_visualizations.py‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
5151
"default_viz_config":
5252
{
53-
"embeddedMode": false,
54-
"heightChangeCallback": "redrawAllVisualizerArrows"
53+
"embeddedMode": true,
54+
"verticalStack": true
5555
},
5656
5757
"eg1.html":
@@ -60,15 +60,15 @@
6060
"js/t1.js",
6161
{
6262
"python_scripts/t1a.py": {}
63-
"python_scripts/t1b.py": {"embeddedMode": true}
63+
"python_scripts/t1b.py": {"embeddedMode": false}
6464
}
6565
]
6666
"eg2.html":
6767
[
6868
"js/t2.js",
6969
{
70-
# the heightChangeCallback is removed from the params below
71-
"python_scripts/t2.py": {"heightChangeCallback": ""}
70+
# verticalStack is removed from the params below
71+
"python_scripts/t2.py": {"verticalStack": ""}
7272
}
7373
]
7474
}
@@ -81,11 +81,12 @@
8181
"http://pythontutor.com/visualize.html"
8282
8383
If "default_viz_config" is not supplied it defaults to
84-
{'embeddedMode': true,
85-
'heightChangeCallback': 'redrawAllVisualizerArrows',
84+
{'heightChangeCallback': 'redrawAllVisualizerArrows',
8685
'editCodeBaseURL': viz_url}
8786
8887
where viz_url is the value associated with the "visualizer_url" key.
88+
Note: for this version heightChangeCallback is hard-wired to be
89+
redrawAllVisualizerArrows.
8990
9091
The dictionary associated with a python script overrides the
9192
"default_viz_config" dictionary.
@@ -141,8 +142,8 @@
141142
DEFALUT_VIZ_URL = 'http://pythontutor.com/visualize.html'
142143

143144
# The global default visualization configuration
144-
DEFAULT_VIZ_CONFIG = {'embeddedMode': False,
145-
'heightChangeCallback': 'redrawAllVisualizerArrows',
145+
# Note: heightChangeCallback is hard-wired to be redrawAllVisualizerArrows
146+
DEFAULT_VIZ_CONFIG = {'heightChangeCallback': 'redrawAllVisualizerArrows',
146147
'editCodeBaseURL': DEFALUT_VIZ_URL}
147148

148149

0 commit comments

Comments
 (0)