Skip to content

Commit 2d48deb

Browse files
Merge pull request #1810 from markgrahamdawson/family-subgraphs
added family grouping plus family and cycle collapsing
2 parents dfc6bfc + 73d05f5 commit 2d48deb

File tree

9 files changed

+2254
-44
lines changed

9 files changed

+2254
-44
lines changed

changes.d/1810.feat.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added graph view feature to group by family, and collapse by family and cycle point

src/components/cylc/ViewToolbar.vue

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3030
class="control"
3131
:data-cy="`control-${iControl.key}`"
3232
>
33-
<v-btn
33+
<v-menu
34+
v-if="iControl.action==='select-tree'"
35+
:close-on-content-click="false"
36+
>
37+
<template v-slot:activator="{ props }">
38+
<v-btn
39+
v-bind="{...$attrs, ...props, ...btnProps}"
40+
:disabled="iControl.disabled"
41+
:color="iControl.color"
42+
>
43+
<v-icon>{{ iControl.icon }}</v-icon>
44+
<v-tooltip>{{ iControl.title }}</v-tooltip>
45+
</v-btn>
46+
</template>
47+
<v-treeview
48+
v-model:selected="iControl.value"
49+
v-on:update:selected="iControl.callback"
50+
:items="iControl.items"
51+
item-props
52+
select-strategy='independent'
53+
item-title="name"
54+
item-value="name"
55+
selectable
56+
open-all
57+
></v-treeview>
58+
</v-menu>
59+
<v-btn v-else
3460
v-bind="btnProps"
3561
:disabled="iControl.disabled"
3662
:color="iControl.color"
@@ -46,10 +72,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4672

