提交 dd5acef1 编写于 作者: J Jason Park

Merge branch 'gh-pages' of https://github.com/parkjs814/AlgorithmVisualizer into gh-pages

......@@ -111,7 +111,7 @@ DirectedGraphTracer.prototype = $.extend(true, Object.create(Tracer.prototype),
var wgap = 1 / (maxDepth - 1);
var dfs = function (node, depth, top, bottom) {
place(node, depth * wgap, (top + bottom) / 2);
place(node, top + bottom, depth * wgap);
var children = 0;
for (var i = 0; i < G[node].length; i++) {
if (G[node][i]) children++;
......
......@@ -239,11 +239,11 @@ $.getJSON('./algorithm/category.json', function (data) {
for (var category in list) {
(function (category) {
var $category = $('<button class="category">')
.append('<i class="fa fa-fw fa-caret-down">')
.append('<i class="fa fa-fw fa-caret-right">')
.append(list[category].name);
$category.click(function () {
$('[data-category="' + category + '"]').toggleClass('collapse');
$(this).find('i.fa').toggleClass('fa-caret-down fa-caret-right');
$(this).find('i.fa').toggleClass('fa-caret-right fa-caret-down');
});
$('#list').append($category);
var subList = list[category].list;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册