11<template >
22 <v-container
33 fluid
4- v-if =" graphData.nodes && graphData.nodes.length > 0"
4+ >
5+ <div
6+ id =" sigmacontainer"
7+ ref =" sigmacontainer"
8+ />
9+ </v-container >
10+ <!--
11+ <v-container
12+ fluid
513 >
614 <v-row>
715 <v-col
4553 v-for="legendItem in networkGraph['legend']"
4654 :key="legendItem['name']"
4755 >
48- <!--
49- <v-list-item-icon>
50- <v-icon :color="legendItem['color']">
51- fa fa-long-arrow-alt-right
52- </v-icon>
53- </v-list-item-icon>
54- -->
5556 <v-list-item-title class="font-weight-regular text-body-2">
5657 {{ legendItem['name'] }}
5758 </v-list-item-title>
6061 </v-col>
6162 </v-row>
6263 <v-divider />
63- <!-- Color definition meaning in NetworkGraph -->
6464 <div>
6565 <h3 class="mb-4">
6666 Registry
9696 </div>
9797 <v-divider />
9898 <div>
99- <!-- Color definition meaning in NetworkGraph -->
10099 <h3 class="mb-4">
101100 Status (shown on mouseover)
102101 </h3>
131130 </div>
132131 <v-divider />
133132 <div>
134- <!-- buttons here -->
135133 <h3 class="mb-4">
136134 Distance from centre
137135 </h3>
178176 xl="9"
179177 class="pt-0 mt-2"
180178 >
181- <!--
182- <v-btn
183- class="ml-2 my-2 white"
184- :to="`/${$route.params.id}`"
185- >
186- <v-icon :class="`primary-- text`">
187- fa-arrow-left
188- </v-icon>
189- <span :class="`primary-- text ml-3`"> Go to Record </span>
190- </v-btn>
191- -->
192179 <div v-if="graphData.nodes && graphData.nodes.length === 0">
193180 <v-card-title class="blue white-- text">
194181 No graph found!
233220 </v-container>
234221 </v-card-text>
235222 </div>
236- <div
237- id =" sigmacontainer"
238- ref =" sigmacontainer"
239- />
240223 </v-card>
241224 </v-col>
242225 </v-row>
243226 </v-container>
227+ -->
244228</template >
245229<script >
246230import { useAdvancedSearchStore } from " @/stores/advancedSearch.js" ;
@@ -263,6 +247,8 @@ import graphQuery from '@/lib/GraphClient/queries/getGraphRelations.json'
263247
264248const graph = new Graph ();
265249let renderer;
250+ // let sigmacontainer;
251+ // let sigmacontainer = ref(null);
266252
267253export default {
268254 name: " GraphView" ,
@@ -288,10 +274,11 @@ export default {
288274 const store = useAdvancedSearchStore ();
289275 let sigmacontainer = ref (null );
290276
277+ /*
291278 onMounted(() => {
292- // sigmacontainer.innerHtml = "<div id='sigmacontainer'></div>";
293- console .log (" SIGMA: " + JSON .stringify (sigmacontainer));
279+ sigmacontainer = document.getElementById("sigmacontainer");
294280 });
281+ */
295282
296283 let networkGraph = reactive (networkGraphData);
297284 let graphData = reactive ([]);
@@ -307,7 +294,7 @@ export default {
307294 });
308295 let sensibleSettings = reactive ({});
309296 let fa2Layout = ref (null );
310- let graphState = reactive ({});
297+ let graphState = reactive ({}). value ;
311298 let buttonsActive = ref (false );
312299 let selectedLengths = reactive ({
313300 1 : true ,
@@ -327,14 +314,12 @@ export default {
327314 });
328315 let highlighted = ref (0 );
329316
330- /*
331317 let layoutRendering = computed (() => {
332318 if (fa2Layout === undefined || fa2Layout === null ) {
333319 return false
334320 }
335321 return fa2Layout .isRunning ();
336322 })
337- */
338323
339324 // Get graph data from the API based on the IDs from the advancedsearchresponse.
340325 async function getData (ids ){
@@ -364,7 +349,7 @@ export default {
364349 graph .clear ();
365350 graph .import (graphData);
366351
367- console .log (" got container: " + JSON .stringify (sigmacontainer));
352+ console .log (" got container: " + JSON .stringify (sigmacontainer . value ));
368353
369354 // Graphology implementation of Force Atlas 2 in a web worker
370355 sensibleSettings = forceAtlas2 .inferSettings (graph);
@@ -376,7 +361,7 @@ export default {
376361 // eslint-disable-next-line no-unused-vars
377362 renderer = new Sigma (
378363 graph,
379- sigmacontainer,
364+ sigmacontainer . value ,
380365 {
381366 allowInvalidContainer: true ,
382367 nodeProgramClasses: {
@@ -449,6 +434,12 @@ export default {
449434 buttonsActive = true ;
450435 }
451436
437+ function lengthLimit (item ) {
438+ const itemLength = item .hops
439+ selectedLengths[itemLength] = selectedLengths[itemLength];
440+ item .active = ! item .active
441+ }
442+
452443 // Watched so that the graph can be re-plotted when search results change.
453444 watch (() => store .getAdvancedSearchResponse , async () => {
454445 let ids = store .getAdvancedSearchResponse .map ((x ) => x .id ).join (' ,' );
@@ -496,12 +487,6 @@ export default {
496487 },
497488 */
498489 methods: {
499-
500- lengthLimit (item ) {
501- const itemLength = item .hops
502- this .selectedLengths [itemLength] = ! this .selectedLengths [itemLength];
503- item .active = ! item .active
504- },
505490 getLengthColour (len ) {
506491 if (this .selectedLengths [len] === true ) {
507492 return " #27aae1"
0 commit comments