@abi-software/flatmapvuer 1.0.1 → 1.1.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.
@@ -15,6 +15,22 @@
15
15
  <div class="block" v-else>
16
16
  <div class="title">{{ entry.featureId }}</div>
17
17
  </div>
18
+ <div v-if="featuresAlert">
19
+ <span class="attribute-title">Alert</span>
20
+ <el-popover
21
+ width="250"
22
+ trigger="hover"
23
+ :teleported="false"
24
+ popper-class="popover-origin-help"
25
+ >
26
+ <template #reference>
27
+ <el-icon class="info"><el-icon-warning /></el-icon>
28
+ </template>
29
+ <span style="word-break: keep-all">
30
+ {{ featuresAlert }}
31
+ </span>
32
+ </el-popover>
33
+ </div>
18
34
  <div v-show="showDetails" class="hide" id="hide-path-info" @click="showDetails = false">
19
35
  Hide path information
20
36
  <el-icon><el-icon-arrow-up /></el-icon>
@@ -195,6 +211,7 @@ export default {
195
211
  }),
196
212
  },
197
213
  },
214
+ inject: ['getFeaturesAlert'],
198
215
  data: function () {
199
216
  return {
200
217
  controller: undefined,
@@ -212,6 +229,9 @@ export default {
212
229
  }
213
230
  },
214
231
  computed: {
232
+ featuresAlert() {
233
+ return this.getFeaturesAlert()
234
+ },
215
235
  resources: function () {
216
236
  let resources = []
217
237
  if (this.entry && this.entry.hyperlinks) {
@@ -315,8 +335,15 @@ export default {
315
335
  cursor: pointer;
316
336
  }
317
337
 
318
- .popover-origin-help {
338
+ :deep(.popover-origin-help.el-popover) {
319
339
  text-transform: none !important; // need to overide the tooltip text transform
340
+ border: 1px solid $app-primary-color;
341
+ .el-popper__arrow {
342
+ &:before {
343
+ border-color: $app-primary-color;
344
+ background-color: #f3ecf6;
345
+ }
346
+ }
320
347
  }
321
348
 
322
349
  .info {
@@ -27,7 +27,10 @@
27
27
  :key="item[identifierKey]"
28
28
  :label="item[identifierKey]"
29
29
  >
30
- <div class="checkbox-container">
30
+ <div class="checkbox-container"
31
+ @mouseenter="checkboxMouseEnterEmit(item[identifierKey], true)"
32
+ @mouseleave="checkboxMouseEnterEmit(item[identifierKey], false)"
33
+ >
31
34
  <el-checkbox
32
35
  class="my-checkbox"
33
36
  :label="item[identifierKey]"
@@ -88,6 +91,11 @@ export default {
88
91
  visibilityToggle: function (key, value) {
89
92
  this.$emit('changed', { key, value })
90
93
  },
94
+ checkboxMouseEnterEmit: function (key, value) {
95
+ // Update the stated to send to the emit
96
+ this.$emit('checkboxMouseEnter', { key: key, value: value, selections: this.selections, checked: this.checkedItems})
97
+ },
98
+
91
99
  handleCheckedItemsChange: function (value) {
92
100
  let checkedCount = value.length
93
101
  this.checkAll = checkedCount === this.selections.length
@@ -96,6 +104,7 @@ export default {
96
104
  this.checkedItems = val
97
105
  ? this.selections.map((a) => a[this.identifierKey])
98
106
  : []
107
+
99
108
  this.$emit('checkAll', {
100
109
  keys: this.selections.map((a) => a[this.identifierKey]),
101
110
  value: val,
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="tooltip-container" id="tooltip-container">
3
3
  <template v-if="annotationDisplay">
4
- <annotation-tool :annotationEntry="annotationEntry" />
4
+ <annotation-tool :annotationEntry="annotationEntry" @annotation="$emit('annotation', $event)" />
5
5
  </template>
6
6
  <template v-else>
7
7
  <provenance-popup :entry="entry" />
@@ -8,8 +8,10 @@ export {}
8
8
  declare module 'vue' {
9
9
  export interface GlobalComponents {
10
10
  AnnotationTool: typeof import('./components/AnnotationTool.vue')['default']
11
+ ConnectionDialog: typeof import('./components/ConnectionDialog.vue')['default']
11
12
  DynamicLegends: typeof import('./components/legends/DynamicLegends.vue')['default']
12
13
  ElButton: typeof import('element-plus/es')['ElButton']
14
+ ElCard: typeof import('element-plus/es')['ElCard']
13
15
  ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
14
16
  ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
15
17
  ElCol: typeof import('element-plus/es')['ElCol']
@@ -17,8 +19,11 @@ declare module 'vue' {
17
19
  ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
18
20
  ElIconArrowLeft: typeof import('@element-plus/icons-vue')['ArrowLeft']
19
21
  ElIconArrowUp: typeof import('@element-plus/icons-vue')['ArrowUp']
22
+ ElIconCircleClose: typeof import('@element-plus/icons-vue')['CircleClose']
20
23
  ElIconClose: typeof import('@element-plus/icons-vue')['Close']
24
+ ElIconDelete: typeof import('@element-plus/icons-vue')['Delete']
21
25
  ElIconEdit: typeof import('@element-plus/icons-vue')['Edit']
26
+ ElIconFinished: typeof import('@element-plus/icons-vue')['Finished']
22
27
  ElIconWarning: typeof import('@element-plus/icons-vue')['Warning']
23
28
  ElIconWarningFilled: typeof import('@element-plus/icons-vue')['WarningFilled']
24
29
  ElInput: typeof import('element-plus/es')['ElInput']
@@ -222,23 +222,36 @@ let FlatmapQueries = function () {
222
222
  this.origins = []
223
223
  this.components = []
224
224
  if (!keastIds || keastIds.length == 0) return
225
+
226
+ let prom1 = this.queryForConnectivity(keastIds, signal) // This on returns a promise so dont need 'await'
227
+ let prom2 = await this.pubmedQueryOnIds(eventData)
228
+ let results = await Promise.all([prom1, prom2])
229
+ return results
230
+ }
231
+
232
+ this.queryForConnectivity = function (keastIds, signal, processConnectivity=true) {
225
233
  const data = { sql: this.buildConnectivitySqlStatement(keastIds) }
226
- let prom1 = new Promise((resolve) => {
227
- fetch(`${this.flatmapApi}knowledge/query/`, {
228
- method: 'POST',
229
- headers: {
230
- 'Content-Type': 'application/json',
231
- },
232
- body: JSON.stringify(data),
233
- signal: signal,
234
- })
234
+
235
+ const headers = {
236
+ method: 'POST',
237
+ headers: {
238
+ 'Content-Type': 'application/json',
239
+ },
240
+ body: JSON.stringify(data),
241
+ ...(signal ? { signal: signal } : {}), // add signal to header if it exists
242
+ }
243
+ return new Promise((resolve) => {
244
+ fetch(`${this.flatmapApi}knowledge/query/`, headers)
235
245
  .then((response) => response.json())
236
246
  .then((data) => {
237
247
  if (this.connectivityExists(data)) {
238
248
  let connectivity = JSON.parse(data.values[0][0])
239
- this.processConnectivity(connectivity).then(() => {
240
- resolve(true)
241
- })
249
+ if (processConnectivity) {
250
+ this.processConnectivity(connectivity).then((processedConnectivity) => {
251
+ resolve(processedConnectivity)
252
+ })
253
+ }
254
+ else resolve(connectivity)
242
255
  } else {
243
256
  resolve(false)
244
257
  }
@@ -248,9 +261,6 @@ let FlatmapQueries = function () {
248
261
  resolve(false)
249
262
  })
250
263
  })
251
- let prom2 = await this.pubmedQueryOnIds(eventData)
252
- let results = await Promise.all([prom1, prom2])
253
- return results
254
264
  }
255
265
 
256
266
  this.connectivityExists = function (data) {
@@ -266,7 +276,11 @@ let FlatmapQueries = function () {
266
276
  }
267
277
  }
268
278
 
269
- this.createLabelFromNeuralNode = function (node, lookUp) {
279
+ this.createLabelFromNeuralNode = function (node, lookUp, isSingle=true) {
280
+ if (isSingle) {
281
+ return lookUp[node]
282
+ }
283
+
270
284
  let label = lookUp[node[0]]
271
285
  if (node.length === 2 && node[1].length > 0) {
272
286
  node[1].forEach((n) => {
@@ -315,14 +329,26 @@ let FlatmapQueries = function () {
315
329
  this.destinations = axons.map((a) =>
316
330
  this.createLabelFromNeuralNode(a, lookUp)
317
331
  )
332
+
318
333
  this.origins = dendrites.map((d) =>
319
- this.createLabelFromNeuralNode(d, lookUp)
334
+ this.createLabelFromNeuralNode(d, lookUp, true)
320
335
  )
321
336
  this.components = components.map((c) =>
322
- this.createLabelFromNeuralNode(c, lookUp)
337
+ this.createLabelFromNeuralNode(c, lookUp, false)
323
338
  )
324
339
  this.flattenAndFindDatasets(components, axons, dendrites)
325
- resolve(true)
340
+ resolve({
341
+ ids: {
342
+ axons: axons,
343
+ dendrites: dendrites,
344
+ components: components,
345
+ },
346
+ labels: {
347
+ destinations: this.destinations,
348
+ origins: this.origins,
349
+ components: this.components,
350
+ }
351
+ })
326
352
  })
327
353
  })
328
354
  }
@@ -341,29 +367,6 @@ let FlatmapQueries = function () {
341
367
  return found.flat()
342
368
  }
343
369
 
344
- this.findComponents = function (connectivity) {
345
- let dnodes = connectivity.connectivity.flat() // get nodes from edgelist
346
- let nodes = removeDuplicates(dnodes)
347
-
348
- let found = []
349
- let terminal = false
350
- nodes.forEach((node) => {
351
- terminal = false
352
- // Check if the node is an destination or origin (note that they are labelled dendrite and axon as opposed to origin and destination)
353
- if (inArray(connectivity.axons, node)) {
354
- terminal = true
355
- }
356
- if (inArray(connectivity.dendrites, node)) {
357
- terminal = true
358
- }
359
- if (!terminal) {
360
- found.push(node)
361
- }
362
- })
363
-
364
- return found
365
- }
366
-
367
370
  this.stripPMIDPrefix = function (pubmedId) {
368
371
  return pubmedId.split(':')[1]
369
372
  }