提交 f982dfae 编写于 作者: D duaraghav8@gmail

Merge remote-tracking branch 'upstream/gh-pages' into gh-pages

...@@ -65,7 +65,7 @@ button:not([disabled]):hover { ...@@ -65,7 +65,7 @@ button:not([disabled]):hover {
.btn.active, .btn.active,
button.active { button.active {
background: rgba(0, 0, 0, .28); background: rgb(38, 38, 38);
} }
.btn input, .btn input,
...@@ -138,7 +138,7 @@ nav h3 { ...@@ -138,7 +138,7 @@ nav h3 {
} }
.sidemenu #footer { .sidemenu #footer {
border-top: 2px solid rgba(0, 0, 0, .28); border-top: 2px solid rgb(38, 38, 38);
} }
.sidemenu button { .sidemenu button {
...@@ -181,7 +181,7 @@ section, ...@@ -181,7 +181,7 @@ section,
nav, nav,
section { section {
border: 1px solid rgba(0, 0, 0, .28); border: 1px solid rgb(38, 38, 38);
box-sizing: border-box; box-sizing: border-box;
} }
...@@ -227,7 +227,7 @@ section { ...@@ -227,7 +227,7 @@ section {
z-index: 5; z-index: 5;
padding: 4px; padding: 4px;
font-size: 14px; font-size: 14px;
background: rgba(0, 0, 0, .28); background: rgba(0, 0, 0, .4);
} }
.module_wrapper > .wrapper { .module_wrapper > .wrapper {
...@@ -299,10 +299,11 @@ section { ...@@ -299,10 +299,11 @@ section {
} }
.explanation_container { .explanation_container {
border: none;
top: 30px; top: 30px;
height: 30px; height: 30px;
background: rgba(0, 0, 0, .28); background: rgb(38, 38, 38);
padding: 7px; padding: 8px;
font-size: 12px; font-size: 12px;
} }
......
...@@ -100,7 +100,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), { ...@@ -100,7 +100,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), {
case 'notify': case 'notify':
if (step.v) { if (step.v) {
var $row = this.$table.find('.mtbl-row').eq(step.x); var $row = this.$table.find('.mtbl-row').eq(step.x);
$row.find('.mtbl-cell').eq(step.y).text(TracerUtil.refineNumber(step.v)); $row.find('.mtbl-cell').eq(step.y).text(TracerUtil.refineByType(step.v));
} }
case 'denotify': case 'denotify':
case 'select': case 'select':
...@@ -130,7 +130,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), { ...@@ -130,7 +130,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), {
if (Tracer.prototype.setData.apply(this, arguments)) { if (Tracer.prototype.setData.apply(this, arguments)) {
this.$table.find('.mtbl-row').each(function (i) { this.$table.find('.mtbl-row').each(function (i) {
$(this).children().each(function (j) { $(this).children().each(function (j) {
$(this).text(TracerUtil.refineNumber(D[i][j])); $(this).text(TracerUtil.refineByType(D[i][j]));
}); });
}); });
return true; return true;
...@@ -143,7 +143,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), { ...@@ -143,7 +143,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), {
for (var j = 0; j < D[i].length; j++) { for (var j = 0; j < D[i].length; j++) {
var $cell = $('<div class="mtbl-cell">') var $cell = $('<div class="mtbl-cell">')
.css(this.getCellCss()) .css(this.getCellCss())
.text(TracerUtil.refineNumber(D[i][j])); .text(TracerUtil.refineByType(D[i][j]));
$row.append($cell); $row.append($cell);
} }
} }
......
...@@ -45,7 +45,7 @@ WeightedDirectedGraphTracer.prototype = $.extend(true, Object.create(DirectedGra ...@@ -45,7 +45,7 @@ WeightedDirectedGraphTracer.prototype = $.extend(true, Object.create(DirectedGra
switch (step.type) { switch (step.type) {
case 'weight': case 'weight':
var targetNode = this.graph.nodes(this.n(step.target)); var targetNode = this.graph.nodes(this.n(step.target));
if (step.weight !== undefined) targetNode.weight = TracerUtil.refineNumber(step.weight); if (step.weight !== undefined) targetNode.weight = TracerUtil.refineByType(step.weight);
break; break;
case 'visit': case 'visit':
case 'leave': case 'leave':
...@@ -53,7 +53,7 @@ WeightedDirectedGraphTracer.prototype = $.extend(true, Object.create(DirectedGra ...@@ -53,7 +53,7 @@ WeightedDirectedGraphTracer.prototype = $.extend(true, Object.create(DirectedGra
var targetNode = this.graph.nodes(this.n(step.target)); var targetNode = this.graph.nodes(this.n(step.target));
var color = visit ? this.color.visited : this.color.left; var color = visit ? this.color.visited : this.color.left;
targetNode.color = color; targetNode.color = color;
if (step.weight !== undefined) targetNode.weight = TracerUtil.refineNumber(step.weight); if (step.weight !== undefined) targetNode.weight = TracerUtil.refineByType(step.weight);
if (step.source !== undefined) { if (step.source !== undefined) {
var edgeId = this.e(step.source, step.target); var edgeId = this.e(step.source, step.target);
var edge = this.graph.edges(edgeId); var edge = this.graph.edges(edgeId);
...@@ -97,7 +97,7 @@ WeightedDirectedGraphTracer.prototype = $.extend(true, Object.create(DirectedGra ...@@ -97,7 +97,7 @@ WeightedDirectedGraphTracer.prototype = $.extend(true, Object.create(DirectedGra
target: this.n(j), target: this.n(j),
color: this.color.default, color: this.color.default,
size: 1, size: 1,
weight: TracerUtil.refineNumber(G[i][j]) weight: TracerUtil.refineByType(G[i][j])
}); });
} }
} }
......
...@@ -189,6 +189,12 @@ var TracerUtil = { ...@@ -189,6 +189,12 @@ var TracerUtil = {
return value === "Infinity" ? Infinity : value; return value === "Infinity" ? Infinity : value;
}); });
}, },
refineByType: function (item) {
return $.isNumeric(item) ? this.refineNumber(item) : this.refineString(item);
},
refineString: function (string) {
return string === '' ? ' ' : string;
},
refineNumber: function (number) { refineNumber: function (number) {
return number === Infinity ? '' : number; return number === Infinity ? '' : number;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部