Skip to content

Commit 772dcb9

Browse files
author
Philip Guo
committed
sharpen up heap objects to prep for animations
1 parent a4b19af commit 772dcb9

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

PyTutorGAE/css/pytutor.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,11 @@ div#heap {
562562
}
563563

564564
td.toplevelHeapObject {
565-
padding-left: 0px;
566-
padding-right: 20px;
565+
margin-left: 0px;
566+
margin-right: 20px;
567+
568+
padding: 8px;
569+
border: 2px dotted white; /* to make room for transition animations */
567570
}
568571

569572
table.heapRow {

PyTutorGAE/js/pytutor.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,7 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
12011201
heapRows.enter().append('table')
12021202
//.each(function(objLst, i) {console.log('NEW ROW:', objLst, i);})
12031203
.attr('class', 'heapRow')
1204+
.append('tr')
12041205
.selectAll('td')
12051206
.data(function(d, i) {return d.slice(1, d.length);}, /* map over each row, skipping row ID tag */
12061207
function(objID) {return objID;} /* each object ID is unique for constancy */)
@@ -1212,7 +1213,18 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
12121213

12131214
// TODO: add a smoother transition in the future
12141215
renderCompoundObject(objID, $(this), true);
1215-
});
1216+
})
1217+
/*
1218+
.transition()
1219+
.style('border-color', 'red')
1220+
.duration(100)
1221+
.transition()
1222+
.style('border-color', 'white')
1223+
.delay(100)
1224+
.duration(600)
1225+
*/
1226+
1227+
12161228

12171229
// remove deleted rows
12181230
heapRows.exit()

0 commit comments

Comments
 (0)