@abi-software/map-utilities 0.0.0-beta.6 → 0.0.0-beta.7
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/LICENSE +201 -201
- package/README.md +27 -27
- package/dist/map-utilities.js +10817 -4666
- package/dist/map-utilities.umd.cjs +54 -40
- package/dist/style.css +1 -1
- package/jsconfig.json +8 -8
- package/package.json +45 -40
- package/src/App.vue +511 -511
- package/src/assets/_variables.scss +43 -43
- package/src/assets/styles.scss +5 -5
- package/src/components/DrawToolbar/ConnectionDialog.vue +118 -118
- package/src/components/DrawToolbar/DrawToolbar.vue +627 -627
- package/src/components/EventBus.js +3 -3
- package/src/components/HelpModeDialog/HelpModeDialog.vue +394 -394
- package/src/components/ImageDialog/IframeImageDialog.vue +70 -0
- package/src/components/Tooltip/AnnotationPopup.vue +467 -467
- package/src/components/Tooltip/ExternalResourceCard.vue +108 -108
- package/src/components/Tooltip/ImageGalleryPopup.vue +343 -0
- package/src/components/Tooltip/ProvenancePopup.vue +601 -518
- package/src/components/Tooltip/Tooltip.vue +75 -53
- package/src/components/TreeControls/TreeControls.vue +418 -350
- package/src/components/index.js +7 -6
- package/src/components.d.ts +3 -0
- package/src/main.js +16 -16
- package/src/mixins/flatmapImageMixin.js +42 -0
- package/vite.config.js +56 -56
package/src/App.vue
CHANGED
|
@@ -1,511 +1,511 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref, provide, onMounted, watch } from "vue";
|
|
3
|
-
|
|
4
|
-
import flatmapTreeData from "../static/FlatmapTreeData.json";
|
|
5
|
-
import scaffoldTreeData from "../static/ScaffoldTreeData.json";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* DrawToolbar
|
|
9
|
-
*/
|
|
10
|
-
const flatmapToolbarOptions = [
|
|
11
|
-
"Edit",
|
|
12
|
-
"Delete",
|
|
13
|
-
"Point",
|
|
14
|
-
"LineString",
|
|
15
|
-
"Polygon",
|
|
16
|
-
"Connection",
|
|
17
|
-
];
|
|
18
|
-
const scaffoldToolbarOptions = ["Edit", "Delete", "Point", "LineString"];
|
|
19
|
-
const activeDrawTool = ref(undefined);
|
|
20
|
-
const activeDrawMode = ref(undefined);
|
|
21
|
-
const hoverVisibilities = [
|
|
22
|
-
{ value: false, refs: "toolbarPopover", ref: "editPopover" },
|
|
23
|
-
{ value: false, refs: "toolbarPopover", ref: "deletePopover" },
|
|
24
|
-
{ value: false, refs: "toolbarPopover", ref: "pointPopover" },
|
|
25
|
-
{ value: false, refs: "toolbarPopover", ref: "lineStringPopover" },
|
|
26
|
-
{ value: false, refs: "toolbarPopover", ref: "polygonPopover" },
|
|
27
|
-
{ value: false, refs: "toolbarPopover", ref: "connectionPopover" },
|
|
28
|
-
];
|
|
29
|
-
const isFlatmap = ref(true);
|
|
30
|
-
const appRef = ref(null);
|
|
31
|
-
const newlyDrawnEntry = ref({});
|
|
32
|
-
const connectionEntry = ref({});
|
|
33
|
-
const drawnType = ref("All tools");
|
|
34
|
-
const drawnTypes = [
|
|
35
|
-
{ value: "All tools", label: "All tools" },
|
|
36
|
-
{ value: "Point", label: "Point" },
|
|
37
|
-
{ value: "LineString", label: "LineString" },
|
|
38
|
-
{ value: "Polygon", label: "Polygon" },
|
|
39
|
-
{ value: "None", label: "None" },
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
onMounted(() => {
|
|
43
|
-
console.log("🚀 ~ onMounted ~ appRef:", appRef.value);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
watch(drawnType, () => {
|
|
47
|
-
finaliseNewDrawn();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
function toolbarEvent(type, name) {
|
|
51
|
-
console.log("🚀 ~ toolbarEvent ~ type, name:", type, name);
|
|
52
|
-
connectionEntry.value = {};
|
|
53
|
-
if (type === "mode") {
|
|
54
|
-
activeDrawMode.value = name;
|
|
55
|
-
} else if (type === "tool") {
|
|
56
|
-
activeDrawTool.value = name;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function startNewDrawn(type) {
|
|
60
|
-
activeDrawTool.value = type;
|
|
61
|
-
newlyDrawnEntry.value = {};
|
|
62
|
-
connectionEntry.value = {};
|
|
63
|
-
}
|
|
64
|
-
function finishNewDrawn() {
|
|
65
|
-
newlyDrawnEntry.value = {
|
|
66
|
-
id: 1,
|
|
67
|
-
value: "newly drawn entry",
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
function addConnection() {
|
|
71
|
-
connectionEntry.value = {
|
|
72
|
-
" 1026": {
|
|
73
|
-
id: 1026,
|
|
74
|
-
label: "body proper",
|
|
75
|
-
models: "UBERON:0013702",
|
|
76
|
-
},
|
|
77
|
-
" 4958": {
|
|
78
|
-
id: 4958,
|
|
79
|
-
label: "liver",
|
|
80
|
-
models: "UBERON:0002107",
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
function removeConnection() {
|
|
85
|
-
connectionEntry.value = {};
|
|
86
|
-
}
|
|
87
|
-
function featureTooltip(value) {
|
|
88
|
-
console.log("🚀 ~ featureTooltip ~ value:", value);
|
|
89
|
-
}
|
|
90
|
-
function finaliseNewDrawn() {
|
|
91
|
-
activeDrawTool.value = undefined;
|
|
92
|
-
newlyDrawnEntry.value = {};
|
|
93
|
-
connectionEntry.value = {};
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* HelpModeDialog
|
|
97
|
-
*/
|
|
98
|
-
const helpMode = ref(false);
|
|
99
|
-
const helpModeActiveItem = ref(0);
|
|
100
|
-
const helpModeLastItem = ref(false);
|
|
101
|
-
const useHelpModeDialog = ref(false);
|
|
102
|
-
|
|
103
|
-
function showHelpModeDialog() {
|
|
104
|
-
helpMode.value = true;
|
|
105
|
-
useHelpModeDialog.value = true;
|
|
106
|
-
}
|
|
107
|
-
function onHelpModeShowNext() {
|
|
108
|
-
helpModeActiveItem.value += 1;
|
|
109
|
-
console.log(
|
|
110
|
-
"🚀 ~ onHelpModeShowNext ~ helpModeActiveItem:",
|
|
111
|
-
helpModeActiveItem.value
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
function onFinishHelpMode() {
|
|
115
|
-
helpMode.value = false;
|
|
116
|
-
// reset help mode to default values
|
|
117
|
-
helpModeActiveItem.value = 0;
|
|
118
|
-
helpModeLastItem.value = false;
|
|
119
|
-
}
|
|
120
|
-
function onActionClick(value) {
|
|
121
|
-
console.log("🚀 ~ onActionClick ~ value:", value);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Tooltip
|
|
126
|
-
*/
|
|
127
|
-
const tooltipDisplay = ref(false);
|
|
128
|
-
const tooltipEntry = ref({});
|
|
129
|
-
const featuresAlert = ref(undefined);
|
|
130
|
-
const annotationDisplay = ref(false);
|
|
131
|
-
const annotationEntry = ref({});
|
|
132
|
-
|
|
133
|
-
provide(/* key */ "getFeaturesAlert", /* value */ () => featuresAlert.value);
|
|
134
|
-
provide(/* key */ "$annotator", /* value */ undefined);
|
|
135
|
-
provide(/* key */ "userApiKey", /* value */ undefined);
|
|
136
|
-
|
|
137
|
-
function addTooltipEntry() {
|
|
138
|
-
tooltipDisplay.value = true;
|
|
139
|
-
tooltipEntry.value = {
|
|
140
|
-
destinations: [null],
|
|
141
|
-
origins: [null],
|
|
142
|
-
components: ["pudendal nerve"],
|
|
143
|
-
destinationsWithDatasets: [
|
|
144
|
-
{ id: "UBERON:0004917", name: "urethral sphincter" },
|
|
145
|
-
],
|
|
146
|
-
originsWithDatasets: [
|
|
147
|
-
{ id: "UBERON:0022278", name: "nucleus of pudendal nerve" },
|
|
148
|
-
],
|
|
149
|
-
componentsWithDatasets: [{ id: "UBERON:0011390", name: "pudendal nerve" }],
|
|
150
|
-
title:
|
|
151
|
-
"Nucleus of the pudendal nerve to urethral sphincter via pudendal nerve",
|
|
152
|
-
featureId: ["ilxtr:sparc-nlp/mmset1/1"],
|
|
153
|
-
hyperlinks: [
|
|
154
|
-
{
|
|
155
|
-
url: "https://pubmed.ncbi.nlm.nih.gov/?term=%2F%2Fdoi.org%2F10.1155%252F2012%252F816274",
|
|
156
|
-
id: "pubmed",
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
provenanceTaxonomy: ["NCBITaxon:9606"],
|
|
160
|
-
provenanceTaxonomyLabel: ["Homo sapiens"],
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
function removeTooltipEntry() {
|
|
164
|
-
tooltipDisplay.value = false;
|
|
165
|
-
tooltipEntry.value = {};
|
|
166
|
-
}
|
|
167
|
-
function addAnnotationEntry() {
|
|
168
|
-
tooltipDisplay.value = true;
|
|
169
|
-
annotationDisplay.value = true;
|
|
170
|
-
annotationEntry.value = {
|
|
171
|
-
id: "digestive_8-1",
|
|
172
|
-
featureId: 4958,
|
|
173
|
-
label: "liver",
|
|
174
|
-
models: "UBERON:0002107",
|
|
175
|
-
type: "feature",
|
|
176
|
-
mapUUID: "b650201e-f27a-54a1-84fc-6ec2e7cf4c15",
|
|
177
|
-
resourceId:
|
|
178
|
-
"https://mapcore-demo.org/devel/flatmap/v4/flatmap/b650201e-f27a-54a1-84fc-6ec2e7cf4c15",
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function removeAnnotationEntry() {
|
|
182
|
-
tooltipDisplay.value = false;
|
|
183
|
-
annotationDisplay.value = false;
|
|
184
|
-
annotationEntry.value = {};
|
|
185
|
-
}
|
|
186
|
-
function commitAnnotationEvent(value) {
|
|
187
|
-
console.log("🚀 ~ commitAnnotationEvent ~ value:", value);
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* TreeControls
|
|
191
|
-
*/
|
|
192
|
-
const isReady = ref(true);
|
|
193
|
-
const mapType = ref("flatmap");
|
|
194
|
-
const flatmapTreeDataEntry = flatmapTreeData;
|
|
195
|
-
const scaffoldTreeDataEntry = scaffoldTreeData[0].children;
|
|
196
|
-
const treeDataEntry = ref(flatmapTreeDataEntry);
|
|
197
|
-
|
|
198
|
-
function switchTreeEntry(value) {
|
|
199
|
-
isReady.value = false;
|
|
200
|
-
if (value === "flatmap") {
|
|
201
|
-
mapType.value = "flatmap";
|
|
202
|
-
treeDataEntry.value = flatmapTreeDataEntry;
|
|
203
|
-
} else if (value === "scaffold") {
|
|
204
|
-
mapType.value = "scaffold";
|
|
205
|
-
treeDataEntry.value = scaffoldTreeDataEntry;
|
|
206
|
-
}
|
|
207
|
-
isReady.value = true;
|
|
208
|
-
}
|
|
209
|
-
function setColourField(treeData, nodeData, activeColour) {
|
|
210
|
-
treeData
|
|
211
|
-
.filter((data) => {
|
|
212
|
-
// Filtering if single node is provided and it does not have children field
|
|
213
|
-
if (nodeData && !data.children) {
|
|
214
|
-
return data.id === nodeData.id;
|
|
215
|
-
} else {
|
|
216
|
-
return true;
|
|
217
|
-
}
|
|
218
|
-
})
|
|
219
|
-
.map((data) => {
|
|
220
|
-
if (data.children) {
|
|
221
|
-
// Using recursive to process nested data if children field exists
|
|
222
|
-
setColourField(data.children, nodeData, activeColour);
|
|
223
|
-
} else {
|
|
224
|
-
// Active colour used for current display
|
|
225
|
-
data["activeColour"] = activeColour;
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
function setColour(nodeData, value) {
|
|
230
|
-
if (nodeData && nodeData.isPrimitives) {
|
|
231
|
-
const activeColour = value ? value : nodeData.defaultColour;
|
|
232
|
-
setColourField(treeDataEntry.value, nodeData, activeColour)
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
function checkAll(value) {
|
|
236
|
-
console.log("🚀 ~ checkAll ~ value:", value);
|
|
237
|
-
}
|
|
238
|
-
function checkChanged(value) {
|
|
239
|
-
console.log("🚀 ~ checkChanged ~ value:", value);
|
|
240
|
-
}
|
|
241
|
-
function changeActive(value) {
|
|
242
|
-
console.log("🚀 ~ changeActive ~ value:", value);
|
|
243
|
-
}
|
|
244
|
-
function changeHover(value) {
|
|
245
|
-
console.log("🚀 ~ changeHover ~ value:", value);
|
|
246
|
-
}
|
|
247
|
-
</script>
|
|
248
|
-
|
|
249
|
-
<template>
|
|
250
|
-
<div ref="appRef">
|
|
251
|
-
<div class="maplibregl-canvas"></div>
|
|
252
|
-
<el-row>
|
|
253
|
-
<el-col>
|
|
254
|
-
<h3>DrawToolbar</h3>
|
|
255
|
-
</el-col>
|
|
256
|
-
<el-col>
|
|
257
|
-
<el-switch
|
|
258
|
-
v-model="isFlatmap"
|
|
259
|
-
active-text="Flatmap"
|
|
260
|
-
inactive-text="Scaffold"
|
|
261
|
-
/>
|
|
262
|
-
</el-col>
|
|
263
|
-
</el-row>
|
|
264
|
-
<el-row v-show="isFlatmap">
|
|
265
|
-
<el-col>
|
|
266
|
-
<el-select
|
|
267
|
-
v-model="drawnType"
|
|
268
|
-
placeholder="Select"
|
|
269
|
-
style="width: 120px"
|
|
270
|
-
>
|
|
271
|
-
<el-option
|
|
272
|
-
v-for="item in drawnTypes"
|
|
273
|
-
:key="item.value"
|
|
274
|
-
:label="item.label"
|
|
275
|
-
:value="item.value"
|
|
276
|
-
/>
|
|
277
|
-
</el-select>
|
|
278
|
-
</el-col>
|
|
279
|
-
<el-col>
|
|
280
|
-
<el-button
|
|
281
|
-
v-show="
|
|
282
|
-
(!activeDrawTool || activeDrawTool === 'Point') &&
|
|
283
|
-
(drawnType === 'All tools' ||
|
|
284
|
-
drawnType === 'Point' ||
|
|
285
|
-
drawnType === 'None')
|
|
286
|
-
"
|
|
287
|
-
@click="startNewDrawn('Point')"
|
|
288
|
-
size="small"
|
|
289
|
-
>
|
|
290
|
-
Draw New Point
|
|
291
|
-
</el-button>
|
|
292
|
-
<el-button
|
|
293
|
-
v-show="
|
|
294
|
-
(!activeDrawTool || activeDrawTool === 'LineString') &&
|
|
295
|
-
(drawnType === 'All tools' ||
|
|
296
|
-
drawnType === 'LineString' ||
|
|
297
|
-
drawnType === 'None')
|
|
298
|
-
"
|
|
299
|
-
@click="startNewDrawn('LineString')"
|
|
300
|
-
size="small"
|
|
301
|
-
>
|
|
302
|
-
Draw New LineString
|
|
303
|
-
</el-button>
|
|
304
|
-
<el-button
|
|
305
|
-
v-show="
|
|
306
|
-
(!activeDrawTool || activeDrawTool === 'Polygon') &&
|
|
307
|
-
(drawnType === 'All tools' ||
|
|
308
|
-
drawnType === 'Polygon' ||
|
|
309
|
-
drawnType === 'None')
|
|
310
|
-
"
|
|
311
|
-
@click="startNewDrawn('Polygon')"
|
|
312
|
-
size="small"
|
|
313
|
-
>
|
|
314
|
-
Draw New Polygon
|
|
315
|
-
</el-button>
|
|
316
|
-
<el-button v-show="activeDrawTool" @click="finishNewDrawn" size="small">
|
|
317
|
-
Finish New Drawn
|
|
318
|
-
</el-button>
|
|
319
|
-
<el-button
|
|
320
|
-
v-show="Object.keys(newlyDrawnEntry).length > 0"
|
|
321
|
-
@click="finaliseNewDrawn"
|
|
322
|
-
size="small"
|
|
323
|
-
>
|
|
324
|
-
Finalise New Drawn
|
|
325
|
-
</el-button>
|
|
326
|
-
</el-col>
|
|
327
|
-
<el-col>
|
|
328
|
-
<el-button
|
|
329
|
-
v-show="
|
|
330
|
-
!Object.keys(connectionEntry).length > 0 &&
|
|
331
|
-
(!activeDrawTool || activeDrawTool === 'LineString') &&
|
|
332
|
-
(drawnType === 'All tools' ||
|
|
333
|
-
drawnType === 'LineString' ||
|
|
334
|
-
drawnType === 'None')
|
|
335
|
-
"
|
|
336
|
-
@click="addConnection"
|
|
337
|
-
size="small"
|
|
338
|
-
>
|
|
339
|
-
Add Connection
|
|
340
|
-
</el-button>
|
|
341
|
-
<el-button
|
|
342
|
-
v-show="Object.keys(connectionEntry).length > 0"
|
|
343
|
-
@click="removeConnection"
|
|
344
|
-
size="small"
|
|
345
|
-
>
|
|
346
|
-
Remove Connection
|
|
347
|
-
</el-button>
|
|
348
|
-
</el-col>
|
|
349
|
-
</el-row>
|
|
350
|
-
<el-row>
|
|
351
|
-
<el-col>
|
|
352
|
-
<h3>HelpModeDialog</h3>
|
|
353
|
-
<span v-show="helpMode && useHelpModeDialog"
|
|
354
|
-
>Current item: {{ helpModeActiveItem }}</span
|
|
355
|
-
>
|
|
356
|
-
</el-col>
|
|
357
|
-
<el-col>
|
|
358
|
-
<el-button @click="showHelpModeDialog" size="small">
|
|
359
|
-
Show HelpMode Dialog
|
|
360
|
-
</el-button>
|
|
361
|
-
<el-button
|
|
362
|
-
v-show="helpMode && useHelpModeDialog"
|
|
363
|
-
@click="onHelpModeShowNext"
|
|
364
|
-
size="small"
|
|
365
|
-
>
|
|
366
|
-
Show Next
|
|
367
|
-
</el-button>
|
|
368
|
-
<el-button
|
|
369
|
-
v-show="helpMode && useHelpModeDialog"
|
|
370
|
-
@click="onFinishHelpMode"
|
|
371
|
-
size="small"
|
|
372
|
-
>
|
|
373
|
-
Hide HelpMode Dialog
|
|
374
|
-
</el-button>
|
|
375
|
-
</el-col>
|
|
376
|
-
</el-row>
|
|
377
|
-
<el-row>
|
|
378
|
-
<el-col>
|
|
379
|
-
<h3>Tooltip</h3>
|
|
380
|
-
</el-col>
|
|
381
|
-
<el-col>
|
|
382
|
-
<el-button
|
|
383
|
-
v-show="!annotationDisplay"
|
|
384
|
-
@click="addTooltipEntry"
|
|
385
|
-
size="small"
|
|
386
|
-
>
|
|
387
|
-
Add Tooltip Entry
|
|
388
|
-
</el-button>
|
|
389
|
-
<el-button
|
|
390
|
-
v-show="Object.keys(tooltipEntry).length > 0"
|
|
391
|
-
@click="removeTooltipEntry"
|
|
392
|
-
size="small"
|
|
393
|
-
>
|
|
394
|
-
Remove Tooltip Entry
|
|
395
|
-
</el-button>
|
|
396
|
-
<el-button
|
|
397
|
-
v-show="!Object.keys(tooltipEntry).length > 0"
|
|
398
|
-
@click="addAnnotationEntry"
|
|
399
|
-
size="small"
|
|
400
|
-
>
|
|
401
|
-
Add Annotation Entry
|
|
402
|
-
</el-button>
|
|
403
|
-
<el-button
|
|
404
|
-
v-show="Object.keys(annotationEntry).length > 0"
|
|
405
|
-
@click="removeAnnotationEntry"
|
|
406
|
-
size="small"
|
|
407
|
-
>
|
|
408
|
-
Remove Annotation Entry
|
|
409
|
-
</el-button>
|
|
410
|
-
</el-col>
|
|
411
|
-
</el-row>
|
|
412
|
-
<el-row>
|
|
413
|
-
<el-col>
|
|
414
|
-
<h3>TreeControls - {{ mapType }}</h3>
|
|
415
|
-
</el-col>
|
|
416
|
-
<el-col>
|
|
417
|
-
<el-button v-show="mapType==='scaffold'" @click="switchTreeEntry('flatmap')" size="small">
|
|
418
|
-
Display Flatmap Tree
|
|
419
|
-
</el-button>
|
|
420
|
-
<el-button v-show="mapType==='flatmap'" @click="switchTreeEntry('scaffold')" size="small">
|
|
421
|
-
Display Scaffold Tree
|
|
422
|
-
</el-button>
|
|
423
|
-
</el-col>
|
|
424
|
-
</el-row>
|
|
425
|
-
|
|
426
|
-
<DrawToolbar
|
|
427
|
-
v-show="isFlatmap"
|
|
428
|
-
:mapCanvas="{
|
|
429
|
-
containerHTML: appRef,
|
|
430
|
-
class: '.maplibregl-canvas',
|
|
431
|
-
}"
|
|
432
|
-
:toolbarOptions="flatmapToolbarOptions"
|
|
433
|
-
:drawnType="drawnType"
|
|
434
|
-
:activeDrawTool="activeDrawTool"
|
|
435
|
-
:activeDrawMode="activeDrawMode"
|
|
436
|
-
:newlyDrawnEntry="newlyDrawnEntry"
|
|
437
|
-
:connectionEntry="connectionEntry"
|
|
438
|
-
:hoverVisibilities="hoverVisibilities"
|
|
439
|
-
@clickToolbar="toolbarEvent"
|
|
440
|
-
@featureTooltip="featureTooltip"
|
|
441
|
-
@confirmDrawn="finaliseNewDrawn"
|
|
442
|
-
@cancelDrawn="finaliseNewDrawn"
|
|
443
|
-
ref="toolbarPopover"
|
|
444
|
-
/>
|
|
445
|
-
<DrawToolbar
|
|
446
|
-
v-show="!isFlatmap"
|
|
447
|
-
:toolbarOptions="scaffoldToolbarOptions"
|
|
448
|
-
:activeDrawTool="activeDrawTool"
|
|
449
|
-
:activeDrawMode="activeDrawMode"
|
|
450
|
-
:hoverVisibilities="hoverVisibilities"
|
|
451
|
-
@clickToolbar="toolbarEvent"
|
|
452
|
-
ref="toolbarPopover"
|
|
453
|
-
/>
|
|
454
|
-
<HelpModeDialog
|
|
455
|
-
v-show="helpMode && useHelpModeDialog"
|
|
456
|
-
class="help-mode-dialog"
|
|
457
|
-
:lastItem="helpModeLastItem"
|
|
458
|
-
@show-next="onHelpModeShowNext"
|
|
459
|
-
@finish-help-mode="onFinishHelpMode"
|
|
460
|
-
/>
|
|
461
|
-
<Tooltip
|
|
462
|
-
v-show="tooltipDisplay"
|
|
463
|
-
class="tooltip"
|
|
464
|
-
:tooltipEntry="tooltipEntry"
|
|
465
|
-
:annotationDisplay="annotationDisplay"
|
|
466
|
-
:annotationEntry="annotationEntry"
|
|
467
|
-
@annotation="commitAnnotationEvent"
|
|
468
|
-
@onActionClick="onActionClick"
|
|
469
|
-
/>
|
|
470
|
-
<TreeControls
|
|
471
|
-
v-show="mapType === 'flatmap'"
|
|
472
|
-
mapType="flatmap"
|
|
473
|
-
title="Systems"
|
|
474
|
-
:treeData="treeDataEntry"
|
|
475
|
-
active=""
|
|
476
|
-
hover=""
|
|
477
|
-
@checkAll="checkAll"
|
|
478
|
-
@checkChanged="checkChanged"
|
|
479
|
-
@changeActive="changeActive"
|
|
480
|
-
@changeHover="changeHover"
|
|
481
|
-
/>
|
|
482
|
-
<TreeControls
|
|
483
|
-
v-show="mapType === 'scaffold'"
|
|
484
|
-
mapType="scaffold"
|
|
485
|
-
title="Regions"
|
|
486
|
-
:isReady="isReady"
|
|
487
|
-
:treeData="treeDataEntry"
|
|
488
|
-
:active="[]"
|
|
489
|
-
:hover="[]"
|
|
490
|
-
:showColourPicker="true"
|
|
491
|
-
@setColour="setColour"
|
|
492
|
-
@checkChanged="checkChanged"
|
|
493
|
-
/>
|
|
494
|
-
</div>
|
|
495
|
-
</template>
|
|
496
|
-
|
|
497
|
-
<style scoped>
|
|
498
|
-
.options-container {
|
|
499
|
-
text-align: center;
|
|
500
|
-
}
|
|
501
|
-
.help-mode-dialog {
|
|
502
|
-
position: absolute;
|
|
503
|
-
top: 50%;
|
|
504
|
-
}
|
|
505
|
-
.tooltip {
|
|
506
|
-
width: 400px;
|
|
507
|
-
position: absolute;
|
|
508
|
-
top: calc(50% - 100px);
|
|
509
|
-
left: calc(50% - 200px);
|
|
510
|
-
}
|
|
511
|
-
</style>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, provide, onMounted, watch } from "vue";
|
|
3
|
+
|
|
4
|
+
import flatmapTreeData from "../static/FlatmapTreeData.json";
|
|
5
|
+
import scaffoldTreeData from "../static/ScaffoldTreeData.json";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* DrawToolbar
|
|
9
|
+
*/
|
|
10
|
+
const flatmapToolbarOptions = [
|
|
11
|
+
"Edit",
|
|
12
|
+
"Delete",
|
|
13
|
+
"Point",
|
|
14
|
+
"LineString",
|
|
15
|
+
"Polygon",
|
|
16
|
+
"Connection",
|
|
17
|
+
];
|
|
18
|
+
const scaffoldToolbarOptions = ["Edit", "Delete", "Point", "LineString"];
|
|
19
|
+
const activeDrawTool = ref(undefined);
|
|
20
|
+
const activeDrawMode = ref(undefined);
|
|
21
|
+
const hoverVisibilities = [
|
|
22
|
+
{ value: false, refs: "toolbarPopover", ref: "editPopover" },
|
|
23
|
+
{ value: false, refs: "toolbarPopover", ref: "deletePopover" },
|
|
24
|
+
{ value: false, refs: "toolbarPopover", ref: "pointPopover" },
|
|
25
|
+
{ value: false, refs: "toolbarPopover", ref: "lineStringPopover" },
|
|
26
|
+
{ value: false, refs: "toolbarPopover", ref: "polygonPopover" },
|
|
27
|
+
{ value: false, refs: "toolbarPopover", ref: "connectionPopover" },
|
|
28
|
+
];
|
|
29
|
+
const isFlatmap = ref(true);
|
|
30
|
+
const appRef = ref(null);
|
|
31
|
+
const newlyDrawnEntry = ref({});
|
|
32
|
+
const connectionEntry = ref({});
|
|
33
|
+
const drawnType = ref("All tools");
|
|
34
|
+
const drawnTypes = [
|
|
35
|
+
{ value: "All tools", label: "All tools" },
|
|
36
|
+
{ value: "Point", label: "Point" },
|
|
37
|
+
{ value: "LineString", label: "LineString" },
|
|
38
|
+
{ value: "Polygon", label: "Polygon" },
|
|
39
|
+
{ value: "None", label: "None" },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
onMounted(() => {
|
|
43
|
+
console.log("🚀 ~ onMounted ~ appRef:", appRef.value);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
watch(drawnType, () => {
|
|
47
|
+
finaliseNewDrawn();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
function toolbarEvent(type, name) {
|
|
51
|
+
console.log("🚀 ~ toolbarEvent ~ type, name:", type, name);
|
|
52
|
+
connectionEntry.value = {};
|
|
53
|
+
if (type === "mode") {
|
|
54
|
+
activeDrawMode.value = name;
|
|
55
|
+
} else if (type === "tool") {
|
|
56
|
+
activeDrawTool.value = name;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function startNewDrawn(type) {
|
|
60
|
+
activeDrawTool.value = type;
|
|
61
|
+
newlyDrawnEntry.value = {};
|
|
62
|
+
connectionEntry.value = {};
|
|
63
|
+
}
|
|
64
|
+
function finishNewDrawn() {
|
|
65
|
+
newlyDrawnEntry.value = {
|
|
66
|
+
id: 1,
|
|
67
|
+
value: "newly drawn entry",
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function addConnection() {
|
|
71
|
+
connectionEntry.value = {
|
|
72
|
+
" 1026": {
|
|
73
|
+
id: 1026,
|
|
74
|
+
label: "body proper",
|
|
75
|
+
models: "UBERON:0013702",
|
|
76
|
+
},
|
|
77
|
+
" 4958": {
|
|
78
|
+
id: 4958,
|
|
79
|
+
label: "liver",
|
|
80
|
+
models: "UBERON:0002107",
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function removeConnection() {
|
|
85
|
+
connectionEntry.value = {};
|
|
86
|
+
}
|
|
87
|
+
function featureTooltip(value) {
|
|
88
|
+
console.log("🚀 ~ featureTooltip ~ value:", value);
|
|
89
|
+
}
|
|
90
|
+
function finaliseNewDrawn() {
|
|
91
|
+
activeDrawTool.value = undefined;
|
|
92
|
+
newlyDrawnEntry.value = {};
|
|
93
|
+
connectionEntry.value = {};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* HelpModeDialog
|
|
97
|
+
*/
|
|
98
|
+
const helpMode = ref(false);
|
|
99
|
+
const helpModeActiveItem = ref(0);
|
|
100
|
+
const helpModeLastItem = ref(false);
|
|
101
|
+
const useHelpModeDialog = ref(false);
|
|
102
|
+
|
|
103
|
+
function showHelpModeDialog() {
|
|
104
|
+
helpMode.value = true;
|
|
105
|
+
useHelpModeDialog.value = true;
|
|
106
|
+
}
|
|
107
|
+
function onHelpModeShowNext() {
|
|
108
|
+
helpModeActiveItem.value += 1;
|
|
109
|
+
console.log(
|
|
110
|
+
"🚀 ~ onHelpModeShowNext ~ helpModeActiveItem:",
|
|
111
|
+
helpModeActiveItem.value
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function onFinishHelpMode() {
|
|
115
|
+
helpMode.value = false;
|
|
116
|
+
// reset help mode to default values
|
|
117
|
+
helpModeActiveItem.value = 0;
|
|
118
|
+
helpModeLastItem.value = false;
|
|
119
|
+
}
|
|
120
|
+
function onActionClick(value) {
|
|
121
|
+
console.log("🚀 ~ onActionClick ~ value:", value);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Tooltip
|
|
126
|
+
*/
|
|
127
|
+
const tooltipDisplay = ref(false);
|
|
128
|
+
const tooltipEntry = ref({});
|
|
129
|
+
const featuresAlert = ref(undefined);
|
|
130
|
+
const annotationDisplay = ref(false);
|
|
131
|
+
const annotationEntry = ref({});
|
|
132
|
+
|
|
133
|
+
provide(/* key */ "getFeaturesAlert", /* value */ () => featuresAlert.value);
|
|
134
|
+
provide(/* key */ "$annotator", /* value */ undefined);
|
|
135
|
+
provide(/* key */ "userApiKey", /* value */ undefined);
|
|
136
|
+
|
|
137
|
+
function addTooltipEntry() {
|
|
138
|
+
tooltipDisplay.value = true;
|
|
139
|
+
tooltipEntry.value = {
|
|
140
|
+
destinations: [null],
|
|
141
|
+
origins: [null],
|
|
142
|
+
components: ["pudendal nerve"],
|
|
143
|
+
destinationsWithDatasets: [
|
|
144
|
+
{ id: "UBERON:0004917", name: "urethral sphincter" },
|
|
145
|
+
],
|
|
146
|
+
originsWithDatasets: [
|
|
147
|
+
{ id: "UBERON:0022278", name: "nucleus of pudendal nerve" },
|
|
148
|
+
],
|
|
149
|
+
componentsWithDatasets: [{ id: "UBERON:0011390", name: "pudendal nerve" }],
|
|
150
|
+
title:
|
|
151
|
+
"Nucleus of the pudendal nerve to urethral sphincter via pudendal nerve",
|
|
152
|
+
featureId: ["ilxtr:sparc-nlp/mmset1/1"],
|
|
153
|
+
hyperlinks: [
|
|
154
|
+
{
|
|
155
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/?term=%2F%2Fdoi.org%2F10.1155%252F2012%252F816274",
|
|
156
|
+
id: "pubmed",
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
provenanceTaxonomy: ["NCBITaxon:9606"],
|
|
160
|
+
provenanceTaxonomyLabel: ["Homo sapiens"],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function removeTooltipEntry() {
|
|
164
|
+
tooltipDisplay.value = false;
|
|
165
|
+
tooltipEntry.value = {};
|
|
166
|
+
}
|
|
167
|
+
function addAnnotationEntry() {
|
|
168
|
+
tooltipDisplay.value = true;
|
|
169
|
+
annotationDisplay.value = true;
|
|
170
|
+
annotationEntry.value = {
|
|
171
|
+
id: "digestive_8-1",
|
|
172
|
+
featureId: 4958,
|
|
173
|
+
label: "liver",
|
|
174
|
+
models: "UBERON:0002107",
|
|
175
|
+
type: "feature",
|
|
176
|
+
mapUUID: "b650201e-f27a-54a1-84fc-6ec2e7cf4c15",
|
|
177
|
+
resourceId:
|
|
178
|
+
"https://mapcore-demo.org/devel/flatmap/v4/flatmap/b650201e-f27a-54a1-84fc-6ec2e7cf4c15",
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function removeAnnotationEntry() {
|
|
182
|
+
tooltipDisplay.value = false;
|
|
183
|
+
annotationDisplay.value = false;
|
|
184
|
+
annotationEntry.value = {};
|
|
185
|
+
}
|
|
186
|
+
function commitAnnotationEvent(value) {
|
|
187
|
+
console.log("🚀 ~ commitAnnotationEvent ~ value:", value);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* TreeControls
|
|
191
|
+
*/
|
|
192
|
+
const isReady = ref(true);
|
|
193
|
+
const mapType = ref("flatmap");
|
|
194
|
+
const flatmapTreeDataEntry = flatmapTreeData;
|
|
195
|
+
const scaffoldTreeDataEntry = scaffoldTreeData[0].children;
|
|
196
|
+
const treeDataEntry = ref(flatmapTreeDataEntry);
|
|
197
|
+
|
|
198
|
+
function switchTreeEntry(value) {
|
|
199
|
+
isReady.value = false;
|
|
200
|
+
if (value === "flatmap") {
|
|
201
|
+
mapType.value = "flatmap";
|
|
202
|
+
treeDataEntry.value = flatmapTreeDataEntry;
|
|
203
|
+
} else if (value === "scaffold") {
|
|
204
|
+
mapType.value = "scaffold";
|
|
205
|
+
treeDataEntry.value = scaffoldTreeDataEntry;
|
|
206
|
+
}
|
|
207
|
+
isReady.value = true;
|
|
208
|
+
}
|
|
209
|
+
function setColourField(treeData, nodeData, activeColour) {
|
|
210
|
+
treeData
|
|
211
|
+
.filter((data) => {
|
|
212
|
+
// Filtering if single node is provided and it does not have children field
|
|
213
|
+
if (nodeData && !data.children) {
|
|
214
|
+
return data.id === nodeData.id;
|
|
215
|
+
} else {
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
})
|
|
219
|
+
.map((data) => {
|
|
220
|
+
if (data.children) {
|
|
221
|
+
// Using recursive to process nested data if children field exists
|
|
222
|
+
setColourField(data.children, nodeData, activeColour);
|
|
223
|
+
} else {
|
|
224
|
+
// Active colour used for current display
|
|
225
|
+
data["activeColour"] = activeColour;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function setColour(nodeData, value) {
|
|
230
|
+
if (nodeData && nodeData.isPrimitives) {
|
|
231
|
+
const activeColour = value ? value : nodeData.defaultColour;
|
|
232
|
+
setColourField(treeDataEntry.value, nodeData, activeColour)
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function checkAll(value) {
|
|
236
|
+
console.log("🚀 ~ checkAll ~ value:", value);
|
|
237
|
+
}
|
|
238
|
+
function checkChanged(value) {
|
|
239
|
+
console.log("🚀 ~ checkChanged ~ value:", value);
|
|
240
|
+
}
|
|
241
|
+
function changeActive(value) {
|
|
242
|
+
console.log("🚀 ~ changeActive ~ value:", value);
|
|
243
|
+
}
|
|
244
|
+
function changeHover(value) {
|
|
245
|
+
console.log("🚀 ~ changeHover ~ value:", value);
|
|
246
|
+
}
|
|
247
|
+
</script>
|
|
248
|
+
|
|
249
|
+
<template>
|
|
250
|
+
<div ref="appRef">
|
|
251
|
+
<div class="maplibregl-canvas"></div>
|
|
252
|
+
<el-row>
|
|
253
|
+
<el-col>
|
|
254
|
+
<h3>DrawToolbar</h3>
|
|
255
|
+
</el-col>
|
|
256
|
+
<el-col>
|
|
257
|
+
<el-switch
|
|
258
|
+
v-model="isFlatmap"
|
|
259
|
+
active-text="Flatmap"
|
|
260
|
+
inactive-text="Scaffold"
|
|
261
|
+
/>
|
|
262
|
+
</el-col>
|
|
263
|
+
</el-row>
|
|
264
|
+
<el-row v-show="isFlatmap">
|
|
265
|
+
<el-col>
|
|
266
|
+
<el-select
|
|
267
|
+
v-model="drawnType"
|
|
268
|
+
placeholder="Select"
|
|
269
|
+
style="width: 120px"
|
|
270
|
+
>
|
|
271
|
+
<el-option
|
|
272
|
+
v-for="item in drawnTypes"
|
|
273
|
+
:key="item.value"
|
|
274
|
+
:label="item.label"
|
|
275
|
+
:value="item.value"
|
|
276
|
+
/>
|
|
277
|
+
</el-select>
|
|
278
|
+
</el-col>
|
|
279
|
+
<el-col>
|
|
280
|
+
<el-button
|
|
281
|
+
v-show="
|
|
282
|
+
(!activeDrawTool || activeDrawTool === 'Point') &&
|
|
283
|
+
(drawnType === 'All tools' ||
|
|
284
|
+
drawnType === 'Point' ||
|
|
285
|
+
drawnType === 'None')
|
|
286
|
+
"
|
|
287
|
+
@click="startNewDrawn('Point')"
|
|
288
|
+
size="small"
|
|
289
|
+
>
|
|
290
|
+
Draw New Point
|
|
291
|
+
</el-button>
|
|
292
|
+
<el-button
|
|
293
|
+
v-show="
|
|
294
|
+
(!activeDrawTool || activeDrawTool === 'LineString') &&
|
|
295
|
+
(drawnType === 'All tools' ||
|
|
296
|
+
drawnType === 'LineString' ||
|
|
297
|
+
drawnType === 'None')
|
|
298
|
+
"
|
|
299
|
+
@click="startNewDrawn('LineString')"
|
|
300
|
+
size="small"
|
|
301
|
+
>
|
|
302
|
+
Draw New LineString
|
|
303
|
+
</el-button>
|
|
304
|
+
<el-button
|
|
305
|
+
v-show="
|
|
306
|
+
(!activeDrawTool || activeDrawTool === 'Polygon') &&
|
|
307
|
+
(drawnType === 'All tools' ||
|
|
308
|
+
drawnType === 'Polygon' ||
|
|
309
|
+
drawnType === 'None')
|
|
310
|
+
"
|
|
311
|
+
@click="startNewDrawn('Polygon')"
|
|
312
|
+
size="small"
|
|
313
|
+
>
|
|
314
|
+
Draw New Polygon
|
|
315
|
+
</el-button>
|
|
316
|
+
<el-button v-show="activeDrawTool" @click="finishNewDrawn" size="small">
|
|
317
|
+
Finish New Drawn
|
|
318
|
+
</el-button>
|
|
319
|
+
<el-button
|
|
320
|
+
v-show="Object.keys(newlyDrawnEntry).length > 0"
|
|
321
|
+
@click="finaliseNewDrawn"
|
|
322
|
+
size="small"
|
|
323
|
+
>
|
|
324
|
+
Finalise New Drawn
|
|
325
|
+
</el-button>
|
|
326
|
+
</el-col>
|
|
327
|
+
<el-col>
|
|
328
|
+
<el-button
|
|
329
|
+
v-show="
|
|
330
|
+
!Object.keys(connectionEntry).length > 0 &&
|
|
331
|
+
(!activeDrawTool || activeDrawTool === 'LineString') &&
|
|
332
|
+
(drawnType === 'All tools' ||
|
|
333
|
+
drawnType === 'LineString' ||
|
|
334
|
+
drawnType === 'None')
|
|
335
|
+
"
|
|
336
|
+
@click="addConnection"
|
|
337
|
+
size="small"
|
|
338
|
+
>
|
|
339
|
+
Add Connection
|
|
340
|
+
</el-button>
|
|
341
|
+
<el-button
|
|
342
|
+
v-show="Object.keys(connectionEntry).length > 0"
|
|
343
|
+
@click="removeConnection"
|
|
344
|
+
size="small"
|
|
345
|
+
>
|
|
346
|
+
Remove Connection
|
|
347
|
+
</el-button>
|
|
348
|
+
</el-col>
|
|
349
|
+
</el-row>
|
|
350
|
+
<el-row>
|
|
351
|
+
<el-col>
|
|
352
|
+
<h3>HelpModeDialog</h3>
|
|
353
|
+
<span v-show="helpMode && useHelpModeDialog"
|
|
354
|
+
>Current item: {{ helpModeActiveItem }}</span
|
|
355
|
+
>
|
|
356
|
+
</el-col>
|
|
357
|
+
<el-col>
|
|
358
|
+
<el-button @click="showHelpModeDialog" size="small">
|
|
359
|
+
Show HelpMode Dialog
|
|
360
|
+
</el-button>
|
|
361
|
+
<el-button
|
|
362
|
+
v-show="helpMode && useHelpModeDialog"
|
|
363
|
+
@click="onHelpModeShowNext"
|
|
364
|
+
size="small"
|
|
365
|
+
>
|
|
366
|
+
Show Next
|
|
367
|
+
</el-button>
|
|
368
|
+
<el-button
|
|
369
|
+
v-show="helpMode && useHelpModeDialog"
|
|
370
|
+
@click="onFinishHelpMode"
|
|
371
|
+
size="small"
|
|
372
|
+
>
|
|
373
|
+
Hide HelpMode Dialog
|
|
374
|
+
</el-button>
|
|
375
|
+
</el-col>
|
|
376
|
+
</el-row>
|
|
377
|
+
<el-row>
|
|
378
|
+
<el-col>
|
|
379
|
+
<h3>Tooltip</h3>
|
|
380
|
+
</el-col>
|
|
381
|
+
<el-col>
|
|
382
|
+
<el-button
|
|
383
|
+
v-show="!annotationDisplay"
|
|
384
|
+
@click="addTooltipEntry"
|
|
385
|
+
size="small"
|
|
386
|
+
>
|
|
387
|
+
Add Tooltip Entry
|
|
388
|
+
</el-button>
|
|
389
|
+
<el-button
|
|
390
|
+
v-show="Object.keys(tooltipEntry).length > 0"
|
|
391
|
+
@click="removeTooltipEntry"
|
|
392
|
+
size="small"
|
|
393
|
+
>
|
|
394
|
+
Remove Tooltip Entry
|
|
395
|
+
</el-button>
|
|
396
|
+
<el-button
|
|
397
|
+
v-show="!Object.keys(tooltipEntry).length > 0"
|
|
398
|
+
@click="addAnnotationEntry"
|
|
399
|
+
size="small"
|
|
400
|
+
>
|
|
401
|
+
Add Annotation Entry
|
|
402
|
+
</el-button>
|
|
403
|
+
<el-button
|
|
404
|
+
v-show="Object.keys(annotationEntry).length > 0"
|
|
405
|
+
@click="removeAnnotationEntry"
|
|
406
|
+
size="small"
|
|
407
|
+
>
|
|
408
|
+
Remove Annotation Entry
|
|
409
|
+
</el-button>
|
|
410
|
+
</el-col>
|
|
411
|
+
</el-row>
|
|
412
|
+
<el-row>
|
|
413
|
+
<el-col>
|
|
414
|
+
<h3>TreeControls - {{ mapType }}</h3>
|
|
415
|
+
</el-col>
|
|
416
|
+
<el-col>
|
|
417
|
+
<el-button v-show="mapType==='scaffold'" @click="switchTreeEntry('flatmap')" size="small">
|
|
418
|
+
Display Flatmap Tree
|
|
419
|
+
</el-button>
|
|
420
|
+
<el-button v-show="mapType==='flatmap'" @click="switchTreeEntry('scaffold')" size="small">
|
|
421
|
+
Display Scaffold Tree
|
|
422
|
+
</el-button>
|
|
423
|
+
</el-col>
|
|
424
|
+
</el-row>
|
|
425
|
+
|
|
426
|
+
<DrawToolbar
|
|
427
|
+
v-show="isFlatmap"
|
|
428
|
+
:mapCanvas="{
|
|
429
|
+
containerHTML: appRef,
|
|
430
|
+
class: '.maplibregl-canvas',
|
|
431
|
+
}"
|
|
432
|
+
:toolbarOptions="flatmapToolbarOptions"
|
|
433
|
+
:drawnType="drawnType"
|
|
434
|
+
:activeDrawTool="activeDrawTool"
|
|
435
|
+
:activeDrawMode="activeDrawMode"
|
|
436
|
+
:newlyDrawnEntry="newlyDrawnEntry"
|
|
437
|
+
:connectionEntry="connectionEntry"
|
|
438
|
+
:hoverVisibilities="hoverVisibilities"
|
|
439
|
+
@clickToolbar="toolbarEvent"
|
|
440
|
+
@featureTooltip="featureTooltip"
|
|
441
|
+
@confirmDrawn="finaliseNewDrawn"
|
|
442
|
+
@cancelDrawn="finaliseNewDrawn"
|
|
443
|
+
ref="toolbarPopover"
|
|
444
|
+
/>
|
|
445
|
+
<DrawToolbar
|
|
446
|
+
v-show="!isFlatmap"
|
|
447
|
+
:toolbarOptions="scaffoldToolbarOptions"
|
|
448
|
+
:activeDrawTool="activeDrawTool"
|
|
449
|
+
:activeDrawMode="activeDrawMode"
|
|
450
|
+
:hoverVisibilities="hoverVisibilities"
|
|
451
|
+
@clickToolbar="toolbarEvent"
|
|
452
|
+
ref="toolbarPopover"
|
|
453
|
+
/>
|
|
454
|
+
<HelpModeDialog
|
|
455
|
+
v-show="helpMode && useHelpModeDialog"
|
|
456
|
+
class="help-mode-dialog"
|
|
457
|
+
:lastItem="helpModeLastItem"
|
|
458
|
+
@show-next="onHelpModeShowNext"
|
|
459
|
+
@finish-help-mode="onFinishHelpMode"
|
|
460
|
+
/>
|
|
461
|
+
<Tooltip
|
|
462
|
+
v-show="tooltipDisplay"
|
|
463
|
+
class="tooltip"
|
|
464
|
+
:tooltipEntry="tooltipEntry"
|
|
465
|
+
:annotationDisplay="annotationDisplay"
|
|
466
|
+
:annotationEntry="annotationEntry"
|
|
467
|
+
@annotation="commitAnnotationEvent"
|
|
468
|
+
@onActionClick="onActionClick"
|
|
469
|
+
/>
|
|
470
|
+
<TreeControls
|
|
471
|
+
v-show="mapType === 'flatmap'"
|
|
472
|
+
mapType="flatmap"
|
|
473
|
+
title="Systems"
|
|
474
|
+
:treeData="treeDataEntry"
|
|
475
|
+
active=""
|
|
476
|
+
hover=""
|
|
477
|
+
@checkAll="checkAll"
|
|
478
|
+
@checkChanged="checkChanged"
|
|
479
|
+
@changeActive="changeActive"
|
|
480
|
+
@changeHover="changeHover"
|
|
481
|
+
/>
|
|
482
|
+
<TreeControls
|
|
483
|
+
v-show="mapType === 'scaffold'"
|
|
484
|
+
mapType="scaffold"
|
|
485
|
+
title="Regions"
|
|
486
|
+
:isReady="isReady"
|
|
487
|
+
:treeData="treeDataEntry"
|
|
488
|
+
:active="[]"
|
|
489
|
+
:hover="[]"
|
|
490
|
+
:showColourPicker="true"
|
|
491
|
+
@setColour="setColour"
|
|
492
|
+
@checkChanged="checkChanged"
|
|
493
|
+
/>
|
|
494
|
+
</div>
|
|
495
|
+
</template>
|
|
496
|
+
|
|
497
|
+
<style scoped>
|
|
498
|
+
.options-container {
|
|
499
|
+
text-align: center;
|
|
500
|
+
}
|
|
501
|
+
.help-mode-dialog {
|
|
502
|
+
position: absolute;
|
|
503
|
+
top: 50%;
|
|
504
|
+
}
|
|
505
|
+
.tooltip {
|
|
506
|
+
width: 400px;
|
|
507
|
+
position: absolute;
|
|
508
|
+
top: calc(50% - 100px);
|
|
509
|
+
left: calc(50% - 200px);
|
|
510
|
+
}
|
|
511
|
+
</style>
|