Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
VisualDL
提交
ac8d5705
V
VisualDL
项目概览
PaddlePaddle
/
VisualDL
大约 2 年 前同步成功
通知
89
Star
4655
Fork
642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
5
Wiki
分析
仓库
DevOps
项目成员
Pages
V
VisualDL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
5
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
“90648f336d0a73630d0a862259a4f73ab3c9fe8c”上不存在“paddle/pten/api/include/manual_api.h”
未验证
提交
ac8d5705
编写于
4月 10, 2018
作者:
D
daminglu
提交者:
GitHub
4月 10, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix prod build bug and add sanitizing check for graph data (#384)
上级
68e76c5d
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
32 addition
and
8 deletion
+32
-8
frontend/src/graph/ui/Chart.vue
frontend/src/graph/ui/Chart.vue
+17
-2
frontend/tool/build.js
frontend/tool/build.js
+15
-6
未找到文件。
frontend/src/graph/ui/Chart.vue
浏览文件 @
ac8d5705
...
@@ -14,6 +14,8 @@ import {getPluginGraphsGraph} from '../../service';
...
@@ -14,6 +14,8 @@ import {getPluginGraphsGraph} from '../../service';
// for d3 drawing
// for d3 drawing
import
*
as
d3
from
'
d3
'
;
import
*
as
d3
from
'
d3
'
;
import
has
from
'
lodash/has
'
;
export
default
{
export
default
{
props
:
{
props
:
{
'
doDownload
'
:
{
'
doDownload
'
:
{
...
@@ -63,6 +65,10 @@ export default {
...
@@ -63,6 +65,10 @@ export default {
mounted
()
{
mounted
()
{
let
chartScope
=
this
;
let
chartScope
=
this
;
getPluginGraphsGraph
().
then
(({
errno
,
data
})
=>
{
getPluginGraphsGraph
().
then
(({
errno
,
data
})
=>
{
if
(
has
(
data
,
'
data
'
)
===
false
)
{
return
;
}
let
graphData
=
data
.
data
;
let
graphData
=
data
.
data
;
// d3 svg drawing
// d3 svg drawing
...
@@ -85,6 +91,9 @@ export default {
...
@@ -85,6 +91,9 @@ export default {
};
};
// add input nodes
// add input nodes
if
(
has
(
graphData
,
'
input
'
)
===
false
)
{
return
;
}
for
(
let
i
=
0
;
i
<
graphData
[
'
input
'
].
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
graphData
[
'
input
'
].
length
;
++
i
)
{
let
curInputNode
=
graphData
[
'
input
'
][
i
];
let
curInputNode
=
graphData
[
'
input
'
][
i
];
let
nodeKey
=
curInputNode
[
'
name
'
];
let
nodeKey
=
curInputNode
[
'
name
'
];
...
@@ -105,6 +114,9 @@ export default {
...
@@ -105,6 +114,9 @@ export default {
}
}
// add operator nodes then add edges from inputs to operator and from operator to output
// add operator nodes then add edges from inputs to operator and from operator to output
if
(
has
(
graphData
,
'
node
'
)
===
false
)
{
return
;
}
for
(
let
i
=
0
;
i
<
graphData
[
'
node
'
].
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
graphData
[
'
node
'
].
length
;
++
i
)
{
let
curOperatorNode
=
graphData
[
'
node
'
][
i
];
let
curOperatorNode
=
graphData
[
'
node
'
][
i
];
let
nodeKey
=
'
opNode_
'
+
i
;
let
nodeKey
=
'
opNode_
'
+
i
;
...
@@ -129,6 +141,9 @@ export default {
...
@@ -129,6 +141,9 @@ export default {
nodeKeys
.
push
(
nodeKey
);
nodeKeys
.
push
(
nodeKey
);
// add output node
// add output node
if
(
has
(
graphData
,
'
output
'
)
===
false
)
{
return
;
}
let
outputNodeKey
=
curOperatorNode
[
'
output
'
][
0
];
let
outputNodeKey
=
curOperatorNode
[
'
output
'
][
0
];
let
outputPadding
=
'
'
.
repeat
(
Math
.
floor
(
outputNodeKey
.
length
/
2
));
let
outputPadding
=
'
'
.
repeat
(
Math
.
floor
(
outputNodeKey
.
length
/
2
));
g
.
setNode
(
g
.
setNode
(
...
@@ -155,7 +170,7 @@ export default {
...
@@ -155,7 +170,7 @@ export default {
}
}
g
.
setEdge
(
nodeKey
,
curOperatorNode
[
'
output
'
][
0
],
{
g
.
setEdge
(
nodeKey
,
curOperatorNode
[
'
output
'
][
0
],
{
style
:
'
stroke: #333;stroke-width: 1.5px
'
style
:
'
stroke: #333;stroke-width: 1.5px
'
,
});
});
}
}
...
...
frontend/tool/build.js
浏览文件 @
ac8d5705
...
@@ -24,13 +24,22 @@ webpackConfig.plugins = webpackConfig.plugins.concat([
...
@@ -24,13 +24,22 @@ webpackConfig.plugins = webpackConfig.plugins.concat([
var
name
=
opt
.
outputName
.
replace
(
/
\.
html$/
,
''
);
var
name
=
opt
.
outputName
.
replace
(
/
\.
html$/
,
''
);
var
feRoot
=
feRoots
[
name
];
/*
We do not need the following hack, which was added here:
if
(
feRoot
)
{
https://github.com/PaddlePaddle/VisualDL/commit/75f5c3b55fb411e0329b98d66253e60137f88bd5#diff-b6dc766994d45268924eff9a07f0765bR31
html
=
html
.
replace
(
/href="/g
,
'
href="
'
+
feRoot
)
What it does is simply add './' in front of 'src' and 'href' to make sure it is loading local files.
.
replace
(
/src="/g
,
'
src="
'
+
feRoot
);
But it should be able to load both local JS files and CDN files via 'https://...'
}
*/
// var feRoot = feRoots[name];
// if (feRoot) {
// html = html
// .replace(/href="/g, 'href="' + feRoot);
// .replace(/src="/g, 'src="' + feRoot);
// }
return
html
;
return
html
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录