Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
cfc92d80
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
7
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindinsight
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cfc92d80
编写于
7月 27, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
7月 27, 2020
浏览文件
操作
浏览文件
下载
差异文件
!472 UI fix bug of graph that click more to modify aggregation scope page display error
Merge pull request !472 from 黄伟锋/r0.6
上级
22808ac6
25e6492b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
74 addition
and
61 deletion
+74
-61
mindinsight/ui/src/views/train-manage/graph.vue
mindinsight/ui/src/views/train-manage/graph.vue
+74
-61
未找到文件。
mindinsight/ui/src/views/train-manage/graph.vue
浏览文件 @
cfc92d80
...
@@ -467,7 +467,7 @@ export default {
...
@@ -467,7 +467,7 @@ export default {
show
:
false
,
show
:
false
,
info
:
''
,
info
:
''
,
},
},
scaleRange
:
[
0.00
01
,
10
000
],
// graph zooms in and zooms out.
scaleRange
:
[
0.00
1
,
1
000
],
// graph zooms in and zooms out.
rightShow
:
true
,
// Check whether the right side bar is displayed.
rightShow
:
true
,
// Check whether the right side bar is displayed.
fullScreen
:
false
,
// Display Full Screen
fullScreen
:
false
,
// Display Full Screen
totalMemory
:
16777216
*
2
,
// Memory size of the graph plug-in
totalMemory
:
16777216
*
2
,
// Memory size of the graph plug-in
...
@@ -583,29 +583,32 @@ export default {
...
@@ -583,29 +583,32 @@ export default {
* @param {String} dot dot statement encapsulated in graph data
* @param {String} dot dot statement encapsulated in graph data
*/
*/
initGraph
(
dot
)
{
initGraph
(
dot
)
{
this
.
graphviz
=
d3
try
{
.
select
(
'
#graph
'
)
this
.
graphviz
=
d3
.
graphviz
({
useWorker
:
false
,
totalMemory
:
this
.
totalMemory
})
.
select
(
'
#graph
'
)
.
zoomScaleExtent
(
this
.
scaleRange
)
.
graphviz
({
useWorker
:
false
,
totalMemory
:
this
.
totalMemory
})
.
dot
(
dot
)
.
zoomScaleExtent
(
this
.
scaleRange
)
.
attributer
(
this
.
attributer
)
.
dot
(
dot
)
.
render
(()
=>
{
.
attributer
(
this
.
attributer
)
this
.
initSvg
();
.
render
(()
=>
{
this
.
afterInitGraph
();
this
.
initSvg
();
});
this
.
afterInitGraph
();
});
}
catch
(
error
)
{
const
svg
=
document
.
querySelector
(
'
#graph svg
'
);
if
(
svg
)
{
svg
.
remove
();
}
this
.
initGraph
(
dot
);
}
// Generate the dom of the submap.
// Generate the dom of the submap.
if
(
!
d3
.
select
(
'
#graphTemp
'
).
size
())
{
if
(
!
d3
.
select
(
'
#graphTemp
'
).
size
())
{
d3
.
select
(
'
body
'
)
d3
.
select
(
'
body
'
).
append
(
'
div
'
).
attr
(
'
id
'
,
'
graphTemp
'
);
.
append
(
'
div
'
)
.
attr
(
'
id
'
,
'
graphTemp
'
)
.
attr
(
'
style
'
,
'
visibility: collapse
'
);
}
}
// Stores the dom of all the sorted subgraphs.
// Stores the dom of all the sorted subgraphs.
if
(
!
d3
.
select
(
'
#subgraphTemp
'
).
size
())
{
if
(
!
d3
.
select
(
'
#subgraphTemp
'
).
size
())
{
d3
.
select
(
'
body
'
)
d3
.
select
(
'
body
'
).
append
(
'
div
'
).
attr
(
'
id
'
,
'
subgraphTemp
'
);
.
append
(
'
div
'
)
.
attr
(
'
id
'
,
'
subgraphTemp
'
)
.
attr
(
'
style
'
,
'
visibility: collapse
'
);
}
}
},
},
initSvg
()
{
initSvg
()
{
...
@@ -654,10 +657,7 @@ export default {
...
@@ -654,10 +657,7 @@ export default {
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
loading
.
show
=
false
;
this
.
loading
.
show
=
false
;
});
});
const
elements
=
d3
const
elements
=
d3
.
select
(
'
#graph
'
).
selectAll
(
'
g.node, g.edge
'
).
nodes
();
.
select
(
'
#graph
'
)
.
selectAll
(
'
g.node, g.edge
'
)
.
nodes
();
elements
.
forEach
((
ele
)
=>
{
elements
.
forEach
((
ele
)
=>
{
if
(
!
ele
.
hasAttribute
(
'
transform
'
))
{
if
(
!
ele
.
hasAttribute
(
'
transform
'
))
{
ele
.
setAttribute
(
'
transform
'
,
'
translate(0,0)
'
);
ele
.
setAttribute
(
'
transform
'
,
'
translate(0,0)
'
);
...
@@ -728,6 +728,7 @@ export default {
...
@@ -728,6 +728,7 @@ export default {
.
parentNode
.
id
;
.
parentNode
.
id
;
name
=
parentId
.
replace
(
'
_unfold
'
,
''
);
name
=
parentId
.
replace
(
'
_unfold
'
,
''
);
this
.
allGraphData
[
name
].
index
+=
changePage
;
this
.
allGraphData
[
name
].
index
+=
changePage
;
this
.
selectedNode
.
name
=
name
;
}
}
if
(
unfoldFlag
)
{
if
(
unfoldFlag
)
{
this
.
dealDoubleClick
(
name
);
this
.
dealDoubleClick
(
name
);
...
@@ -928,26 +929,39 @@ export default {
...
@@ -928,26 +929,39 @@ export default {
* @param {Boolean} toUnfold Expand the namespace.
* @param {Boolean} toUnfold Expand the namespace.
*/
*/
layoutNamescope
(
name
,
toUnfold
)
{
layoutNamescope
(
name
,
toUnfold
)
{
setTimeout
(()
=>
{
this
.
$nextTick
(()
=>
{
const
dotStr
=
this
.
packageNamescope
(
name
);
const
dotStr
=
this
.
packageNamescope
(
name
);
this
.
graphvizTemp
=
d3
try
{
.
select
(
'
#graphTemp
'
)
this
.
graphvizTemp
=
d3
.
graphviz
({
useWorker
:
false
,
totalMemory
:
this
.
totalMemory
})
.
select
(
'
#graphTemp
'
)
.
dot
(
dotStr
)
.
graphviz
({
useWorker
:
false
,
totalMemory
:
this
.
totalMemory
})
.
zoomScaleExtent
(
this
.
scaleRange
)
.
dot
(
dotStr
)
.
attributer
((
datum
,
index
,
nodes
)
=>
{
.
zoomScaleExtent
(
this
.
scaleRange
)
if
(
.
attributer
((
datum
,
index
,
nodes
)
=>
{
datum
.
tag
===
'
polygon
'
&&
if
(
datum
.
attributes
.
stroke
!==
'
transparent
'
datum
.
tag
===
'
polygon
'
&&
)
{
datum
.
attributes
.
stroke
!==
'
transparent
'
datum
.
attributes
.
stroke
=
'
rgb(167, 167, 167)
'
;
)
{
}
datum
.
attributes
.
stroke
=
'
rgb(167, 167, 167)
'
;
})
}
.
render
(()
=>
{
})
this
.
fitGraph
(
'
graphTemp
'
);
.
render
(()
=>
{
this
.
dealNamescopeTempGraph
(
name
);
this
.
fitGraph
(
'
graphTemp
'
);
});
this
.
dealNamescopeTempGraph
(
name
);
},
20
);
});
}
catch
(
error
)
{
const
graphTempSvg
=
document
.
querySelector
(
'
#graphTemp svg
'
);
if
(
graphTempSvg
)
{
graphTempSvg
.
remove
();
}
const
subGraphTempSvg
=
document
.
querySelector
(
'
#subgraphTemp svg
'
);
if
(
subGraphTempSvg
)
{
subGraphTempSvg
.
remove
();
}
this
.
dealDoubleClick
(
this
.
selectedNode
.
name
);
}
});
},
},
/**
/**
* To obtain graph data, initialize and expand the namespace or aggregate nodes.
* To obtain graph data, initialize and expand the namespace or aggregate nodes.
...
@@ -1665,10 +1679,7 @@ export default {
...
@@ -1665,10 +1679,7 @@ export default {
.
attr
(
'
width
'
,
g
.
node
().
getBBox
().
width
+
this
.
frameSpace
*
2
)
.
attr
(
'
width
'
,
g
.
node
().
getBBox
().
width
+
this
.
frameSpace
*
2
)
.
attr
(
'
height
'
,
g
.
node
().
getBBox
().
height
+
this
.
frameSpace
*
2
);
.
attr
(
'
height
'
,
g
.
node
().
getBBox
().
height
+
this
.
frameSpace
*
2
);
boxTemp
=
d3
boxTemp
=
d3
.
select
(
`
${
idStr
}
g[id="
${
name
}
_unfold"]`
).
node
().
getBBox
();
.
select
(
`
${
idStr
}
g[id="
${
name
}
_unfold"]`
)
.
node
()
.
getBBox
();
// After the namespace dom is successfully encapsulated, set the related data of the data object.
// After the namespace dom is successfully encapsulated, set the related data of the data object.
this
.
allGraphData
[
name
].
isUnfold
=
true
;
this
.
allGraphData
[
name
].
isUnfold
=
true
;
this
.
allGraphData
[
name
].
size
=
[
boxTemp
.
width
/
72
,
boxTemp
.
height
/
72
];
this
.
allGraphData
[
name
].
size
=
[
boxTemp
.
width
/
72
,
boxTemp
.
height
/
72
];
...
@@ -1680,8 +1691,9 @@ export default {
...
@@ -1680,8 +1691,9 @@ export default {
const
node
=
document
.
querySelector
(
`#graphTemp g[id="
${
name
}
"]`
);
const
node
=
document
.
querySelector
(
`#graphTemp g[id="
${
name
}
"]`
);
const
box
=
node
.
getBBox
();
const
box
=
node
.
getBBox
();
const
boxTemp
=
nodeTemp
.
getBBox
();
const
boxTemp
=
nodeTemp
.
getBBox
();
const
translateStr
=
`translate(
${
box
.
x
-
boxTemp
.
x
}
,
${
box
.
y
-
const
translateStr
=
`translate(
${
box
.
x
-
boxTemp
.
x
}
,
${
boxTemp
.
y
}
)`
;
box
.
y
-
boxTemp
.
y
}
)`
;
nodeTemp
.
setAttribute
(
'
transform
'
,
translateStr
);
nodeTemp
.
setAttribute
(
'
transform
'
,
translateStr
);
node
.
parentNode
.
appendChild
(
nodeTemp
);
node
.
parentNode
.
appendChild
(
nodeTemp
);
document
.
querySelector
(
'
#subgraphTemp svg
'
).
remove
();
document
.
querySelector
(
'
#subgraphTemp svg
'
).
remove
();
...
@@ -1732,8 +1744,9 @@ export default {
...
@@ -1732,8 +1744,9 @@ export default {
if
(
node
&&
nodeTemp
)
{
if
(
node
&&
nodeTemp
)
{
const
box
=
node
.
getBBox
();
const
box
=
node
.
getBBox
();
const
boxTemp
=
nodeTemp
.
getBBox
();
const
boxTemp
=
nodeTemp
.
getBBox
();
const
translateStr
=
`translate(
${
box
.
x
-
boxTemp
.
x
}
,
${
box
.
y
-
const
translateStr
=
`translate(
${
box
.
x
-
boxTemp
.
x
}
,
${
boxTemp
.
y
}
)`
;
box
.
y
-
boxTemp
.
y
}
)`
;
nodeTemp
.
setAttribute
(
'
transform
'
,
translateStr
);
nodeTemp
.
setAttribute
(
'
transform
'
,
translateStr
);
node
.
parentNode
.
appendChild
(
nodeTemp
);
node
.
parentNode
.
appendChild
(
nodeTemp
);
node
.
remove
();
node
.
remove
();
...
@@ -1809,10 +1822,7 @@ export default {
...
@@ -1809,10 +1822,7 @@ export default {
this
.
loading
.
show
=
true
;
this
.
loading
.
show
=
true
;
}
}
if
(
name
.
includes
(
'
/
'
))
{
if
(
name
.
includes
(
'
/
'
))
{
const
subPath
=
name
const
subPath
=
name
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
);
.
split
(
'
/
'
)
.
slice
(
0
,
-
1
)
.
join
(
'
/
'
);
this
.
layoutNamescope
(
subPath
,
true
);
this
.
layoutNamescope
(
subPath
,
true
);
}
else
{
}
else
{
const
svg
=
document
.
querySelector
(
'
#graph svg
'
);
const
svg
=
document
.
querySelector
(
'
#graph svg
'
);
...
@@ -2292,10 +2302,7 @@ export default {
...
@@ -2292,10 +2302,7 @@ export default {
if
(
subPsth
&&
this
.
allGraphData
[
subPsth
])
{
if
(
subPsth
&&
this
.
allGraphData
[
subPsth
])
{
// The virtual node and its subnodes need to return their namespaces.
// The virtual node and its subnodes need to return their namespaces.
if
(
this
.
allGraphData
[
subPsth
].
independent_layout
)
{
if
(
this
.
allGraphData
[
subPsth
].
independent_layout
)
{
subPsth
=
subPsth
subPsth
=
subPsth
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
);
.
split
(
'
/
'
)
.
slice
(
0
,
-
1
)
.
join
(
'
/
'
);
}
}
}
}
return
subPsth
;
return
subPsth
;
...
@@ -2619,7 +2626,7 @@ export default {
...
@@ -2619,7 +2626,7 @@ export default {
this
.
insideBox
.
height
=
this
.
smallResize
.
height
;
this
.
insideBox
.
height
=
this
.
smallResize
.
height
;
this
.
insideBox
.
top
=
this
.
insideBox
.
left
=
0
;
this
.
insideBox
.
top
=
this
.
insideBox
.
left
=
0
;
this
.
styleSet
(
'
#inside-box
'
,
this
.
insideBox
);
this
.
styleSet
(
'
#inside-box
'
,
this
.
insideBox
);
insideBox
.
style
.
cursor
=
'
not-allowed
'
;
this
.
insideBox
.
style
.
cursor
=
'
not-allowed
'
;
}
else
{
}
else
{
let
transformString
=
''
;
let
transformString
=
''
;
const
transTemp
=
this
.
graph
.
dom
.
attributes
.
transform
||
null
;
const
transTemp
=
this
.
graph
.
dom
.
attributes
.
transform
||
null
;
...
@@ -2757,8 +2764,9 @@ export default {
...
@@ -2757,8 +2764,9 @@ export default {
`<svg xmlns="http://www.w3.org/2000/svg" `
+
`<svg xmlns="http://www.w3.org/2000/svg" `
+
`xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" `
+
`xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" `
+
`viewBox="0.00 0.00
${
this
.
svg
.
originSize
.
width
}
${
this
.
svg
.
originSize
.
height
}
"`
+
`viewBox="0.00 0.00
${
this
.
svg
.
originSize
.
width
}
${
this
.
svg
.
originSize
.
height
}
"`
+
`><g id="smallGraph" class="graph" transform="translate(4,
${
this
.
svg
`><g id="smallGraph" class="graph" transform="translate(4,
${
.
originSize
.
height
-
4
}
) scale(1)"`
+
this
.
svg
.
originSize
.
height
-
4
}
) scale(1)"`
+
`>
${
this
.
graph
.
dom
.
innerHTML
}
</g></svg>`
;
`>
${
this
.
graph
.
dom
.
innerHTML
}
</g></svg>`
;
smallMap
.
innerHTML
=
svgOuterHtml
;
smallMap
.
innerHTML
=
svgOuterHtml
;
...
@@ -3493,4 +3501,9 @@ export default {
...
@@ -3493,4 +3501,9 @@ export default {
padding-right
:
32px
;
padding-right
:
32px
;
}
}
}
}
#graphTemp
,
#subgraphTemp
{
position
:
absolute
;
bottom
:
0
;
}
</
style
>
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录