Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tianyazhichiC
algorithm-visualizer
提交
869d5fdc
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看板
提交
869d5fdc
编写于
7月 12, 2018
作者:
J
Jason Park
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor changes
上级
36031b77
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
38 addition
and
38 deletion
+38
-38
src/backend/controllers/compiler.js
src/backend/controllers/compiler.js
+1
-1
src/backend/public/algorithms
src/backend/public/algorithms
+1
-1
src/backend/tracers
src/backend/tracers
+1
-1
src/frontend/common/stylesheet/colors.scss
src/frontend/common/stylesheet/colors.scss
+2
-2
src/frontend/core/datas/Array1DData.js
src/frontend/core/datas/Array1DData.js
+4
-4
src/frontend/core/datas/Array2DData.js
src/frontend/core/datas/Array2DData.js
+3
-3
src/frontend/core/datas/Data.js
src/frontend/core/datas/Data.js
+3
-3
src/frontend/core/datas/GraphData.js
src/frontend/core/datas/GraphData.js
+14
-14
src/frontend/core/renderers/Array2DRenderer/index.jsx
src/frontend/core/renderers/Array2DRenderer/index.jsx
+1
-1
src/frontend/core/renderers/Array2DRenderer/stylesheet.scss
src/frontend/core/renderers/Array2DRenderer/stylesheet.scss
+2
-2
src/frontend/core/renderers/ChartRenderer/index.jsx
src/frontend/core/renderers/ChartRenderer/index.jsx
+1
-1
src/frontend/core/renderers/GraphRenderer/stylesheet.scss
src/frontend/core/renderers/GraphRenderer/stylesheet.scss
+5
-5
未找到文件。
src/backend/controllers/compiler.js
浏览文件 @
869d5fdc
...
...
@@ -4,7 +4,7 @@ import path from 'path';
const
router
=
express
.
Router
();
const
getJsWorker
=
(
req
,
res
,
next
)
=>
{
res
.
sendFile
(
path
.
resolve
(
__dirname
,
'
..
'
,
'
tracers
'
,
'
js
'
,
'
built
'
,
'
index.js
'
));
res
.
sendFile
(
path
.
resolve
(
__dirname
,
'
..
'
,
'
tracers
'
,
'
languages
'
,
'
js
'
,
'
built
'
,
'
index.js
'
));
};
const
compileJava
=
(
req
,
res
,
next
)
=>
{
...
...
algorithms
@
0a6c4520
比较
3503c7aa
...
0a6c4520
Subproject commit
3503c7aaefd8940262cc66db16a20d73a3bc5229
Subproject commit
0a6c45206fae3150ea588dd8b92dfe246a29b194
tracers
@
bb36f233
比较
d3a19f1b
...
bb36f233
Subproject commit
d3a19f1bc766d54db2398467539f9245f6d3c6e5
Subproject commit
bb36f233ba74c31c7506f5d3df74a6ec6716f8a8
src/frontend/common/stylesheet/colors.scss
浏览文件 @
869d5fdc
...
...
@@ -5,7 +5,7 @@ $color-font: #bbbbbb;
$color-shadow
:
rgba
(
#000000
,
.2
);
$color-overlay
:
rgba
(
#ffffff
,
.1
);
$color-selected
:
#2962ff
;
$color-
notifi
ed
:
#c51162
;
$color-
patch
ed
:
#c51162
;
$color-highlight
:
#29d
;
:export
{
...
...
@@ -16,6 +16,6 @@ $color-highlight: #29d;
colorShadow
:
$color-shadow
;
colorOverlay
:
$color-overlay
;
colorSelected
:
$color-selected
;
colorNotified
:
$color-
notifi
ed
;
colorNotified
:
$color-
patch
ed
;
colorHighlight
:
$color-highlight
;
}
\ No newline at end of file
src/frontend/core/datas/Array1DData.js
浏览文件 @
869d5fdc
...
...
@@ -21,12 +21,12 @@ class Array1DData extends Array2DData {
super
.
depatch
(
0
,
x
);
}
select
(
s
,
e
=
s
)
{
super
.
select
(
0
,
s
,
0
,
e
);
select
(
s
x
,
ex
=
sx
)
{
super
.
select
(
0
,
s
x
,
0
,
ex
);
}
deselect
(
s
,
e
=
s
)
{
super
.
deselect
(
0
,
s
,
0
,
e
);
deselect
(
s
x
,
ex
=
sx
)
{
super
.
deselect
(
0
,
s
x
,
0
,
ex
);
}
chart
(
tracerKey
)
{
...
...
src/frontend/core/datas/Array2DData.js
浏览文件 @
869d5fdc
...
...
@@ -8,7 +8,7 @@ class Array2DData extends Data {
for
(
const
value
of
array1d
)
{
const
col
=
{
value
,
notifi
ed
:
false
,
patch
ed
:
false
,
selected
:
false
,
};
row
.
push
(
col
);
...
...
@@ -20,11 +20,11 @@ class Array2DData extends Data {
patch
(
x
,
y
,
v
=
this
.
data
[
x
][
y
].
value
)
{
this
.
data
[
x
][
y
].
value
=
v
;
this
.
data
[
x
][
y
].
notifi
ed
=
true
;
this
.
data
[
x
][
y
].
patch
ed
=
true
;
}
depatch
(
x
,
y
)
{
this
.
data
[
x
][
y
].
notifi
ed
=
false
;
this
.
data
[
x
][
y
].
patch
ed
=
false
;
}
select
(
sx
,
sy
,
ex
=
sx
,
ey
=
sy
)
{
...
...
src/frontend/core/datas/Data.js
浏览文件 @
869d5fdc
...
...
@@ -16,11 +16,11 @@ class Data {
if
(
this
.
onRender
)
this
.
onRender
();
}
reset
()
{
this
.
set
();
set
()
{
}
set
()
{
reset
()
{
this
.
set
();
}
delay
()
{
...
...
src/frontend/core/datas/GraphData.js
浏览文件 @
869d5fdc
...
...
@@ -20,14 +20,6 @@ class GraphData extends Data {
this
.
logData
=
null
;
}
directed
(
isDirected
=
true
)
{
this
.
isDirected
=
isDirected
;
}
weighted
(
isWeighted
=
true
)
{
this
.
isWeighted
=
isWeighted
;
}
set
(
array2d
=
[])
{
this
.
nodes
=
[];
this
.
edges
=
[];
...
...
@@ -44,6 +36,14 @@ class GraphData extends Data {
super
.
set
();
}
directed
(
isDirected
=
true
)
{
this
.
isDirected
=
isDirected
;
}
weighted
(
isWeighted
=
true
)
{
this
.
isWeighted
=
isWeighted
;
}
addNode
(
id
,
weight
=
null
,
visitedCount
=
0
,
selectedCount
=
0
,
x
=
0
,
y
=
0
)
{
if
(
this
.
findNode
(
id
))
return
;
this
.
nodes
.
push
({
id
,
weight
,
visitedCount
,
selectedCount
,
x
,
y
});
...
...
@@ -184,14 +184,14 @@ class GraphData extends Data {
}
visit
(
target
,
source
,
weight
)
{
this
.
visitOrLeave
(
t
arget
,
source
,
weight
,
true
);
this
.
visitOrLeave
(
t
rue
,
target
,
source
,
weight
);
}
leave
(
target
,
source
,
weight
)
{
this
.
visitOrLeave
(
target
,
source
,
weight
,
false
);
this
.
visitOrLeave
(
false
,
target
,
source
,
weight
);
}
visitOrLeave
(
target
,
source
,
weight
,
visit
)
{
visitOrLeave
(
visit
,
target
,
source
=
null
,
weight
=
null
)
{
const
edge
=
this
.
findEdge
(
source
,
target
);
if
(
edge
)
edge
.
visitedCount
+=
visit
?
1
:
-
1
;
const
node
=
this
.
findNode
(
target
);
...
...
@@ -203,14 +203,14 @@ class GraphData extends Data {
}
select
(
target
,
source
)
{
this
.
selectOrDeselect
(
t
arget
,
source
,
tru
e
);
this
.
selectOrDeselect
(
t
rue
,
target
,
sourc
e
);
}
deselect
(
target
,
source
)
{
this
.
selectOrDeselect
(
target
,
source
,
fals
e
);
this
.
selectOrDeselect
(
false
,
target
,
sourc
e
);
}
selectOrDeselect
(
target
,
source
,
select
)
{
selectOrDeselect
(
select
,
target
,
source
=
null
)
{
const
edge
=
this
.
findEdge
(
source
,
target
);
if
(
edge
)
edge
.
selectedCount
+=
select
?
1
:
-
1
;
const
node
=
this
.
findNode
(
target
);
...
...
src/frontend/core/renderers/Array2DRenderer/index.jsx
浏览文件 @
869d5fdc
...
...
@@ -16,7 +16,7 @@ class Array2DRenderer extends Renderer {
<
tr
className
=
{
styles
.
row
}
key
=
{
i
}
>
{
row
.
map
((
col
,
j
)
=>
(
<
td
className
=
{
classes
(
styles
.
col
,
col
.
selected
&&
styles
.
selected
,
col
.
notified
&&
styles
.
notifi
ed
)
}
<
td
className
=
{
classes
(
styles
.
col
,
col
.
selected
&&
styles
.
selected
,
col
.
patched
&&
styles
.
patch
ed
)
}
key
=
{
j
}
>
<
span
className
=
{
styles
.
value
}
>
{
this
.
toString
(
col
.
value
)
}
</
span
>
</
td
>
...
...
src/frontend/core/renderers/Array2DRenderer/stylesheet.scss
浏览文件 @
869d5fdc
...
...
@@ -28,8 +28,8 @@
background-color
:
$color-selected
;
}
&
.
notifi
ed
{
background-color
:
$color-
notifi
ed
;
&
.
patch
ed
{
background-color
:
$color-
patch
ed
;
}
}
}
...
...
src/frontend/core/renderers/ChartRenderer/index.jsx
浏览文件 @
869d5fdc
...
...
@@ -10,7 +10,7 @@ class ChartRenderer extends Array1DRenderer {
const
chartData
=
{
labels
:
row
.
map
(
col
=>
`
${
col
.
value
}
`
),
datasets
:
[{
backgroundColor
:
row
.
map
(
col
=>
col
.
notifi
ed
?
styles
.
colorNotified
:
col
.
selected
?
styles
.
colorSelected
:
styles
.
colorFont
),
backgroundColor
:
row
.
map
(
col
=>
col
.
patch
ed
?
styles
.
colorNotified
:
col
.
selected
?
styles
.
colorSelected
:
styles
.
colorFont
),
data
:
row
.
map
(
col
=>
col
.
value
),
}],
};
...
...
src/frontend/core/renderers/GraphRenderer/stylesheet.scss
浏览文件 @
869d5fdc
...
...
@@ -33,8 +33,8 @@
&
.visited
{
.circle
{
fill
:
$color-
notifi
ed
;
stroke
:
$color-
notifi
ed
;
fill
:
$color-
patch
ed
;
stroke
:
$color-
patch
ed
;
}
}
}
...
...
@@ -71,7 +71,7 @@
&
.visited
{
.line
{
stroke
:
$color-
notifi
ed
;
stroke
:
$color-
patch
ed
;
&
.directed
{
marker-end
:
url(#markerArrowVisited)
;
...
...
@@ -79,7 +79,7 @@
}
.weight
{
fill
:
$color-
notifi
ed
;
fill
:
$color-
patch
ed
;
}
}
}
...
...
@@ -92,7 +92,7 @@
}
&
.visited
{
fill
:
$color-
notifi
ed
;
fill
:
$color-
patch
ed
;
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录