Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tianyazhichiC
algorithm-visualizer
提交
b4801513
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b4801513
编写于
5月 01, 2018
作者:
J
Jason Park
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Show contributors
上级
99a6a60d
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
232 addition
and
89 deletion
+232
-89
environment.js
environment.js
+3
-5
src/backend/common/github.js
src/backend/common/github.js
+9
-0
src/backend/controllers/hierarchy.js
src/backend/controllers/hierarchy.js
+66
-12
src/backend/public/algorithms
src/backend/public/algorithms
+1
-1
src/frontend/components/App/index.jsx
src/frontend/components/App/index.jsx
+1
-2
src/frontend/components/Button/index.jsx
src/frontend/components/Button/index.jsx
+5
-1
src/frontend/components/CodeEditor/index.jsx
src/frontend/components/CodeEditor/index.jsx
+55
-16
src/frontend/components/CodeEditor/stylesheet.scss
src/frontend/components/CodeEditor/stylesheet.scss
+23
-15
src/frontend/components/ContributorsViewer/index.jsx
src/frontend/components/ContributorsViewer/index.jsx
+27
-0
src/frontend/components/ContributorsViewer/stylesheet.scss
src/frontend/components/ContributorsViewer/stylesheet.scss
+21
-0
src/frontend/components/DescriptionViewer/index.jsx
src/frontend/components/DescriptionViewer/index.jsx
+16
-10
src/frontend/components/DescriptionViewer/stylesheet.scss
src/frontend/components/DescriptionViewer/stylesheet.scss
+3
-20
src/frontend/components/MarkdownViewer/index.jsx
src/frontend/components/MarkdownViewer/index.jsx
+1
-1
src/frontend/components/index.js
src/frontend/components/index.js
+1
-0
src/frontend/core/tracerManager.jsx
src/frontend/core/tracerManager.jsx
+0
-6
未找到文件。
environment.js
浏览文件 @
b4801513
...
...
@@ -11,7 +11,7 @@ const {
GITHUB_BOT_USERNAME
,
GITHUB_BOT_PASSWORD
,
GITHUB_ORG
=
'
algorithm-visualizer
'
,
GITHUB_REPO
_ALGORITHMS
=
'
algorithms
'
,
GITHUB_REPO
=
'
algorithms
'
,
}
=
process
.
env
;
const
__PROD__
=
NODE_ENV
===
'
production
'
;
...
...
@@ -27,9 +27,7 @@ const githubBotAuth = {
password
:
GITHUB_BOT_PASSWORD
,
};
const
githubOrg
=
GITHUB_ORG
;
const
githubRepos
=
{
algorithms
:
GITHUB_REPO_ALGORITHMS
};
const
githubRepo
=
GITHUB_REPO
;
const
builtPath
=
path
.
resolve
(
__dirname
,
'
built
'
);
const
frontendBuiltPath
=
path
.
resolve
(
builtPath
,
'
frontend
'
);
...
...
@@ -50,7 +48,7 @@ module.exports = {
githubClientSecret
,
githubBotAuth
,
githubOrg
,
githubRepo
s
,
githubRepo
,
frontendBuiltPath
,
backendBuiltPath
,
frontendSrcPath
,
...
...
src/backend/common/github.js
0 → 100644
浏览文件 @
b4801513
import
GitHub
from
'
github-api
'
;
import
{
githubBotAuth
,
githubOrg
,
githubRepo
}
from
'
/environment
'
;
const
gh
=
new
GitHub
(
githubBotAuth
);
const
repo
=
gh
.
getRepo
(
githubOrg
,
githubRepo
);
export
{
repo
,
};
\ No newline at end of file
src/backend/controllers/hierarchy.js
浏览文件 @
b4801513
...
...
@@ -2,6 +2,8 @@ import express from 'express';
import
fs
from
'
fs
'
;
import
path
from
'
path
'
;
import
{
NotFoundError
}
from
'
/common/error
'
;
import
{
exec
}
from
'
child_process
'
;
import
{
repo
}
from
'
/common/github
'
;
const
router
=
express
.
Router
();
...
...
@@ -10,46 +12,98 @@ const createKey = name => name.toLowerCase().replace(/ /g, '-');
const
list
=
dirPath
=>
fs
.
readdirSync
(
dirPath
).
filter
(
filename
=>
!
filename
.
startsWith
(
'
.
'
));
const
cacheHierarchy
=
()
=>
{
const
getCategory
=
categoryName
=>
{
const
allFiles
=
[];
const
cacheCategory
=
categoryName
=>
{
const
categoryKey
=
createKey
(
categoryName
);
const
categoryPath
=
getPath
(
categoryName
);
const
algorithms
=
list
(
categoryPath
).
map
(
algorithmName
=>
get
Algorithm
(
categoryName
,
algorithmName
));
const
algorithms
=
list
(
categoryPath
).
map
(
algorithmName
=>
cache
Algorithm
(
categoryName
,
algorithmName
));
return
{
key
:
categoryKey
,
name
:
categoryName
,
algorithms
,
};
};
const
get
Algorithm
=
(
categoryName
,
algorithmName
)
=>
{
const
cache
Algorithm
=
(
categoryName
,
algorithmName
)
=>
{
const
algorithmKey
=
createKey
(
algorithmName
);
const
algorithmPath
=
getPath
(
categoryName
,
algorithmName
);
const
files
=
list
(
algorithmPath
);
const
files
=
list
(
algorithmPath
).
map
(
fileName
=>
cacheFile
(
categoryName
,
algorithmName
,
fileName
));
allFiles
.
push
(...
files
);
return
{
key
:
algorithmKey
,
name
:
algorithmName
,
files
,
};
};
return
list
(
getPath
()).
map
(
getCategory
);
};
const
cacheFile
=
(
categoryName
,
algorithmName
,
fileName
)
=>
{
const
filePath
=
getPath
(
categoryName
,
algorithmName
,
fileName
);
const
content
=
fs
.
readFileSync
(
filePath
,
'
utf-8
'
);
return
{
name
:
fileName
,
path
:
filePath
,
content
,
contributors
:
[],
toJSON
:
()
=>
fileName
,
};
};
const
hierarchy
=
list
(
getPath
()).
map
(
cacheCategory
);
const
hierarchy
=
cacheHierarchy
();
const
commitAuthors
=
{};
const
cacheCommitAuthors
=
(
page
,
done
)
=>
{
repo
.
listCommits
({
per_page
:
100
,
page
}).
then
(({
data
})
=>
{
if
(
data
.
length
)
{
data
.
forEach
(({
sha
,
commit
,
author
})
=>
{
if
(
!
author
)
return
;
const
{
login
,
avatar_url
}
=
author
;
commitAuthors
[
sha
]
=
{
login
,
avatar_url
};
});
cacheCommitAuthors
(
page
+
1
,
done
);
}
else
done
&&
done
();
}).
catch
(
console
.
error
);
};
const
cacheContributors
=
(
fileIndex
,
done
)
=>
{
const
file
=
allFiles
[
fileIndex
];
if
(
file
)
{
const
cwd
=
getPath
();
exec
(
`git --no-pager log --follow --format="%H" "
${
file
.
path
}
"`
,
{
cwd
},
(
error
,
stdout
,
stderr
)
=>
{
if
(
!
error
&&
!
stderr
)
{
const
output
=
stdout
.
toString
().
replace
(
/
\n
$/
,
''
);
const
shas
=
output
.
split
(
'
\n
'
).
reverse
();
const
contributors
=
[];
for
(
const
sha
of
shas
)
{
const
author
=
commitAuthors
[
sha
];
if
(
author
&&
!
contributors
.
find
(
contributor
=>
contributor
.
login
===
author
.
login
))
{
contributors
.
push
(
author
);
}
}
file
.
contributors
=
contributors
;
}
cacheContributors
(
fileIndex
+
1
,
done
);
});
}
else
done
&&
done
();
};
cacheCommitAuthors
(
1
,
()
=>
cacheContributors
(
0
));
return
hierarchy
;
};
const
cachedHierarchy
=
cacheHierarchy
();
// TODO: cache again when webhooked
const
getHierarchy
=
(
req
,
res
,
next
)
=>
{
res
.
json
({
hierarchy
});
res
.
json
({
hierarchy
:
cachedHierarchy
});
};
const
getFile
=
(
req
,
res
,
next
)
=>
{
const
{
categoryKey
,
algorithmKey
,
fileName
}
=
req
.
params
;
const
category
=
h
ierarchy
.
find
(
category
=>
category
.
key
===
categoryKey
);
const
category
=
cachedH
ierarchy
.
find
(
category
=>
category
.
key
===
categoryKey
);
if
(
!
category
)
return
next
(
new
NotFoundError
());
const
algorithm
=
category
.
algorithms
.
find
(
algorithm
=>
algorithm
.
key
===
algorithmKey
);
if
(
!
algorithm
)
return
next
(
new
NotFoundError
());
if
(
!
algorithm
.
files
.
includes
(
fileName
))
return
next
(
new
NotFoundError
());
const
file
=
algorithm
.
files
.
find
(
file
=>
file
.
name
===
fileName
);
if
(
!
file
)
return
next
(
new
NotFoundError
());
const
filePath
=
getPath
(
category
.
name
,
algorithm
.
name
,
fileName
)
;
res
.
sendFile
(
filePath
);
const
{
content
,
contributors
}
=
file
;
res
.
json
({
file
:
{
content
,
contributors
}
}
);
};
router
.
route
(
'
/
'
)
...
...
algorithms
@
f17c5704
比较
417e8c9f
...
f17c5704
Subproject commit
417e8c9ffe9bf8411f0099ea01098c0919468a07
Subproject commit
f17c57048f65f287d12e13e6f35b606034aeeb31
src/frontend/components/App/index.jsx
浏览文件 @
b4801513
...
...
@@ -6,7 +6,7 @@ import { Workspace, WSSectionContainer, WSTabContainer } from '/workspace/compon
import
{
Section
}
from
'
/workspace/core
'
;
import
{
actions
as
toastActions
}
from
'
/reducers/toast
'
;
import
{
actions
as
envActions
}
from
'
/reducers/env
'
;
import
{
HierarchyApi
,
GitHub
Api
}
from
'
/apis
'
;
import
{
GitHubApi
,
Hierarchy
Api
}
from
'
/apis
'
;
import
{
tracerManager
}
from
'
/core
'
;
import
styles
from
'
./stylesheet.scss
'
;
import
'
axios-progress-bar/dist/nprogress.css
'
...
...
@@ -63,7 +63,6 @@ class App extends React.Component {
updateDirectory
({
categoryKey
=
null
,
algorithmKey
=
null
})
{
if
(
categoryKey
&&
algorithmKey
)
{
this
.
props
.
setDirectory
(
categoryKey
,
algorithmKey
);
HierarchyApi
.
getFile
(
categoryKey
,
algorithmKey
,
'
code.js
'
).
then
(
code
=>
tracerManager
.
setCode
(
code
));
}
}
...
...
src/frontend/components/Button/index.jsx
浏览文件 @
b4801513
...
...
@@ -28,7 +28,11 @@ class Button extends React.Component {
return
to
?
(
<
Link
to
=
{
to
}
{
...
props
}
/>
)
:
href
?
(
<
a
href
=
{
href
}
{
...
props
}
/>
/^https
?
:
\/\/
/i
.
test
(
href
)
?
(
<
a
href
=
{
href
}
rel
=
"noopener"
target
=
"_blank"
{
...
props
}
/>
)
:
(
<
a
href
=
{
href
}
{
...
props
}
/>
)
)
:
(
<
div
{
...
props
}
/>
);
...
...
src/frontend/components/CodeEditor/index.jsx
浏览文件 @
b4801513
import
React
from
'
react
'
;
import
AceEditor
from
'
react-ace
'
;
import
{
connect
}
from
'
react-redux
'
;
import
'
brace/mode/javascript
'
;
import
'
brace/theme/tomorrow_night_eighties
'
;
import
{
tracerManager
}
from
'
/core
'
;
import
{
classes
}
from
'
/common/util
'
;
import
styles
from
'
./stylesheet.scss
'
;
import
{
HierarchyApi
}
from
'
/apis
'
;
import
{
ContributorsViewer
}
from
'
/components
'
;
import
{
actions
as
envActions
}
from
'
/reducers/env
'
;
// TODO: code should not be reloaded when reopening tab
@
connect
(
({
env
})
=>
({
env
}),
{
...
envActions
}
)
class
CodeEditor
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
const
{
lineIndicator
,
code
}
=
tracerManager
;
const
{
lineIndicator
}
=
tracerManager
;
this
.
state
=
{
lineMarker
:
this
.
createLineMarker
(
lineIndicator
),
code
,
file
:
null
,
};
}
componentDidMount
()
{
tracerManager
.
setOnUpdateCode
(
code
=>
this
.
setState
({
code
}));
const
{
categoryKey
,
algorithmKey
}
=
this
.
props
.
env
;
this
.
loadFile
(
categoryKey
,
algorithmKey
);
tracerManager
.
setOnUpdateLineIndicator
(
lineIndicator
=>
this
.
setState
({
lineMarker
:
this
.
createLineMarker
(
lineIndicator
)
}));
}
componentWillReceiveProps
(
nextProps
)
{
const
{
categoryKey
,
algorithmKey
}
=
nextProps
.
env
;
if
(
categoryKey
!==
this
.
props
.
env
.
categoryKey
||
algorithmKey
!==
this
.
props
.
env
.
algorithmKey
)
{
this
.
loadFile
(
categoryKey
,
algorithmKey
);
}
}
componentWillUnmount
()
{
tracerManager
.
setOnUpdateCode
(
null
);
tracerManager
.
setOnUpdateLineIndicator
(
null
);
}
loadFile
(
categoryKey
,
algorithmKey
)
{
HierarchyApi
.
getFile
(
categoryKey
,
algorithmKey
,
'
code.js
'
)
.
then
(({
file
})
=>
{
this
.
setState
({
file
});
tracerManager
.
setCode
(
file
.
content
);
})
.
catch
(()
=>
this
.
setState
({
file
:
null
}));
}
createLineMarker
(
lineIndicator
)
{
if
(
lineIndicator
===
null
)
return
null
;
const
{
lineNumber
,
cursor
}
=
lineIndicator
;
...
...
@@ -42,21 +72,30 @@ class CodeEditor extends React.Component {
};
}
handleChangeCode
(
code
)
{
const
file
=
{
...
this
.
state
.
file
,
content
:
code
};
this
.
setState
({
file
});
tracerManager
.
setCode
(
code
);
}
render
()
{
const
{
lineMarker
,
cod
e
}
=
this
.
state
;
const
{
lineMarker
,
fil
e
}
=
this
.
state
;
const
{
className
,
relativeWeight
}
=
this
.
props
;
return
(
<
AceEditor
className
=
{
classes
(
styles
.
code_editor
,
className
)
}
mode
=
"javascript"
theme
=
"tomorrow_night_eighties"
name
=
"code_editor"
editorProps
=
{
{
$blockScrolling
:
true
}
}
onChange
=
{
code
=>
tracerManager
.
setCode
(
code
)
}
markers
=
{
lineMarker
?
[
lineMarker
]
:
[]
}
value
=
{
code
}
width
=
{
`
${
relativeWeight
}
`
}
/>
// trick to update on resize
return
file
&&
(
<
div
className
=
{
classes
(
styles
.
code_editor
,
className
)
}
>
<
AceEditor
className
=
{
styles
.
ace_editor
}
mode
=
"javascript"
theme
=
"tomorrow_night_eighties"
name
=
"code_editor"
editorProps
=
{
{
$blockScrolling
:
true
}
}
onChange
=
{
code
=>
this
.
handleChangeCode
(
code
)
}
markers
=
{
lineMarker
?
[
lineMarker
]
:
[]
}
value
=
{
file
.
content
}
width
=
{
`
${
relativeWeight
}
`
}
/>
<
ContributorsViewer
contributors
=
{
file
.
contributors
}
/>
</
div
>
// TODO: trick to update on resize
);
}
}
...
...
src/frontend/components/CodeEditor/stylesheet.scss
浏览文件 @
b4801513
@import
"~/common/stylesheet/index"
;
.code_editor
{
width
:
100%
!
important
;
height
:
100%
!
important
;
min-width
:
0
!
important
;
min-height
:
0
!
important
;
flex
:
1
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
stretch
;
.current_line_marker
{
background
:
rgba
(
$color-highlight
,
0
.4
);
border
:
1px
solid
$color-highlight
;
position
:
absolute
;
.ace_editor
{
flex
:
1
;
width
:
100%
!
important
;
height
:
100%
!
important
;
min-width
:
0
!
important
;
min-height
:
0
!
important
;
animation
:
line_highlight
.1s
;
}
.current_line_marker
{
background
:
rgba
(
$color-highlight
,
0
.4
);
border
:
1px
solid
$color-highlight
;
position
:
absolute
;
width
:
100%
!
important
;
@keyframes
line_highlight
{
from
{
background
:
rgba
(
$color-highlight
,
0
.1
);
animation
:
line_highlight
.1s
;
}
to
{
background
:
rgba
(
$color-highlight
,
0
.4
);
@keyframes
line_highlight
{
from
{
background
:
rgba
(
$color-highlight
,
0
.1
);
}
to
{
background
:
rgba
(
$color-highlight
,
0
.4
);
}
}
}
}
\ No newline at end of file
src/frontend/components/ContributorsViewer/index.jsx
0 → 100644
浏览文件 @
b4801513
import
React
from
'
react
'
;
import
{
classes
}
from
'
/common/util
'
;
import
styles
from
'
./stylesheet.scss
'
;
import
{
Button
}
from
'
/components
'
;
class
ContributorsViewer
extends
React
.
Component
{
render
()
{
const
{
className
,
contributors
}
=
this
.
props
;
return
(
<
div
className
=
{
classes
(
styles
.
contributors_viewer
,
className
)
}
>
<
span
className
=
{
classes
(
styles
.
contributor
,
styles
.
label
)
}
>
Contributed by
</
span
>
{
contributors
.
map
(
contributor
=>
(
<
Button
className
=
{
styles
.
contributor
}
icon
=
{
contributor
.
avatar_url
}
key
=
{
contributor
.
login
}
href
=
{
`https://github.com/
${
contributor
.
login
}
`
}
>
{
contributor
.
login
}
</
Button
>
))
}
</
div
>
);
}
}
export
default
ContributorsViewer
;
src/frontend/components/ContributorsViewer/stylesheet.scss
0 → 100644
浏览文件 @
b4801513
@import
"~/common/stylesheet/index"
;
.contributors_viewer
{
display
:
flex
;
flex-wrap
:
wrap
;
align-items
:
center
;
padding
:
4px
;
background-color
:
$theme-normal
;
.contributor
{
height
:
28px
;
padding
:
0
6px
;
font-weight
:
bold
;
&
.label
{
display
:
flex
;
align-items
:
center
;
white-space
:
nowrap
;
}
}
}
\ No newline at end of file
src/frontend/components/DescriptionViewer/index.jsx
浏览文件 @
b4801513
...
...
@@ -2,7 +2,9 @@ import React from 'react';
import
{
connect
}
from
'
react-redux
'
;
import
{
actions
as
envActions
}
from
'
/reducers/env
'
;
import
{
HierarchyApi
}
from
'
/apis/index
'
;
import
{
MarkdownViewer
}
from
'
/components
'
;
import
{
ContributorsViewer
,
MarkdownViewer
}
from
'
/components
'
;
import
styles
from
'
./stylesheet.scss
'
;
import
{
classes
}
from
'
/common/util
'
;
@
connect
(
({
env
})
=>
({
...
...
@@ -16,14 +18,14 @@ class DescriptionViewer extends React.Component {
super
(
props
);
this
.
state
=
{
sourc
e
:
null
,
fil
e
:
null
,
};
}
componentDidMount
()
{
const
{
categoryKey
,
algorithmKey
}
=
this
.
props
.
env
;
const
href
=
`/algorithm/
${
categoryKey
}
/
${
algorithmKey
}
`
;
this
.
load
Markdown
(
href
);
this
.
load
File
(
href
);
}
componentWillReceiveProps
(
nextProps
)
{
...
...
@@ -31,21 +33,25 @@ class DescriptionViewer extends React.Component {
if
(
categoryKey
!==
this
.
props
.
env
.
categoryKey
||
algorithmKey
!==
this
.
props
.
env
.
algorithmKey
)
{
const
href
=
`/algorithm/
${
categoryKey
}
/
${
algorithmKey
}
`
;
this
.
load
Markdown
(
href
);
this
.
load
File
(
href
);
}
}
load
Markdown
(
href
)
{
load
File
(
href
)
{
const
[,
,
categoryKey
,
algorithmKey
]
=
href
.
split
(
'
/
'
);
HierarchyApi
.
getFile
(
categoryKey
,
algorithmKey
,
'
desc.md
'
)
.
then
(
source
=>
this
.
setState
({
sourc
e
}))
.
catch
(()
=>
this
.
setState
({
sourc
e
:
null
}));
.
then
(
({
file
})
=>
this
.
setState
({
fil
e
}))
.
catch
(()
=>
this
.
setState
({
fil
e
:
null
}));
}
render
()
{
const
{
source
}
=
this
.
state
;
return
(
<
MarkdownViewer
source
=
{
source
}
onClickLink
=
{
href
=>
this
.
loadMarkdown
(
href
)
}
/>
const
{
className
}
=
this
.
props
;
const
{
file
}
=
this
.
state
;
return
file
&&
(
<
div
className
=
{
classes
(
styles
.
description_viewer
,
className
)
}
>
<
MarkdownViewer
className
=
{
styles
.
markdown_viewer
}
source
=
{
file
.
content
}
onClickLink
=
{
href
=>
this
.
loadFile
(
href
)
}
/>
<
ContributorsViewer
contributors
=
{
file
.
contributors
}
/>
</
div
>
);
}
}
...
...
src/frontend/components/DescriptionViewer/stylesheet.scss
浏览文件 @
b4801513
@import
"~/common/stylesheet/index"
;
.description_viewer
{
flex
:
1
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
stretch
;
padding
:
16px
;
font-size
:
$font-size-large
;
overflow-y
:
auto
;
li
{
margin
:
10px
0px
;
}
.complexity_type
{
font-weight
:
bold
;
}
a
{
text-decoration
:
underline
;
cursor
:
pointer
;
}
h3
{
border-bottom
:
1px
solid
rgb
(
81
,
81
,
81
);
padding
:
5px
;
margin
:
2px
;
.markdown_viewer
{
flex
:
1
;
}
}
\ No newline at end of file
src/frontend/components/MarkdownViewer/index.jsx
浏览文件 @
b4801513
...
...
@@ -8,7 +8,7 @@ class MarkdownViewer extends React.Component {
const
{
className
,
source
,
onClickLink
}
=
this
.
props
;
const
link
=
({
href
,
...
rest
})
=>
{
return
/^https
?
:
\/\/
/
.
test
(
href
)
?
(
return
/^https
?
:
\/\/
/
i
.
test
(
href
)
?
(
<
a
href
=
{
href
}
rel
=
"noopener"
target
=
"_blank"
{
...
rest
}
/>
)
:
(
<
a
onClick
=
{
()
=>
onClickLink
(
href
)
}
{
...
rest
}
/>
...
...
src/frontend/components/index.js
浏览文件 @
b4801513
export
{
default
as
App
}
from
'
./App
'
;
export
{
default
as
Button
}
from
'
./Button
'
;
export
{
default
as
CodeEditor
}
from
'
./CodeEditor
'
;
export
{
default
as
ContributorsViewer
}
from
'
./ContributorsViewer
'
;
export
{
default
as
DescriptionViewer
}
from
'
./DescriptionViewer
'
;
export
{
default
as
Ellipsis
}
from
'
./Ellipsis
'
;
export
{
default
as
ExpandableListItem
}
from
'
./ExpandableListItem
'
;
...
...
src/frontend/core/tracerManager.jsx
浏览文件 @
b4801513
...
...
@@ -46,11 +46,6 @@ class TracerManager {
this
.
onError
=
onError
;
}
setOnUpdateCode
(
onUpdateCode
)
{
this
.
onUpdateCode
=
onUpdateCode
;
if
(
this
.
onUpdateCode
)
this
.
onUpdateCode
(
this
.
code
);
}
render
()
{
Object
.
values
(
this
.
datas
).
forEach
(
data
=>
data
.
render
());
if
(
this
.
onRender
)
this
.
onRender
(
this
.
renderers
);
...
...
@@ -79,7 +74,6 @@ class TracerManager {
setCode
(
code
)
{
this
.
code
=
code
;
this
.
runInitial
();
if
(
this
.
onUpdateCode
)
this
.
onUpdateCode
(
code
);
}
reset
(
seed
=
new
Seed
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录