Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
ce93cb82
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
8
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看板
提交
ce93cb82
编写于
6月 17, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 17, 2020
浏览文件
操作
浏览文件
下载
差异文件
!272 fix graph bug which can not open aggregation scope node
Merge pull request !272 from WeiFeng-mindinsight/myMaster
上级
3fd413d9
64353d9d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
129 addition
and
69 deletion
+129
-69
mindinsight/ui/src/components/autocomplete.vue
mindinsight/ui/src/components/autocomplete.vue
+48
-43
mindinsight/ui/src/locales/zh-cn.json
mindinsight/ui/src/locales/zh-cn.json
+2
-1
mindinsight/ui/src/views/train-manage/graph.vue
mindinsight/ui/src/views/train-manage/graph.vue
+79
-25
未找到文件。
mindinsight/ui/src/components/autocomplete.vue
浏览文件 @
ce93cb82
...
...
@@ -15,58 +15,56 @@ limitations under the License.
-->
<
template
>
<div
class=
"el-autocomplete"
v-clickoutside=
"close"
aria-haspopup=
"listbox"
role=
"combobox"
:aria-expanded=
"suggestionVisible"
:aria-owns=
"id"
>
<el-input
ref=
"input"
v-bind=
"[$props, $attrs]"
@
input=
"handleChange"
@
focus=
"handleFocus"
@
blur=
"handleBlur"
@
clear=
"handleClear"
@
keydown.up.native.prevent=
"highlight(highlightedIndex - 1)"
@
keydown.down.native.prevent=
"highlight(highlightedIndex + 1)"
@
keydown.enter.native=
"handleKeyEnter"
@
keydown.native.tab=
"close"
>
<template
slot=
"prepend"
v-if=
"$slots.prepend"
>
<div
class=
"el-autocomplete"
v-clickoutside=
"close"
aria-haspopup=
"listbox"
role=
"combobox"
:aria-expanded=
"suggestionVisible"
:aria-owns=
"id"
>
<el-input
ref=
"input"
class=
"rtl-item"
v-bind=
"[$props, $attrs]"
@
input=
"handleChange"
@
focus=
"handleFocus"
@
blur=
"handleBlur"
@
clear=
"handleClear"
@
keydown.up.native.prevent=
"highlight(highlightedIndex - 1)"
@
keydown.down.native.prevent=
"highlight(highlightedIndex + 1)"
@
keydown.enter.native=
"handleKeyEnter"
@
keydown.native.tab=
"close"
>
<template
slot=
"prepend"
v-if=
"$slots.prepend"
>
<slot
name=
"prepend"
></slot>
</
template
>
<
template
slot=
"append"
v-if=
"$slots.append"
>
<
template
slot=
"append"
v-if=
"$slots.append"
>
<slot
name=
"append"
></slot>
</
template
>
<
template
slot=
"prefix"
v-if=
"$slots.prefix"
>
<
template
slot=
"prefix"
v-if=
"$slots.prefix"
>
<slot
name=
"prefix"
></slot>
</
template
>
<
template
slot=
"suffix"
v-if=
"$slots.suffix"
>
<
template
slot=
"suffix"
v-if=
"$slots.suffix"
>
<slot
name=
"suffix"
></slot>
</
template
>
</el-input>
<el-autocomplete-suggestions
visible-arrow
:class=
"[popperClass ? popperClass : '']"
:suggestions-has-data=
"suggestionsHasData"
:popper-options=
"popperOptions"
:append-to-body=
"popperAppendToBody"
ref=
"suggestions"
:placement=
"placement"
:id=
"id"
>
<li
v-for=
"(item, index) in suggestions"
:key=
"index"
:class=
"{ highlighted: highlightedIndex === index }"
@
click=
"select(item)"
:id=
"`${id}-item-${index}`"
role=
"option"
:aria-selected=
"highlightedIndex === index"
>
<el-autocomplete-suggestions
visible-arrow
:class=
"[popperClass ? popperClass : '']"
:suggestions-has-data=
"suggestionsHasData"
:popper-options=
"popperOptions"
:append-to-body=
"popperAppendToBody"
ref=
"suggestions"
:placement=
"placement"
:id=
"id"
>
<li
v-for=
"(item, index) in suggestions"
:key=
"index"
:class=
"{ highlighted: highlightedIndex === index }"
class=
"rtl-item"
@
click=
"select(item)"
:id=
"`${id}-item-${index}`"
role=
"option"
:aria-selected=
"highlightedIndex === index"
>
<slot
:item=
"item"
>
<span
:title=
"item[valueKey]"
>
{{ item[valueKey] }}
</span>
</slot>
...
...
@@ -91,3 +89,10 @@ export default {
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.rtl-item
{
text-align
:
right
;
direction
:
rtl
;
text-overflow
:
ellipsis
;
}
</
style
>
mindinsight/ui/src/locales/zh-cn.json
浏览文件 @
ce93cb82
...
...
@@ -205,7 +205,8 @@
"guideContent3"
:
"计算图中存在数据边和控制边。其中数据边表示数据的输入,控制边表示节点之间执行依赖关系。"
,
"next"
:
"下一步"
,
"finish"
:
"完成"
,
"dataTooLarge"
:
"节点和边的数量过多,导致打开失败"
"dataTooLarge"
:
"节点和边的数量过多,导致打开失败"
,
"tooManyChain"
:
"直接子节点的深度超过70,不支持展开"
},
"operator"
:
{
"titleText"
:
"性能分析"
,
...
...
mindinsight/ui/src/views/train-manage/graph.vue
浏览文件 @
ce93cb82
...
...
@@ -450,6 +450,7 @@ export default {
trainJobID
:
''
,
frameSpace
:
25
,
// Distance between the namespace border and the internal node
nodesCountLimit
:
1500
,
// Maximum number of sub-nodes in a namespace.
maxChainNum
:
70
,
curColorIndex
:
0
,
// Node search box
searchBox
:
{
...
...
@@ -992,6 +993,16 @@ export default {
}
else
{
if
(
this
.
allGraphData
[
name
].
type
===
'
aggregation_scope
'
)
{
this
.
dealAggregationNodes
(
name
);
if
(
this
.
allGraphData
[
name
].
maxChainNum
>
this
.
maxChainNum
)
{
this
.
$message
.
error
(
this
.
$t
(
'
graph.tooManyChain
'
));
this
.
allGraphData
[
name
].
isUnfold
=
true
;
this
.
selectedNode
.
name
=
name
;
this
.
loading
.
show
=
false
;
this
.
deleteNamespace
(
name
);
return
;
}
}
this
.
allGraphData
[
name
].
isUnfold
=
true
;
this
.
selectedNode
.
name
=
`
${
name
}
_unfold`
;
...
...
@@ -1075,12 +1086,15 @@ export default {
// A maximum of 10 subnodes can be displayed on an aggregation node.
const
aggregationNodeLimit
=
10
;
const
idsGroup
=
[];
let
maxChainNum
=
1
;
this
.
allGraphData
[
name
].
children
.
forEach
((
key
)
=>
{
if
(
!
this
.
allGraphData
[
key
].
grouped
)
{
const
ids
=
this
.
getAssociatedNode
(
key
,
`
${
name
}
/`
);
const
ids
=
this
.
getAssociatedNode
(
key
,
`
${
name
}
/`
);
if
(
ids
.
length
)
{
idsGroup
.
push
(
ids
);
}
const
chainNum
=
this
.
dealChainingData
(
key
,
`
${
name
}
/`
);
maxChainNum
=
Math
.
max
(...
chainNum
,
maxChainNum
);
});
const
idsList
=
[];
...
...
@@ -1092,40 +1106,65 @@ export default {
if
(
temp
.
length
+
idsGroup
[
i
].
length
<=
aggregationNodeLimit
)
{
temp
=
temp
.
concat
(
idsGroup
[
i
]);
}
else
{
idsList
.
push
(
temp
);
temp
=
[].
concat
(
idsGroup
[
i
]);
if
(
temp
.
length
)
{
idsList
.
push
(
temp
);
temp
=
[].
concat
(
idsGroup
[
i
]);
}
}
}
if
(
i
===
idsGroup
.
length
-
1
)
{
if
(
i
===
idsGroup
.
length
-
1
&&
temp
.
length
)
{
idsList
.
push
(
temp
);
}
}
this
.
allGraphData
[
name
].
childIdsList
=
idsList
;
this
.
allGraphData
[
name
].
index
=
0
;
this
.
allGraphData
[
name
].
maxChainNum
=
maxChainNum
;
},
dealChainingData
(
name
,
prefix
)
{
const
node
=
this
.
allGraphData
[
name
];
if
(
!
node
.
chained
)
{
node
.
chained
=
true
;
let
temp
=
[];
Object
.
keys
(
node
.
input
).
forEach
((
key
)
=>
{
if
(
key
.
includes
(
prefix
))
{
temp
=
temp
.
concat
(
this
.
dealChainingData
(
key
,
prefix
));
}
});
if
(
temp
.
length
)
{
node
.
chainNum
=
[...
new
Set
(
temp
.
map
((
i
)
=>
i
+
1
))];
}
}
return
node
.
chainNum
;
},
getAssociatedNode
(
name
,
prefix
)
{
const
node
=
this
.
allGraphData
[
name
];
node
.
grouped
=
true
;
let
ids
=
[];
ids
.
push
(
node
.
name
);
Object
.
keys
(
node
.
input
).
forEach
((
i
)
=>
{
if
(
i
.
startsWith
(
prefix
))
{
if
(
!
this
.
allGraphData
[
i
].
grouped
)
{
const
idsTemp
=
this
.
getAssociatedNode
(
i
,
prefix
);
ids
=
ids
.
concat
(
idsTemp
);
if
(
!
node
.
grouped
)
{
node
.
grouped
=
true
;
ids
.
push
(
node
.
name
);
Object
.
keys
(
node
.
input
).
forEach
((
i
)
=>
{
if
(
i
.
startsWith
(
prefix
))
{
if
(
!
this
.
allGraphData
[
i
].
grouped
)
{
const
idsTemp
=
this
.
getAssociatedNode
(
i
,
prefix
);
ids
=
ids
.
concat
(
idsTemp
);
}
}
}
});
Object
.
keys
(
node
.
output
).
forEach
((
i
)
=>
{
if
(
i
.
startsWith
(
prefix
)
)
{
if
(
!
this
.
allGraphData
[
i
].
grouped
)
{
const
idsTemp
=
this
.
getAssociatedNode
(
i
,
prefix
);
ids
=
ids
.
concat
(
idsTemp
);
}
);
Object
.
keys
(
node
.
output
).
forEach
((
i
)
=>
{
if
(
i
.
startsWith
(
prefix
))
{
if
(
!
this
.
allGraphData
[
i
].
grouped
)
{
const
idsTemp
=
this
.
getAssociatedNode
(
i
,
prefix
);
ids
=
ids
.
concat
(
idsTemp
);
}
}
}
});
});
}
return
ids
;
},
/**
...
...
@@ -1157,7 +1196,8 @@ export default {
`label="
${
name
}
";class="aggregation";`
+
`
${
node
.
isUnfold
?
`shape="polygon";width=
${
node
.
size
[
0
]}
;height=
${
node
.
size
[
1
]}
;fixedsize=true;`
?
`shape="polygon";width=
${
node
.
size
[
0
]}
;`
+
`height=
${
node
.
size
[
1
]}
;fixedsize=true;`
:
'
shape="octagon";
'
}
];`
;
}
else
if
(
node
.
type
===
'
name_scope
'
)
{
...
...
@@ -2285,6 +2325,8 @@ export default {
node
.
size
=
[];
node
.
html
=
''
;
node
.
grouped
=
false
;
node
.
chained
=
false
;
node
.
chainNum
=
[
1
];
this
.
allGraphData
[
node
.
name
]
=
node
;
this
.
allGraphData
[
name
].
children
.
push
(
node
.
name
);
});
...
...
@@ -2399,7 +2441,7 @@ export default {
if
(
this
.
allGraphData
[
option
.
value
])
{
if
(
d3
.
select
(
`g[id="
${
option
.
value
}
"],g[id="
${
option
.
value
}
_unfold"]`
)
.
select
(
`g[id="
${
option
.
value
}
"],
g[id="
${
option
.
value
}
_unfold"]`
)
.
size
()
)
{
// If the namespace or aggregation node is expanded, you need to close it and select
...
...
@@ -2418,7 +2460,7 @@ export default {
this
.
allGraphData
[
parentId
].
isUnfold
)
{
const
aggregationNode
=
this
.
allGraphData
[
parentId
];
if
(
aggregationNode
)
{
if
(
aggregationNode
&&
aggregationNode
.
childIdsList
)
{
for
(
let
i
=
0
;
i
<
aggregationNode
.
childIdsList
.
length
;
i
++
)
{
if
(
aggregationNode
.
childIdsList
[
i
].
includes
(
option
.
value
))
{
aggregationNode
.
index
=
i
;
...
...
@@ -2487,7 +2529,6 @@ export default {
)
{
this
.
selectedNode
.
name
=
data
.
scope_name
;
this
.
querySingleNode
({
value
:
data
.
scope_name
});
this
.
selectNode
(
true
);
this
.
$message
.
error
(
this
.
$t
(
'
graph.tooManyNodes
'
));
this
.
$nextTick
(()
=>
{
this
.
loading
.
show
=
false
;
...
...
@@ -2513,6 +2554,19 @@ export default {
}
}
}
if
(
this
.
allGraphData
[
data
.
scope_name
].
maxChainNum
>
this
.
maxChainNum
)
{
this
.
selectedNode
.
name
=
data
.
scope_name
;
this
.
allGraphData
[
data
.
scope_name
].
isUnfold
=
false
;
this
.
deleteNamespace
(
data
.
scope_name
);
this
.
$message
.
error
(
this
.
$t
(
'
graph.tooManyChain
'
));
this
.
$nextTick
(()
=>
{
this
.
loading
.
show
=
false
;
});
return
;
}
}
if
(
data
.
children
.
scope_name
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录