Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tianyazhichiC
algorithm-visualizer
提交
4f8b12c4
A
algorithm-visualizer
项目概览
tianyazhichiC
/
algorithm-visualizer
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
algorithm-visualizer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4f8b12c4
编写于
5月 21, 2016
作者:
J
Jason Park
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add Scratch Paper
上级
4d1f8419
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
64 addition
and
28 deletion
+64
-28
css/stylesheet.css
css/stylesheet.css
+13
-1
index.html
index.html
+7
-2
js/module/array2d.js
js/module/array2d.js
+0
-1
js/module/graph.js
js/module/graph.js
+0
-1
js/module/tracer.js
js/module/tracer.js
+3
-1
js/script.js
js/script.js
+41
-22
未找到文件。
css/stylesheet.css
浏览文件 @
4f8b12c4
...
...
@@ -42,6 +42,10 @@ button.active {
background
:
rgb
(
44
,
44
,
44
);
}
button
.category
{
background
:
rgba
(
0
,
0
,
0
,
.10
);
}
button
.indent
{
padding-left
:
36px
;
}
...
...
@@ -90,7 +94,11 @@ nav h3 {
visibility
:
visible
;
}
#list
>
button
{
.sidemenu
#header
{
border-top
:
2px
solid
rgb
(
44
,
44
,
44
);
}
.sidemenu
button
{
display
:
block
;
width
:
100%
;
height
:
30px
;
...
...
@@ -163,6 +171,10 @@ section {
visibility
:
visible
;
}
#tab_desc
>
.wrapper
a
{
text-decoration
:
underline
;
}
.tab_bar
{
bottom
:
0
;
left
:
0
;
...
...
index.html
浏览文件 @
4f8b12c4
...
...
@@ -30,6 +30,11 @@
<section
class=
"sidemenu active"
>
<div
id=
"list"
>
</div>
<div
id=
"header"
>
<a
href=
"https://github.com/parkjs814/AlgorithmVisualizer/wiki"
>
<button>
Documentation
</button>
</a>
</div>
<a
class=
"github-fork-ribbon left-bottom"
href=
"http://github.com/parkjs814/AlgorithmVisualizer"
title=
"Fork me on GitHub"
>
Fork me on GitHub
</a>
</section>
...
...
@@ -37,7 +42,7 @@
<div
class=
"viewer_container"
>
<section
class=
"module_container"
></section>
<section
class=
"tab_container"
>
<div
class=
"tab active"
id=
"tab_desc
ription
"
>
<div
class=
"tab active"
id=
"tab_desc"
>
<div
class=
"wrapper"
>
<h2
id=
"desc_title"
></h2>
<p
id=
"desc_def"
></p>
...
...
@@ -61,7 +66,7 @@
</div>
</section>
<section
class=
"tab_bar"
>
<button
class=
"active"
id=
"btn_desc
ription
"
>
Description
</button>
<button
class=
"active"
id=
"btn_desc"
>
Description
</button>
<button
id=
"btn_trace"
>
Trace
</button>
</section>
</div>
...
...
js/module/array2d.js
浏览文件 @
4f8b12c4
...
...
@@ -256,7 +256,6 @@ Array2DTracer.prototype.mousewheel = function (e) {
};
var
initTable
=
function
()
{
$module_container
.
empty
();
$table
=
$
(
'
<div class="mtbl-table">
'
);
$module_container
.
append
(
$table
);
};
...
...
js/module/graph.js
浏览文件 @
4f8b12c4
...
...
@@ -183,7 +183,6 @@ GraphTracer.prototype.prevStep = function () {
};
var
initGraph
=
function
()
{
$module_container
.
empty
();
if
(
sigmaCanvas
==
null
)
{
sigmaCanvas
=
$
.
extend
(
true
,
{},
sigma
.
canvas
);
}
else
{
...
...
js/module/tracer.js
浏览文件 @
4f8b12c4
...
...
@@ -10,7 +10,9 @@ var Tracer = function (module) {
this
.
traceIndex
=
-
1
;
this
.
stepCnt
=
0
;
return
lastModule
!=
module
;
var
moduleChanged
=
lastModule
!=
module
;
if
(
moduleChanged
)
$module_container
.
empty
();
return
moduleChanged
;
};
Tracer
.
prototype
.
resize
=
function
()
{
...
...
js/script.js
浏览文件 @
4f8b12c4
$
.
ajaxSetup
({
cache
:
false
,
dataType
:
"
text
"
});
$
(
document
).
on
(
'
click
'
,
'
a
'
,
function
(
e
)
{
e
.
preventDefault
();
var
win
=
window
.
open
(
$
(
this
).
attr
(
'
href
'
),
'
_blank
'
);
if
(
!
win
)
{
alert
(
'
Please allow popups for this site
'
);
}
});
var
$module_container
=
$
(
'
.module_container
'
);
var
_tracer
=
new
Tracer
();
var
initEditor
=
function
(
id
)
{
...
...
@@ -41,15 +50,11 @@ var loadFile = function (category, algorithm, file, explanation) {
var
loadAlgorithm
=
function
(
category
,
algorithm
)
{
$
(
'
#list > button
'
).
removeClass
(
'
active
'
);
$
(
'
[data-category="
'
+
category
+
'
"][data-algorithm="
'
+
algorithm
+
'
"]
'
).
addClass
(
'
active
'
);
$
(
'
#btn_desc
ription
'
).
click
();
$
(
'
#btn_desc
'
).
click
();
$
(
'
#category
'
).
text
(
list
[
category
].
name
);
$
(
'
#algorithm, #desc_title
'
).
text
(
list
[
category
].
list
[
algorithm
]);
$
(
'
#desc_def
'
).
html
(
''
);
$
(
'
#desc_app
'
).
empty
();
$
(
'
#desc_time
'
).
html
(
''
);
$
(
'
#desc_space
'
).
html
(
''
);
$
(
'
#desc_ref
'
).
empty
();
$
(
'
#tab_desc > .wrapper
'
).
empty
();
$
(
'
.files_bar
'
).
empty
();
$
(
'
#explanation
'
).
html
(
''
);
dataEditor
.
setValue
(
''
);
...
...
@@ -57,20 +62,34 @@ var loadAlgorithm = function (category, algorithm) {
var
dir
=
'
./algorithm/
'
+
category
+
'
/
'
+
algorithm
+
'
/
'
;
$
.
getJSON
(
dir
+
'
desc.json
'
,
function
(
data
)
{
$
(
'
#desc_def
'
).
html
(
data
.
def
);
$
(
'
#desc_app
'
).
empty
();
data
.
apps
.
forEach
(
function
(
app
)
{
$
(
'
#desc_app
'
).
append
(
$
(
'
<li>
'
).
html
(
app
));
});
$
(
'
#desc_time
'
).
html
(
data
.
cpx
.
time
);
$
(
'
#desc_space
'
).
html
(
data
.
cpx
.
space
);
$
(
'
#desc_ref
'
).
empty
();
data
.
refs
.
forEach
(
function
(
ref
)
{
$
(
'
#desc_ref
'
).
append
(
$
(
'
<li>
'
).
html
(
'
<a href="
'
+
ref
+
'
" target="_blank">
'
+
ref
+
'
</a>
'
));
});
var
files
=
data
.
files
;
delete
data
.
files
;
var
$container
=
$
(
'
#tab_desc > .wrapper
'
);
$container
.
empty
();
for
(
var
key
in
data
)
{
if
(
key
)
$container
.
append
(
$
(
'
<h3>
'
).
html
(
key
));
var
value
=
data
[
key
];
if
(
typeof
value
===
"
string
"
)
{
$container
.
append
(
$
(
'
<p>
'
).
html
(
value
));
}
else
if
(
Array
.
isArray
(
value
))
{
var
$ul
=
$
(
'
<ul>
'
);
$container
.
append
(
$ul
);
value
.
forEach
(
function
(
li
)
{
$ul
.
append
(
$
(
'
<li>
'
).
html
(
li
));
});
}
else
if
(
typeof
value
===
"
object
"
)
{
var
$ul
=
$
(
'
<ul>
'
);
$container
.
append
(
$ul
);
for
(
var
prop
in
value
)
{
$ul
.
append
(
$
(
'
<li>
'
).
append
(
$
(
'
<strong>
'
).
html
(
prop
)).
append
(
'
'
+
value
[
prop
]));
}
}
}
$
(
'
.files_bar
'
).
empty
();
var
init
=
false
;
for
(
var
file
in
data
.
files
)
{
for
(
var
file
in
files
)
{
(
function
(
file
,
explanation
)
{
var
$file
=
$
(
'
<button>
'
).
append
(
file
).
click
(
function
()
{
loadFile
(
category
,
algorithm
,
file
,
explanation
);
...
...
@@ -82,7 +101,7 @@ var loadAlgorithm = function (category, algorithm) {
init
=
true
;
$file
.
click
();
}
})(
file
,
data
.
files
[
file
]);
})(
file
,
files
[
file
]);
}
});
};
...
...
@@ -92,7 +111,7 @@ $.getJSON('./algorithm/category.json', function (data) {
var
init
=
false
;
for
(
var
category
in
list
)
{
(
function
(
category
)
{
var
$category
=
$
(
'
<button>
'
).
append
(
list
[
category
].
name
);
var
$category
=
$
(
'
<button
class="category"
>
'
).
append
(
list
[
category
].
name
);
$
(
'
#list
'
).
append
(
$category
);
var
subList
=
list
[
category
].
list
;
for
(
var
algorithm
in
subList
)
{
...
...
@@ -167,9 +186,9 @@ $('#btn_next').click(function () {
_tracer
.
nextStep
();
});
$
(
'
#btn_desc
ription
'
).
click
(
function
()
{
$
(
'
#btn_desc
'
).
click
(
function
()
{
$
(
'
.tab_container > .tab
'
).
removeClass
(
'
active
'
);
$
(
'
#tab_desc
ription
'
).
addClass
(
'
active
'
);
$
(
'
#tab_desc
'
).
addClass
(
'
active
'
);
$
(
'
.tab_bar > button
'
).
removeClass
(
'
active
'
);
$
(
this
).
addClass
(
'
active
'
);
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录