@abi-software/map-utilities 1.1.3-beta.7 → 1.1.3-beta.9
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
package/src/App.vue
CHANGED
|
@@ -39,6 +39,9 @@ const drawnTypes = [
|
|
|
39
39
|
{ value: "None", label: "None" },
|
|
40
40
|
];
|
|
41
41
|
const showConnectivityGraph = ref(false);
|
|
42
|
+
// const connectivityGraphEntry = "ilxtr:neuron-type-aacar-13";
|
|
43
|
+
const connectivityGraphEntry = "ilxtr:sparc-nlp/kidney/134";
|
|
44
|
+
const mapServer = "https://mapcore-demo.org/curation/flatmap/";
|
|
42
45
|
|
|
43
46
|
onMounted(() => {
|
|
44
47
|
console.log("🚀 ~ onMounted ~ appRef:", appRef.value);
|
|
@@ -513,8 +516,8 @@ function changeHover(value) {
|
|
|
513
516
|
/>
|
|
514
517
|
<ConnectivityGraph
|
|
515
518
|
v-if="showConnectivityGraph"
|
|
516
|
-
entry="
|
|
517
|
-
map-server="
|
|
519
|
+
:entry="connectivityGraphEntry"
|
|
520
|
+
:map-server="mapServer"
|
|
518
521
|
/>
|
|
519
522
|
</div>
|
|
520
523
|
</template>
|
|
@@ -353,8 +353,12 @@ export default {
|
|
|
353
353
|
this.zoomLockLabel = this.zoomEnabled ? ZOOM_UNLOCK_LABEL : ZOOM_LOCK_LABEL;
|
|
354
354
|
this.connectivityGraph.enableZoom(!this.zoomEnabled);
|
|
355
355
|
},
|
|
356
|
-
|
|
357
|
-
this.errorMessage =
|
|
356
|
+
showErrorMessage: function (errorMessage) {
|
|
357
|
+
this.errorMessage = errorMessage;
|
|
358
|
+
// Show error for 3 seconds
|
|
359
|
+
setTimeout(() => {
|
|
360
|
+
this.errorMessage = '';
|
|
361
|
+
}, 3000);
|
|
358
362
|
},
|
|
359
363
|
},
|
|
360
364
|
};
|
|
@@ -381,25 +385,29 @@ export default {
|
|
|
381
385
|
}
|
|
382
386
|
|
|
383
387
|
.node-key {
|
|
384
|
-
|
|
385
|
-
|
|
388
|
+
padding: 0.5rem;
|
|
389
|
+
font-size: 12px;
|
|
390
|
+
border: 1px solid var(--el-border-color);
|
|
386
391
|
background-color: rgba(#f7faff, 0.85);
|
|
387
392
|
|
|
388
393
|
div div {
|
|
389
394
|
width: 90px;
|
|
395
|
+
display: flex;
|
|
396
|
+
align-items: center;
|
|
397
|
+
justify-content: space-between;
|
|
390
398
|
}
|
|
391
399
|
}
|
|
392
400
|
|
|
393
401
|
.key-head {
|
|
394
402
|
text-align: center;
|
|
395
403
|
font-weight: bold;
|
|
396
|
-
border-bottom: 1px solid
|
|
404
|
+
border-bottom: 1px solid var(--el-border-color);
|
|
397
405
|
padding-bottom: 4px;
|
|
398
|
-
margin-bottom:
|
|
406
|
+
margin-bottom: 0.5rem;
|
|
399
407
|
}
|
|
400
408
|
|
|
401
409
|
.key-box {
|
|
402
|
-
|
|
410
|
+
display: block;
|
|
403
411
|
width: 12px;
|
|
404
412
|
height: 12px;
|
|
405
413
|
}
|
|
@@ -414,10 +422,13 @@ export default {
|
|
|
414
422
|
}
|
|
415
423
|
|
|
416
424
|
.control-button {
|
|
425
|
+
width: 24px;
|
|
426
|
+
height: 24px;
|
|
417
427
|
margin: 0 !important;
|
|
418
|
-
padding: 0
|
|
419
|
-
font-size:
|
|
428
|
+
padding: 0 !important;
|
|
429
|
+
font-size: 16px !important;
|
|
420
430
|
border-color: $app-primary-color !important;
|
|
431
|
+
border-radius: 50%;
|
|
421
432
|
background: $app-primary-color !important;
|
|
422
433
|
transition: all 0.25s ease;
|
|
423
434
|
|
|
@@ -430,10 +441,6 @@ export default {
|
|
|
430
441
|
&:active {
|
|
431
442
|
box-shadow: none !important;
|
|
432
443
|
}
|
|
433
|
-
|
|
434
|
-
&:hover {
|
|
435
|
-
background: $lightPurple !important;
|
|
436
|
-
}
|
|
437
444
|
}
|
|
438
445
|
|
|
439
446
|
:deep(.cy-graph-tooltip) {
|
|
@@ -200,6 +200,15 @@ const GRAPH_STYLE = [
|
|
|
200
200
|
}
|
|
201
201
|
]
|
|
202
202
|
|
|
203
|
+
function capitalizeLabels(input) {
|
|
204
|
+
return input.split('\n').map(label => {
|
|
205
|
+
if (label && label[0] >= 'a' && label[0] <= 'z') {
|
|
206
|
+
return label.charAt(0).toUpperCase() + label.slice(1)
|
|
207
|
+
}
|
|
208
|
+
return label
|
|
209
|
+
}).join('\n')
|
|
210
|
+
}
|
|
211
|
+
|
|
203
212
|
//==============================================================================
|
|
204
213
|
|
|
205
214
|
class CytoscapeGraph extends EventTarget
|
|
@@ -226,7 +235,6 @@ class CytoscapeGraph extends EventTarget
|
|
|
226
235
|
}).on('mouseover', 'node', this.overNode.bind(this))
|
|
227
236
|
.on('mouseout', 'node', this.exitNode.bind(this))
|
|
228
237
|
.on('position', 'node', this.moveNode.bind(this))
|
|
229
|
-
.on('tap', 'node', this.tapNode.bind(this))
|
|
230
238
|
.on('tap', this.tapNode.bind(this))
|
|
231
239
|
|
|
232
240
|
this.tooltip = document.createElement('div')
|
|
@@ -255,10 +263,14 @@ class CytoscapeGraph extends EventTarget
|
|
|
255
263
|
//==============
|
|
256
264
|
{
|
|
257
265
|
const node = event.target
|
|
258
|
-
|
|
266
|
+
const label = capitalizeLabels(node.data().label)
|
|
267
|
+
|
|
268
|
+
this.tooltip.innerText = label
|
|
259
269
|
this.tooltip.style.left = `${event.renderedPosition.x}px`
|
|
260
270
|
this.tooltip.style.top = `${event.renderedPosition.y}px`
|
|
271
|
+
this.tooltip.style.maxWidth = '240px'
|
|
261
272
|
this.tooltip.hidden = false
|
|
273
|
+
|
|
262
274
|
this.checkRightBoundary(event.renderedPosition.x)
|
|
263
275
|
}
|
|
264
276
|
|