Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
VisualDL
提交
4a0511d4
V
VisualDL
项目概览
PaddlePaddle
/
VisualDL
1 年多 前同步成功
通知
88
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看板
未验证
提交
4a0511d4
编写于
4月 03, 2018
作者:
D
daminglu
提交者:
GitHub
4月 03, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add 'Node Info' part to config panel once a node is clicked. (#358)
上级
6723bd83
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
89 addition
and
34 deletion
+89
-34
frontend/src/graph/Graph.vue
frontend/src/graph/Graph.vue
+7
-3
frontend/src/graph/ui/Chart.vue
frontend/src/graph/ui/Chart.vue
+30
-7
frontend/src/graph/ui/Config.vue
frontend/src/graph/ui/Config.vue
+52
-24
未找到文件。
frontend/src/graph/Graph.vue
浏览文件 @
4a0511d4
...
...
@@ -5,12 +5,15 @@
:fitScreen=
"fitScreen"
:download=
"download"
:scale=
"config.scale"
:curNode=
"curNode"
@
curNodeUpdated=
"curNode = $event"
></ui-chart>
</div>
<div
class=
"visual-dl-page-right"
>
<div
class=
"visual-dl-page-config-container"
>
<ui-config
:config=
"config"
:curNode=
"curNode"
@
fitScreen=
"handleFitScreen"
@
download=
"handleDownload"
></ui-config>
...
...
@@ -37,7 +40,8 @@ export default {
scale
:
0.5
},
fitScreen
:
{
fitScreen
:
false
},
download
:
{
download
:
false
}
download
:
{
download
:
false
},
curNode
:
{}
}
},
mounted
()
{
...
...
@@ -45,11 +49,11 @@ export default {
},
methods
:
{
handleFitScreen
()
{
this
.
fitScreen
=
{
fitScreen
:
true
}
this
.
fitScreen
=
{
fitScreen
:
true
}
;
this
.
config
.
scale
=
0.5
;
},
handleDownload
()
{
this
.
download
=
{
fitScreen
:
true
}
this
.
download
=
{
fitScreen
:
true
}
;
}
}
};
...
...
frontend/src/graph/ui/Chart.vue
浏览文件 @
4a0511d4
...
...
@@ -25,7 +25,7 @@
import
*
as
dagreD3
from
'
dagre-d3
'
;
export
default
{
props
:
[
'
fitScreen
'
,
'
download
'
,
'
scale
'
],
props
:
[
'
fitScreen
'
,
'
download
'
,
'
scale
'
,
'
curNode
'
],
computed
:
{
computedWidth
()
{
let
scale
=
this
.
scale
;
...
...
@@ -54,7 +54,7 @@
},
mounted
()
{
this
.
getOriginChartsData
();
let
chartScope
=
this
;
getPluginGraphsGraph
().
then
(({
errno
,
data
})
=>
{
var
raw_data
=
data
.
data
;
var
data
=
raw_data
;
...
...
@@ -131,6 +131,26 @@
// adjust viewBox so that the whole graph can be shown, with scroll bar
svg
.
attr
(
'
viewBox
'
,
'
0 0
'
+
g
.
graph
().
width
+
'
'
+
g
.
graph
().
height
);
svg
.
selectAll
(
"
.node
"
).
on
(
"
click
"
,
function
(
d
,
i
){
this
.
curNode
=
g
.
node
(
d
);
var
nodeType
=
this
.
curNode
.
class
;
var
nodeInfo
=
null
;
if
(
nodeType
===
"
operator
"
)
{
var
opIndex
=
d
.
slice
(
7
);
// remove prefix "opNode_"
nodeInfo
=
data
.
node
[
opIndex
];
}
else
if
(
nodeType
===
"
input
"
)
{
nodeInfo
=
data
.
input
[
d
-
1
];
}
else
{
nodeInfo
=
"
output
"
;
}
chartScope
.
$emit
(
'
curNodeUpdated
'
,
{
'
nodeType
'
:
nodeType
,
'
nodeInfo
'
:
nodeInfo
});
});
});
},
...
...
@@ -175,7 +195,7 @@
},
addDragEventForImg
()
{
let
that
=
this
;
let
chartScope
=
this
;
// target elements with the "draggable" class
interact
(
'
.draggable
'
).
draggable
({
// enable inertial throwing
...
...
@@ -186,8 +206,8 @@
dragMovelHandler
(
event
,
(
target
,
x
,
y
)
=>
{
tansformElement
(
target
,
x
,
y
);
// compute the proportional value
let
triggerEl
=
that
.
getBigImgEl
();
let
relativeEl
=
that
.
getSmallImgDragHandler
();
let
triggerEl
=
chartScope
.
getBigImgEl
();
let
relativeEl
=
chartScope
.
getSmallImgDragHandler
();
relativeMove
({
triggerEl
,
x
,
y
},
relativeEl
);
});
...
...
@@ -213,8 +233,8 @@
dragMovelHandler
(
event
,
(
target
,
x
,
y
)
=>
{
tansformElement
(
target
,
x
,
y
);
// compute the proportional value
let
triggerEl
=
that
.
getSmallImgEl
();
let
relativeEl
=
that
.
getBigImgEl
();
let
triggerEl
=
chartScope
.
getSmallImgEl
();
let
relativeEl
=
chartScope
.
getBigImgEl
();
relativeMove
({
triggerEl
,
x
,
y
},
relativeEl
);
});
...
...
@@ -245,6 +265,9 @@
rx: 10;
ry: 10;
.node
cursor: pointer
.output
fill: #c38d9e
...
...
frontend/src/graph/ui/Config.vue
浏览文件 @
4a0511d4
<
template
>
<div
class=
"visual-dl-graph-config-com"
>
<v-btn
class=
"visual-dl-graph-config-button"
color=
"primary"
@
click=
"handleFitScreen"
dark
>
<v-icon
style=
"margin-right: 6px"
size=
"20"
>
fullscreen
</v-icon>
Fit
to
screen
</v-btn>
<div
class=
"graph-config-upper"
>
<v-btn
class=
"visual-dl-graph-config-button"
color=
"primary"
@
click=
"handleFitScreen"
dark
>
<v-icon
style=
"margin-right: 6px"
size=
"20"
>
fullscreen
</v-icon>
Fit
to
screen
</v-btn>
<v-btn
class=
"visual-dl-graph-config-button"
color=
"primary"
@
click=
"handleDownload"
dark
>
<v-icon
style=
"margin-right: 6px"
>
file_download
</v-icon>
Download image
</v-btn>
<v-btn
class=
"visual-dl-graph-config-button"
color=
"primary"
@
click=
"handleDownload"
dark
>
<v-icon
style=
"margin-right: 6px"
>
file_download
</v-icon>
Download image
</v-btn>
<v-slider
label=
"Scale"
max=
"1"
min=
"0.1"
step=
"0.1"
v-model=
"config.scale"
dark
></v-slider>
<v-slider
label=
"Scale"
max=
"1"
min=
"0.1"
step=
"0.1"
v-model=
"config.scale"
dark
></v-slider>
</div>
<div
class=
"node-info"
>
<h3>
Node Info:
</h3>
<div
v-if=
"curNode.nodeType === 'input'"
>
<div>
Node Type:
{{
curNode
.
nodeType
}}
</div>
<div>
Name:
{{
curNode
.
nodeInfo
.
name
}}
</div>
<div>
Shape:
{{
curNode
.
nodeInfo
.
shape
}}
</div>
<div>
Data Type:
{{
curNode
.
nodeInfo
.
data_type
}}
</div>
</div>
<div
v-else-if=
"curNode.nodeType === 'output'"
>
<div>
Node Type:
{{
curNode
.
nodeType
}}
</div>
</div>
<div
v-else-if=
"curNode.nodeType === 'operator'"
>
<div>
Node Type:
{{
curNode
.
nodeType
}}
</div>
<div>
Input:
{{
curNode
.
nodeInfo
.
input
}}
</div>
<div>
Operator Type:
{{
curNode
.
nodeInfo
.
opType
}}
</div>
<div>
Output:
{{
curNode
.
nodeInfo
.
output
}}
</div>
</div>
<div
v-else
>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:[
'
config
'
],
props
:[
'
config
'
,
'
curNode
'
],
methods
:
{
handleFitScreen
()
{
this
.
$emit
(
'
fitScreen
'
)
...
...
@@ -55,4 +79,8 @@ export default {
.sm-icon
width 36px
height 26px
.graph-config-upper
height 400px
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录