@abi-software/map-utilities 1.1.3-beta.6 → 1.1.3-beta.8
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,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="connectivity-graph" v-loading="loading">
|
|
3
|
+
|
|
3
4
|
<div ref="graphCanvas" class="graph-canvas"></div>
|
|
5
|
+
|
|
4
6
|
<div class="control-panel">
|
|
5
7
|
<div class="node-key">
|
|
6
8
|
<div class="key-head">Node type:</div>
|
|
@@ -53,6 +55,11 @@
|
|
|
53
55
|
</el-tooltip>
|
|
54
56
|
</div>
|
|
55
57
|
</div>
|
|
58
|
+
|
|
59
|
+
<div class="connectivity-graph-error" v-if="errorMessage">
|
|
60
|
+
{{ errorMessage }}
|
|
61
|
+
</div>
|
|
62
|
+
|
|
56
63
|
</div>
|
|
57
64
|
</template>
|
|
58
65
|
|
|
@@ -95,6 +102,7 @@ export default {
|
|
|
95
102
|
zoomLockLabel: ZOOM_LOCK_LABEL,
|
|
96
103
|
iconColor: APP_PRIMARY_COLOR,
|
|
97
104
|
zoomEnabled: false,
|
|
105
|
+
errorMessage: '',
|
|
98
106
|
};
|
|
99
107
|
},
|
|
100
108
|
mounted() {
|
|
@@ -184,7 +192,7 @@ export default {
|
|
|
184
192
|
|
|
185
193
|
this.connectivityGraph.on('tap-node', (event) => {
|
|
186
194
|
const { label } = event.detail;
|
|
187
|
-
const labels = label.split(`\n`);
|
|
195
|
+
const labels = label ? label.split(`\n`) : [];
|
|
188
196
|
/**
|
|
189
197
|
* This event is triggered after a node on the connectivity graph is clicked.
|
|
190
198
|
*/
|
|
@@ -345,6 +353,13 @@ export default {
|
|
|
345
353
|
this.zoomLockLabel = this.zoomEnabled ? ZOOM_UNLOCK_LABEL : ZOOM_LOCK_LABEL;
|
|
346
354
|
this.connectivityGraph.enableZoom(!this.zoomEnabled);
|
|
347
355
|
},
|
|
356
|
+
showErrorMessage: function (errorMessage) {
|
|
357
|
+
this.errorMessage = errorMessage;
|
|
358
|
+
// Show error for 3 seconds
|
|
359
|
+
setTimeout(() => {
|
|
360
|
+
this.errorMessage = '';
|
|
361
|
+
}, 3000);
|
|
362
|
+
},
|
|
348
363
|
},
|
|
349
364
|
};
|
|
350
365
|
</script>
|
|
@@ -439,6 +454,19 @@ export default {
|
|
|
439
454
|
z-index: 1;
|
|
440
455
|
}
|
|
441
456
|
|
|
457
|
+
.connectivity-graph-error {
|
|
458
|
+
position: absolute;
|
|
459
|
+
top: 1rem;
|
|
460
|
+
left: 50%;
|
|
461
|
+
transform: translateX(-50%);
|
|
462
|
+
width: fit-content;
|
|
463
|
+
font-size: 12px;
|
|
464
|
+
padding: 0.25rem 0.5rem;
|
|
465
|
+
background-color: var(--el-color-error-light-9);
|
|
466
|
+
border-radius: var(--el-border-radius-small);
|
|
467
|
+
border: 1px solid var(--el-color-error);
|
|
468
|
+
}
|
|
469
|
+
|
|
442
470
|
.visually-hidden {
|
|
443
471
|
clip: rect(0 0 0 0);
|
|
444
472
|
clip-path: inset(50%);
|
|
@@ -226,7 +226,7 @@ class CytoscapeGraph extends EventTarget
|
|
|
226
226
|
}).on('mouseover', 'node', this.overNode.bind(this))
|
|
227
227
|
.on('mouseout', 'node', this.exitNode.bind(this))
|
|
228
228
|
.on('position', 'node', this.moveNode.bind(this))
|
|
229
|
-
.on('tap',
|
|
229
|
+
.on('tap', this.tapNode.bind(this))
|
|
230
230
|
|
|
231
231
|
this.tooltip = document.createElement('div')
|
|
232
232
|
this.tooltip.className = 'cy-graph-tooltip'
|