Skip to content

Commit 809ed40

Browse files
author
Philip Guo
committed
works for some voodoo mysterious reason
1 parent c973964 commit 809ed40

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

PyTutorGAE/js/pytutor.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,18 +1585,17 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
15851585
.append('div')
15861586
.attr('class', function(d, i) {return d.is_zombie ? 'zombieStackFrame' : 'stackFrame';})
15871587
.attr('id', function(d, i) {return d.is_zombie ? myViz.generateID("zombie_stack" + i) : myViz.generateID("stack" + i);})
1588-
1588+
.append('div')
1589+
.attr('class', 'stackFrameHeader')
1590+
.attr('id', function(d, i) {
1591+
return d.is_zombie ? myViz.generateID("zombie_stack_header" + i) : myViz.generateID("stack_header" + i);
1592+
})
15891593

15901594
// remember that the enter selection is added to the update
15911595
// selection so that we can process it later ...
15921596

15931597
// UPDATE
15941598
stackD3.order() // VERY IMPORTANT to put in the order corresponding to data elements
1595-
.append('div')
1596-
.attr('class', 'stackFrameHeader')
1597-
.attr('id', function(d, i) {
1598-
return d.is_zombie ? myViz.generateID("zombie_stack_header" + i) : myViz.generateID("stack_header" + i);
1599-
})
16001599
.html(function(frame, i) {
16011600
console.log('UPDATE', frame.func_name);
16021601

@@ -1617,15 +1616,20 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
16171616

16181617
return headerLabel;
16191618
})
1619+
1620+
var stackFrameTable = stackD3
16201621
.append('table')
16211622
.attr('class', 'stackFrameVarTable')
16221623
.selectAll('tr')
16231624
.data(function(frame, i) {
16241625
// each list element contains a reference to the entire frame object as well as the variable name
16251626
// TODO: look into whether we can use d3 parent nodes to avoid this hack ... http://bost.ocks.org/mike/nest/
16261627
return frame.ordered_varnames.map(function(e) {return [e, frame];});
1627-
})
1628-
.enter()
1628+
},
1629+
function(d) {return d[0];} // use variable name as key
1630+
);
1631+
1632+
stackFrameTable.enter()
16291633
.append('tr')
16301634
.append('td')
16311635
.html(function(d, i) {

0 commit comments

Comments
 (0)