Skip to content

Commit dfba20b

Browse files
committed
Merge branch 'gh-pages' of https://github.com/parkjs814/AlgorithmVisualizer into gh-pages
2 parents e7cf68d + e437d72 commit dfba20b

8 files changed

+17
-87
lines changed

ES6.md

-72
This file was deleted.

js/module/array2d.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), {
136136
processStep: function (step, options) {
137137
switch (step.type) {
138138
case 'notify':
139-
if (step.v === 0 || step.v) {
139+
if (step.v !== undefined) {
140140
var $row = this.$table.find('.mtbl-row').eq(step.x);
141141
var $col = $row.find('.mtbl-col').eq(step.y);
142142
$col.text(refineByType(step.v));

js/module/chart.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ ChartTracer.prototype = $.extend(true, Object.create(Tracer.prototype), {
7575
processStep: function (step, options) {
7676
switch (step.type) {
7777
case 'notify':
78-
if (step.v) {
78+
if (step.v !== undefined) {
7979
this.chart.config.data.datasets[0].data[step.s] = step.v;
8080
this.chart.config.data.labels[step.s] = step.v.toString();
8181
}

js/tracer_manager/manager.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const stepLimit = 1e6;
44

5-
const TracerManager = function() {
5+
const TracerManager = function () {
66
this.timer = null;
77
this.pause = false;
88
this.capsules = [];
@@ -51,12 +51,13 @@ TracerManager.prototype = {
5151
selectedCapsule = this.add(newTracer);
5252
}
5353

54-
console.log(newTracer);
5554
selectedCapsule.defaultName = `${newTracer.name} ${count}`;
55+
selectedCapsule.order = this.order++;
5656
return selectedCapsule;
5757
},
5858

5959
deallocateAll() {
60+
this.order = 0;
6061
this.reset();
6162
$.each(this.capsules, (i, capsule) => {
6263
capsule.allocated = false;
@@ -92,7 +93,7 @@ TracerManager.prototype = {
9293
$.each(capsules, (i, capsule) => {
9394
let width = 100;
9495
let height = (100 / capsules.length);
95-
let top = height * i;
96+
let top = height * capsule.order;
9697

9798
capsule.$container.css({
9899
top: `${top}%`,

public/algorithm_visualizer.js

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/algorithm_visualizer.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/algorithm_visualizer.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/algorithm_visualizer.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)