Skip to content

Commit f0faae5

Browse files
committed
Add dropdown to SoH network graph page for edge types
1 parent cf6b924 commit f0faae5

File tree

1 file changed

+32
-15
lines changed

1 file changed

+32
-15
lines changed

src/js/src/components/StateOfHealth.vue

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
</div>
140140
</b-modal>
141141
<hr>
142-
<div class="columns is-centered">
142+
<div class="columns is-centered">
143143
<div class="column is-1">
144144
<router-link class="button is-dark" :to="{ name: 'experiment', params: { id: this.$route.params.id }}">
145145
<b-tooltip label="return to the experiment component" type="is-light is-right" :delay="1000">
@@ -191,6 +191,18 @@
191191
<b-button @click="execSoH" type="is-light">Run SOH</b-button>
192192
</div>
193193
</div>
194+
<div>
195+
<b-tooltip label="menu for selecting networks (all, network, serial)" type="is-light" multilined>
196+
<b-dropdown v-model="showEdgetType" class="is-right" aria-role="list">
197+
<button class="button is-light" slot="trigger">
198+
<b-icon icon="bars"></b-icon>
199+
</button>
200+
<b-dropdown-item v-for="( n, index ) in networks" :key="index" :value="n">
201+
<font color="#202020">{{ n }}</font>
202+
</b-dropdown-item>
203+
</b-dropdown>
204+
</b-tooltip>
205+
</div>
194206
<div class="column" />
195207
</div>
196208
<div style="margin-top: 10px; border: 2px solid whitesmoke; background: #333;">
@@ -472,7 +484,7 @@ export default {
472484
d3.selectAll('circle').attr( "fill", this.updateNodeColor );
473485
}
474486
}
475-
487+
476488
break;
477489
}
478490
case 'delete': {
@@ -482,7 +494,7 @@ export default {
482494
d3.selectAll('circle').attr( "fill", this.updateNodeColor );
483495
}
484496
}
485-
497+
486498
break;
487499
}
488500
}
@@ -514,7 +526,7 @@ export default {
514526
{ names: state.hosts }
515527
)
516528
this.flows = true;
517-
}
529+
}
518530
} catch (err) {
519531
this.errorNotification(err);
520532
} finally {
@@ -762,7 +774,7 @@ export default {
762774
}
763775
764776
let circle = d3.select( e.target );
765-
777+
766778
circle
767779
.transition()
768780
.attr( "r", 15 )
@@ -790,7 +802,7 @@ export default {
790802
this.detailsModal.vm = n.label;
791803
this.detailsModal.status = n.status;
792804
this.detailsModal.soh = n.soh;
793-
}
805+
}
794806
},
795807
796808
color ( d ) {
@@ -804,18 +816,18 @@ export default {
804816
event.subject.fx = event.subject.x;
805817
event.subject.fy = event.subject.y;
806818
}
807-
819+
808820
function dragged ( event ) {
809821
event.subject.fx = event.x;
810822
event.subject.fy = event.y;
811823
}
812-
824+
813825
function dragended ( event ) {
814826
if ( !event.active ) simulation.alphaTarget( 0 );
815827
event.subject.fx = null;
816828
event.subject.fy = null;
817829
}
818-
830+
819831
return d3.drag()
820832
.on( "start", dragstarted )
821833
.on( "drag", dragged )
@@ -833,16 +845,16 @@ export default {
833845
834846
const innerRadius = Math.min(width, height) * .35;
835847
const outerRadius = innerRadius * 1.018;
836-
848+
837849
const chord = d3.chord()
838850
.padAngle(10 / innerRadius)
839851
.sortSubgroups(d3.descending)
840852
.sortChords(d3.descending);
841-
853+
842854
const arc = d3.arc()
843855
.innerRadius(innerRadius)
844856
.outerRadius(outerRadius);
845-
857+
846858
const ribbon = d3.ribbon()
847859
.radius(innerRadius - 1)
848860
.padAngle(1 / innerRadius);
@@ -869,7 +881,7 @@ export default {
869881
.selectAll("g")
870882
.data(chords.groups)
871883
.join("g");
872-
884+
873885
group.append("path")
874886
.attr("fill", d => color(names[d.index]))
875887
.attr("stroke", d => color(names[d.index]))
@@ -912,7 +924,7 @@ export default {
912924
? `${names[d.index]}`
913925
: `${names[d.index]}`;
914926
});
915-
927+
916928
svg.append("g")
917929
.attr("fill-opacity", 0.8)
918930
.selectAll("path")
@@ -978,6 +990,11 @@ export default {
978990
nodes: [],
979991
edges: [],
980992
showEdgeType: 'all',
993+
networks: [
994+
'all',
995+
'network',
996+
'serial'
997+
],
981998
radioButton: '',
982999
vlan: VLAN,
9831000
detailsModal: {
@@ -1004,4 +1021,4 @@ export default {
10041021
.modal-card-title {
10051022
color: whitesmoke;
10061023
}
1007-
</style>
1024+
</style>

0 commit comments

Comments
 (0)