From 6d3cde404998fff0dfc10b832ca34cdd725cda0b Mon Sep 17 00:00:00 2001 From: keith schwalm <13208865+dnkcom@users.noreply.github.com> Date: Tue, 27 Jun 2023 16:11:22 -0600 Subject: [PATCH] fix: (temp) added reset network func until we can determine why links are not updating in generate graph --- src/js/src/components/StateOfHealth.vue | 35 +++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/js/src/components/StateOfHealth.vue b/src/js/src/components/StateOfHealth.vue index f1b5b5d4..05f9aa99 100644 --- a/src/js/src/components/StateOfHealth.vue +++ b/src/js/src/components/StateOfHealth.vue @@ -192,16 +192,12 @@
- - - - - {{ n }} - - - + + + + {{ n }} + +
@@ -582,14 +578,17 @@ export default { return '#999'; }, + setEdge( type ) { + this.showEdgeType = type; + this.resetNetwork(); + }, + generateGraph () { if ( this.nodes == null ) { return; } - const nodes = this.nodes.map( d => Object.create( d ) ); - // const links = this.edges.map( d => Object.create( d ) ); - + const nodes = this.nodes; const links = this.edges.filter( (d) => { switch ( this.showEdgeType ) { case 'all': { @@ -606,7 +605,7 @@ export default { } }, this); - const width = 600; + const width = 600; const height = 400; const simulation = d3.forceSimulation( nodes ) @@ -976,6 +975,10 @@ export default { this.generateGraph(); this.generateChord(); } + }, + + showEdgeType: function () { + this.generateGraph(); } }, @@ -1021,4 +1024,8 @@ export default { .modal-card-title { color: whitesmoke; } + + .dropdown-item.is-active { + background-color: whitesmoke; + }