@abi-software/map-utilities 1.4.3-isan.1 → 1.5.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-utilities",
3
- "version": "1.4.3-isan.1",
3
+ "version": "1.5.0-beta.0",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
package/src/App.vue CHANGED
@@ -130,7 +130,7 @@ function onActionClick(value) {
130
130
  * Tooltip
131
131
  */
132
132
  const tooltipDisplay = ref(false);
133
- const tooltipEntry = ref([]);
133
+ const tooltipEntry = ref({});
134
134
  const featuresAlert = ref(undefined);
135
135
  const annotationDisplay = ref(false);
136
136
  const annotationEntry = ref({});
@@ -141,90 +141,33 @@ provide(/* key */ "userApiKey", /* value */ undefined);
141
141
 
142
142
  function addTooltipEntry() {
143
143
  tooltipDisplay.value = true;
144
- tooltipEntry.value = [
145
- {
146
- destinations: ["eccrine sweat gland of the trunk"],
147
- origins: [
148
- "Sixth thoracic ganglion",
149
- "Twelfth thoracic ganglion",
150
- "Fifth thoracic ganglion",
151
- "Ninth thoracic ganglion",
152
- "Seventh thoracic ganglion",
153
- "Eighth thoracic ganglion",
154
- "Fourth thoracic ganglion",
155
- "Tenth thoracic ganglion",
156
- "Eleventh thoracic ganglion",
157
- ],
158
- components: ["nerve"],
159
- destinationsWithDatasets: [
160
- { id: "ILX:0795061", name: "eccrine sweat gland of the trunk" },
161
- ],
162
- originsWithDatasets: [
163
- { id: "ILX:0784378", name: "Ninth thoracic ganglion" },
164
- { id: "ILX:0784569", name: "Tenth thoracic ganglion" },
165
- { id: "ILX:0784721", name: "Eighth thoracic ganglion" },
166
- { id: "ILX:0786141", name: "Fifth thoracic ganglion" },
167
- { id: "ILX:0786272", name: "Fourth thoracic ganglion" },
168
- { id: "ILX:0787009", name: "Twelfth thoracic ganglion" },
169
- { id: "ILX:0787015", name: "Eleventh thoracic ganglion" },
170
- { id: "ILX:0789947", name: "Sixth thoracic ganglion" },
171
- { id: "ILX:0790482", name: "Seventh thoracic ganglion" },
172
- ],
173
- componentsWithDatasets: [{ id: "UBERON:0001021", name: "nerve" }],
174
- title: "neuron type swglnd 161",
175
- featureId: ["ilxtr:sparc-nlp/swglnd/161"],
176
- hyperlinks: [
177
- "https://doi.org/10.1007/s10286-015-0282-1",
178
- "https://doi.org/10.1111/bjd.15808",
179
- "https://doi.org/10.1159/000060678",
180
- ],
181
- provenanceTaxonomy: ["NCBITaxon:9606"],
182
- provenanceTaxonomyLabel: ["Homo sapiens"],
183
- knowledgeSource: "sckan-2024-09-21-npo",
184
- mapId: "rat-flatmap",
185
- mapuuid: "b4ae1699-5690-5640-97b7-d711ae02dcb9",
186
- },
187
- {
188
- destinations: ["intramural ganglion of the kidney"],
189
- origins: ["dorsal motor nucleus of vagus nerve"],
190
- components: [
191
- "renal nerve plexus",
192
- "aortic plexus",
193
- "esophageal vagus trunk",
194
- "vagus X nerve trunk",
195
- "vagus nerve",
196
- ],
197
- destinationsWithDatasets: [
198
- { id: "ILX:0795056", name: "intramural ganglion of the kidney" },
199
- ],
200
- originsWithDatasets: [
201
- { id: "UBERON:0002870", name: "dorsal motor nucleus of vagus nerve" },
202
- ],
203
- componentsWithDatasets: [
204
- { id: "ILX:0794853", name: "esophageal vagus trunk" },
205
- { id: "UBERON:0001759", name: "vagus nerve" },
206
- { id: "UBERON:0003535", name: "vagus X nerve trunk" },
207
- { id: "UBERON:0018676", name: "renal nerve plexus" },
208
- { id: "UBERON:0035772", name: "aortic plexus" },
209
- ],
210
- title:
211
- "dorsal motor nucleus of vagus nerve to intramural ganglia of the kidney via vagus nerve via esophageal vagus trunk via vagal trunks via aortic plexus via renal plexus",
212
- featureId: ["ilxtr:sparc-nlp/kidney/135"],
213
- hyperlinks: [
214
- "https://uilx.org/tgbugs/u/r/isbn-13/978-0323680424",
215
- "https://doi.org/10.1016/j.aanat.2015.11.004",
216
- ],
217
- provenanceTaxonomy: ["NCBITaxon:9606"],
218
- provenanceTaxonomyLabel: ["Homo sapiens"],
219
- knowledgeSource: "sckan-2024-09-21-npo",
220
- mapId: "rat-flatmap",
221
- mapuuid: "b4ae1699-5690-5640-97b7-d711ae02dcb9",
222
- },
223
- ];
144
+ tooltipEntry.value = {
145
+ destinations: [null],
146
+ origins: [null],
147
+ components: ["pudendal nerve"],
148
+ destinationsWithDatasets: [
149
+ { id: "UBERON:0004917", name: "urethral sphincter" },
150
+ ],
151
+ originsWithDatasets: [
152
+ { id: "UBERON:0022278", name: "nucleus of pudendal nerve" },
153
+ ],
154
+ componentsWithDatasets: [{ id: "UBERON:0011390", name: "pudendal nerve" }],
155
+ title:
156
+ "Nucleus of the pudendal nerve to urethral sphincter via pudendal nerve",
157
+ featureId: ["ilxtr:sparc-nlp/mmset1/1"],
158
+ hyperlinks: [
159
+ {
160
+ url: "https://pubmed.ncbi.nlm.nih.gov/?term=%2F%2Fdoi.org%2F10.1155%252F2012%252F816274",
161
+ id: "pubmed",
162
+ },
163
+ ],
164
+ provenanceTaxonomy: ["NCBITaxon:9606"],
165
+ provenanceTaxonomyLabel: ["Homo sapiens"],
166
+ };
224
167
  }
225
168
  function removeTooltipEntry() {
226
169
  tooltipDisplay.value = false;
227
- tooltipEntry.value = [];
170
+ tooltipEntry.value = {};
228
171
  }
229
172
  function addAnnotationEntry() {
230
173
  tooltipDisplay.value = true;
@@ -291,7 +234,7 @@ function setColourField(treeData, nodeData, activeColour) {
291
234
  function setColour(nodeData, value) {
292
235
  if (nodeData && nodeData.isPrimitives) {
293
236
  const activeColour = value ? value : nodeData.defaultColour;
294
- setColourField(treeDataEntry.value, nodeData, activeColour);
237
+ setColourField(treeDataEntry.value, nodeData, activeColour)
295
238
  }
296
239
  }
297
240
  function checkAll(value) {
@@ -320,7 +263,7 @@ const createData = ref({
320
263
  editingIndex: -1,
321
264
  faceIndex: -1,
322
265
  toBeDeleted: false,
323
- });
266
+ })
324
267
  function cancelCreate() {
325
268
  console.log("🚀 ~ CreateTooltipContent : cancelCreate");
326
269
  }
@@ -479,14 +422,14 @@ function confirmCreate(value) {
479
422
  Add Tooltip Entry
480
423
  </el-button>
481
424
  <el-button
482
- v-show="tooltipEntry.length > 0"
425
+ v-show="Object.keys(tooltipEntry).length > 0"
483
426
  @click="removeTooltipEntry"
484
427
  size="small"
485
428
  >
486
429
  Remove Tooltip Entry
487
430
  </el-button>
488
431
  <el-button
489
- v-show="tooltipEntry.length === 0"
432
+ v-show="!Object.keys(tooltipEntry).length > 0"
490
433
  @click="addAnnotationEntry"
491
434
  size="small"
492
435
  >
@@ -506,18 +449,10 @@ function confirmCreate(value) {
506
449
  <h3>TreeControls - {{ mapType }}</h3>
507
450
  </el-col>
508
451
  <el-col>
509
- <el-button
510
- v-show="mapType === 'scaffold'"
511
- @click="switchTreeEntry('flatmap')"
512
- size="small"
513
- >
452
+ <el-button v-show="mapType==='scaffold'" @click="switchTreeEntry('flatmap')" size="small">
514
453
  Display Flatmap Tree
515
454
  </el-button>
516
- <el-button
517
- v-show="mapType === 'flatmap'"
518
- @click="switchTreeEntry('scaffold')"
519
- size="small"
520
- >
455
+ <el-button v-show="mapType==='flatmap'" @click="switchTreeEntry('scaffold')" size="small">
521
456
  Display Scaffold Tree
522
457
  </el-button>
523
458
  </el-col>
@@ -527,10 +462,16 @@ function confirmCreate(value) {
527
462
  <h3>Connectivity Graph</h3>
528
463
  </el-col>
529
464
  <el-col>
530
- <el-button @click="showConnectivityGraph = true" size="small">
465
+ <el-button
466
+ @click="showConnectivityGraph = true"
467
+ size="small"
468
+ >
531
469
  Show connectivity graph
532
470
  </el-button>
533
- <el-button @click="showConnectivityGraph = false" size="small">
471
+ <el-button
472
+ @click="showConnectivityGraph = false"
473
+ size="small"
474
+ >
534
475
  Hide connectivity graph
535
476
  </el-button>
536
477
  </el-col>
@@ -627,9 +568,9 @@ function confirmCreate(value) {
627
568
  top: calc(50% - 100px);
628
569
  left: calc(50% - 200px);
629
570
  }
630
- .annotation-popup {
571
+ .annotation-popup{
631
572
  margin-top: 8px;
632
- width: 400px;
573
+ width:400px;
633
574
  border-style: solid;
634
575
  border-width: 1px;
635
576
  border-color: black;
@@ -160,10 +160,6 @@ export default {
160
160
  type: Array,
161
161
  default: [],
162
162
  },
163
- connectivityFromMap: {
164
- type: Object,
165
- default: () => null,
166
- },
167
163
  },
168
164
  data: function () {
169
165
  return {
@@ -188,20 +184,26 @@ export default {
188
184
  connectivityGraphContainer: null,
189
185
  };
190
186
  },
191
- watch: {
192
- connectivityFromMap: function (oldVal, newVal) {
193
- if (oldVal != newVal) {
194
- this.showSpinner();
195
- this.start();
196
- }
197
- }
198
- },
199
187
  mounted() {
200
188
  this.showSpinner();
201
189
  this.updateTooltipContainer();
202
190
  this.refreshCache();
203
191
  this.loadCacheData();
204
- this.start();
192
+ this.run()
193
+ .then((res) => {
194
+ if (res?.success) {
195
+ this.showGraph(this.entry);
196
+ } else if (res?.error) {
197
+ this.loadingError = res.error;
198
+ } else {
199
+ this.loadingError = 'Loading error!';
200
+ }
201
+ this.hideSpinner();
202
+ })
203
+ .catch((error) => {
204
+ this.loadingError = 'Loading error!';
205
+ this.hideSpinner();
206
+ });
205
207
  },
206
208
  methods: {
207
209
  updateTooltipContainer: function () {
@@ -273,22 +275,6 @@ export default {
273
275
 
274
276
  sessionStorage.setItem('connectivity-graph-expiry', expiry);
275
277
  },
276
- start: function () {
277
- this.run()
278
- .then((res) => {
279
- if (res?.success) {
280
- this.showGraph(this.entry);
281
- } else if (res?.error) {
282
- this.loadingError = res.error;
283
- } else {
284
- this.loadingError = 'Loading error!';
285
- }
286
- })
287
- .catch((error) => {
288
- this.loadingError = 'Loading error!';
289
- this.hideSpinner();
290
- });
291
- },
292
278
  run: async function () {
293
279
  if (!this.schemaVersion) {
294
280
  this.schemaVersion = await this.getSchemaVersion();
@@ -319,24 +305,8 @@ export default {
319
305
  showGraph: async function (neuronPath) {
320
306
  const graphCanvas = this.$refs.graphCanvas;
321
307
 
322
- // Update label data
323
- if (this.connectivityFromMap) {
324
- this.cacheLabels(this.connectivityFromMap);
325
- await this.getCachedTermLabels();
326
- }
327
-
328
308
  this.connectivityGraph = new ConnectivityGraph(this.labelCache, graphCanvas);
329
- const connectivityInfo = this.knowledgeByPath.get(neuronPath);
330
-
331
- // Update connectivity
332
- if (this.connectivityFromMap) {
333
- connectivityInfo.axons = this.connectivityFromMap.axons;
334
- connectivityInfo.connectivity = this.connectivityFromMap.connectivity;
335
- connectivityInfo.dendrites = this.connectivityFromMap.dendrites;
336
- connectivityInfo.somas = this.connectivityFromMap.somas;
337
- }
338
-
339
- await this.connectivityGraph.addConnectivity(connectivityInfo);
309
+ await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(neuronPath));
340
310
 
341
311
  this.connectivityGraph.showConnectivity(graphCanvas);
342
312
 
@@ -352,8 +322,6 @@ export default {
352
322
  */
353
323
  this.$emit('tap-node', data);
354
324
  });
355
-
356
- this.hideSpinner();
357
325
  },
358
326
  query: async function (sql, params) {
359
327
  const url = `${this.mapServer}knowledge/query/`;