4773
<script>
4874
import { btnProps } from '@/utils/viewToolbar'
75+
import { VTreeview } from 'vuetify/labs/VTreeview'
4976
5077
export default {
5178
name: 'ViewToolbar',
5279
80+
components: {
81+
VTreeview,
82+
},
83+
5384
emits: [
5485
'setOption'
5586
],
@@ -120,7 +151,6 @@ export default {
120151
color = null
121152
callback = null
122153
disabled = false
123-
124154
// set callback and color
125155
switch (control.action) {
126156
case 'toggle':
@@ -132,6 +162,12 @@ export default {
132162
case 'callback':
133163
callback = (e) => this.call(control, e)
134164
break
165+
case 'select-tree':
166+
callback = (e) => this.select(control, e)
167+
if (control.value.length) {
168+
color = 'blue'
169+
}
170+
break
135171
}
136172
137173
// set disabled
@@ -178,6 +214,10 @@ export default {
178214
control.callback()
179215
e.currentTarget.blur()
180216
},
217+
select (control, value) {
218+
// call a control's callback
219+
this.$emit('setOption', control.key, value)
220+
},
181221
getValues () {
182222
// an object with all defined values
183223
const vars = {}

src/services/mock/json/workflows/multi.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,22 @@
111111
]
112112
}
113113
],
114+
"families": [
115+
{
116+
"__typename": "Family",
117+
"id": "~user/other/multi/run2//$namespace|root",
118+
"name": "root",
119+
"parents": [],
120+
"descendants": ["foo"],
121+
"childTasks": [
122+
{
123+
"name": "foo",
124+
"__typename": "Task"
125+
}
126+
],
127+
"childFamilies": []
128+
}
129+
],
114130
"familyProxies": [
115131
{
116132
"__typename": "FamilyProxy",
@@ -152,6 +168,7 @@
152168
},
153169
"firstParent": {
154170
"id": "~user/other/multi/run2//1/root",
171+
"name": "root",
155172
"__typename": "FamilyProxy"
156173
},
157174
"__typename": "TaskProxy"
@@ -170,6 +187,7 @@
170187
},
171188
"firstParent": {
172189
"id": "~user/other/multi/run2//2/root",
190+
"name": "root",
173191
"__typename": "FamilyProxy"
174192
},
175193
"__typename": "TaskProxy"

src/services/mock/json/workflows/one.json

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,107 @@
4646
"ancestors": []
4747
}
4848
],
49+
"families": [
50+
{
51+
"__typename": "Family",
52+
"id": "~user/one//$namespace|root",
53+
"name": "root",
54+
"parents": [],
55+
"descendants": ["BAD", "GOOD", "waiting", "sleepy", "checkpoint"],
56+
"childTasks": [
57+
{
58+
"name": "checkpoint",
59+
"_typename": "Task"
60+
},
61+
{
62+
"name": "sleepy",
63+
"_typename": "Task"
64+
},
65+
{
66+
"name": "waiting",
67+
"_typename": "Task"
68+
}
69+
],
70+
"childFamilies": [
71+
{
72+
"name": "BAD",
73+
"_typename": "Family"
74+
},
75+
{
76+
"name": "GOOD",
77+
"_typename": "Family"
78+
}
79+
]
80+
},
81+
{
82+
"__typename": "Family",
83+
"id": "~user/one//$namespace|BAD",
84+
"name": "BAD",
85+
"firstParent": { "id": "~user/one//$namespace|root", "name": "root"},
86+
"parents": [
87+
{
88+
"name": "root",
89+
"_typename": "Family"
90+
}
91+
],
92+
"descendants": ["failed", "retrying"],
93+
"childTasks": [
94+
{
95+
"name": "failed",
96+
"_typename": "Task"
97+
},
98+
{
99+
"name": "retrying",
100+
"_typename": "Task"
101+
}
102+
],
103+
"childFamilies": []
104+
},
105+
{
106+
"__typename": "Family",
107+
"id": "~user/one//$namespace|GOOD",
108+
"name": "GOOD",
109+
"firstParent": { "id": "~user/one//$namespace|root", "name": "root"},
110+
"parents": [
111+
{
112+
"name": "root",
113+
"_typename": "family"
114+
}
115+
],
116+
"descendants": ["SUCCEEDED"],
117+
"childTasks": [],
118+
"childFamilies": [
119+
{
120+
"name": "SUCCEEDED",
121+
"_typename": "Family"
122+
}
123+
]
124+
},
125+
{
126+
"__typename": "Family",
127+
"id": "~user/one//$namespace|SUCCEEDED",
128+
"name": "SUCCEEDED",
129+
"firstParent": { "id": "~user/one//$namespace|GOOD", "name": "GOOD"},
130+
"parents": [
131+
{
132+
"name": "GOOD",
133+
"_typename": "Family"
134+
}
135+
],
136+
"descendants": ["eventually_succeeded", "succeeded"],
137+
"childTasks": [
138+
{
139+
"name": "eventually_succeeded",
140+
"_typename": "Task"
141+
},
142+
{
143+
"name": "succeeded",
144+
"_typename": "Task"
145+
}
146+
],
147+
"childFamilies": []
148+
}
149+
],
49150
"familyProxies": [
50151
{
51152
"__typename": "FamilyProxy",

src/store/workflows.module.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,10 @@ const mutations = {
514514
// NOTE: deltas are applied in the order listed here
515515
// NOTE: we must create tasks before families (note cycles ARE families
516516
// because of the way we request them)
517-
const KEYS = ['workflow', 'taskProxies', 'cyclePoints', 'familyProxies', 'jobs', 'edges']
517+
const KEYS = ['workflow', 'taskProxies', 'cyclePoints', 'familyProxies', 'jobs', 'edges', 'families']
518518

519519
// Pruned keys which return arrays of pruned IDs
520-
const PRUNED_KEYS_MULT = ['taskProxies', 'familyProxies', 'jobs', 'edges']
520+
const PRUNED_KEYS_MULT = ['taskProxies', 'familyProxies', 'jobs', 'edges', 'families']
521521
// Pruned keys which contain single pruned IDs
522522
const PRUNED_KEYS_SING = ['workflow']
523523

0 commit comments

Comments
 (0)