Skip to content

Commit b080841

Browse files
committed
bah
1 parent dfa0bf8 commit b080841

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

v3/js/opt-frontend.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ $(document).ready(function() {
200200
// tricky: selector 'true' and 'false' values are strings!
201201
disableHeapNesting: ($('#heapPrimitivesSelector').val() == 'true'),
202202
drawParentPointers: ($('#drawParentPointerSelector').val() == 'true'),
203+
textualMemoryLabels: ($('#textualMemoryLabelsSelector').val() == 'true'),
203204
//allowEditAnnotations: true,
204205
});
205206

@@ -484,6 +485,10 @@ $(document).ready(function() {
484485
if (drawParentPointerState !== undefined) {
485486
$('#drawParentPointerSelector').val(drawParentPointerState);
486487
}
488+
var textRefsState = $.bbq.getState('textReferences');
489+
if (textRefsState !== undefined) {
490+
$('#textualMemoryLabelsSelector').val(textRefsState);
491+
}
487492
var pyState = $.bbq.getState('py');
488493
if (pyState !== undefined) {
489494
$('#pythonVersionSelector').val(pyState);
@@ -529,6 +534,7 @@ $(document).ready(function() {
529534
cumulative: $('#cumulativeModeSelector').val(),
530535
heapPrimitives: $('#heapPrimitivesSelector').val(),
531536
drawParentPointers: $('#drawParentPointerSelector').val(),
537+
textReferences: $('#textualMemoryLabelsSelector').val(),
532538
py: $('#pythonVersionSelector').val()};
533539

534540
if (appMode == 'display') {
@@ -546,6 +552,7 @@ $(document).ready(function() {
546552
cumulative: $('#cumulativeModeSelector').val(),
547553
heapPrimitives: $('#heapPrimitivesSelector').val(),
548554
drawParentPointers: $('#drawParentPointerSelector').val(),
555+
textReferences: $('#textualMemoryLabelsSelector').val(),
549556
py: $('#pythonVersionSelector').val(),
550557
curInstr: myVisualizer.curInstr,
551558
};

v3/js/pytutor.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ var curVisualizerID = 1; // global to uniquely identify each ExecutionVisualizer
8686
// codeDivWidth=350, codeDivHeight=400
8787
// drawParentPointers - if true, then draw environment diagram parent pointers for all frames
8888
// WARNING: there are hard-to-debug MEMORY LEAKS associated with activating this option
89+
// textualMemoryLabels - render references using textual memory labels rather than as jsPlumb arrows.
90+
// this is good for slow browsers or when used with disableHeapNesting
91+
// to prevent "arrow overload"
8992
// updateOutputCallback - function to call (with 'this' as parameter)
9093
// whenever this.updateOutput() is called
9194
// (BEFORE rendering the output display)
@@ -121,8 +124,10 @@ function ExecutionVisualizer(domRootID, dat, params) {
121124
this.arrowOffsetY = undefined;
122125
this.codeRowHeight = undefined;
123126

124-
this.disableHeapNesting = (this.params.disableHeapNesting == true); // avoid 'undefined' state
125-
this.drawParentPointers = (this.params.drawParentPointers == true); // avoid 'undefined' state
127+
// avoid 'undefined' state
128+
this.disableHeapNesting = (this.params.disableHeapNesting == true);
129+
this.drawParentPointers = (this.params.drawParentPointers == true);
130+
this.textualMemoryLabels = (this.params.textualMemoryLabels == true);
126131

127132
// cool, we can create a separate jsPlumb instance for each visualization:
128133
this.jsPlumbInstance = jsPlumb.getInstance({

v3/visualize.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,14 @@
8383
<select id="heapPrimitivesSelector">
8484
<option value="false">inline primitives and nested objects</option>
8585
<option value="true">render all objects on the heap</option>
86-
</select>, and
86+
</select>,
8787
<select id="drawParentPointerSelector">
8888
<option value="false">hide environment parent pointers</option>
8989
<option value="true">show environment parent pointers</option>
90+
</select>, and
91+
<select id="textualMemoryLabelsSelector">
92+
<option value="false">draw references using arrows</option>
93+
<option value="true">use text labels for references</option>
9094
</select>.
9195
</p>
9296

0 commit comments

Comments
 (0)