@abi-software/scaffoldvuer 1.4.1-image.0 → 1.4.2
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/dist/scaffoldvuer.js +15354 -15943
- package/dist/scaffoldvuer.umd.cjs +179 -184
- package/dist/style.css +1 -1
- package/package.json +7 -13
- package/src/App.vue +3 -14
- package/src/components/ScaffoldTooltip.vue +12 -37
- package/src/components/ScaffoldVuer.vue +97 -237
- package/src/components.d.ts +0 -2
- package/src/main.js +1 -1
- package/vuese-generator.js +75 -16
- package/src/mixins/imageMixin.js +0 -87
- package/src/services/scicrunchQueries.js +0 -280
- package/src/stores/settings.js +0 -46
- /package/src/{stores → store}/index.js +0 -0
|
@@ -15,12 +15,9 @@
|
|
|
15
15
|
:x="tData.x"
|
|
16
16
|
:y="tData.y"
|
|
17
17
|
:annotationDisplay="annotationDisplay"
|
|
18
|
-
:imageThumbnailSidebar="imageThumbnailSidebar"
|
|
19
|
-
:imageThumbnails="imageThumbnailsEntry"
|
|
20
18
|
@confirm-create="confirmCreate($event)"
|
|
21
19
|
@cancel-create="cancelCreate()"
|
|
22
20
|
@confirm-delete="confirmDelete($event)"
|
|
23
|
-
@image-thumbnail-open="onImageThumbnailOpen"
|
|
24
21
|
/>
|
|
25
22
|
<div
|
|
26
23
|
id="organsDisplayArea"
|
|
@@ -287,7 +284,7 @@
|
|
|
287
284
|
ref="backgroundPopover"
|
|
288
285
|
:virtual-ref="backgroundIconRef"
|
|
289
286
|
placement="top-start"
|
|
290
|
-
width="
|
|
287
|
+
width="128"
|
|
291
288
|
:teleported="false"
|
|
292
289
|
trigger="click"
|
|
293
290
|
popper-class="background-popper non-selectable h-auto"
|
|
@@ -295,7 +292,7 @@
|
|
|
295
292
|
>
|
|
296
293
|
<div>
|
|
297
294
|
<el-row class="backgroundText">Viewing Mode</el-row>
|
|
298
|
-
<el-row class="
|
|
295
|
+
<el-row class="backgroundControl">
|
|
299
296
|
<div style="margin-bottom: 2px;">
|
|
300
297
|
<template
|
|
301
298
|
v-for="(value, key, index) in viewingModes"
|
|
@@ -313,45 +310,6 @@
|
|
|
313
310
|
{{ viewingModes[viewingMode] }}
|
|
314
311
|
</el-row>
|
|
315
312
|
</el-row>
|
|
316
|
-
<template v-if="viewingMode === 'Exploration' && sparcAPI">
|
|
317
|
-
<el-row class="backgroundSpacer"></el-row>
|
|
318
|
-
<el-row class="backgroundText">Markers display</el-row>
|
|
319
|
-
<el-row class="backgroundChooser">
|
|
320
|
-
<el-col :span="14">
|
|
321
|
-
<el-radio-group
|
|
322
|
-
v-model="imageRadio"
|
|
323
|
-
class="flatmap-radio"
|
|
324
|
-
:disabled="imagesDownloading"
|
|
325
|
-
@change="setImage"
|
|
326
|
-
>
|
|
327
|
-
<el-radio :value="false">Standard</el-radio>
|
|
328
|
-
<el-radio :value="true">Image</el-radio>
|
|
329
|
-
</el-radio-group>
|
|
330
|
-
</el-col>
|
|
331
|
-
<el-col :span="10" v-if="imageRadio">
|
|
332
|
-
<el-select
|
|
333
|
-
:teleported="false"
|
|
334
|
-
v-model="imageType"
|
|
335
|
-
placeholder="Select"
|
|
336
|
-
class="scaffold-select-box imageSelector"
|
|
337
|
-
popper-class="scaffold_viewer_dropdown"
|
|
338
|
-
:disabled="imagesDownloading"
|
|
339
|
-
@change="setImageType"
|
|
340
|
-
>
|
|
341
|
-
<el-option
|
|
342
|
-
v-for="item in imageTypes"
|
|
343
|
-
:key="item"
|
|
344
|
-
:label="item"
|
|
345
|
-
:value="item"
|
|
346
|
-
>
|
|
347
|
-
<el-row>
|
|
348
|
-
<el-col :span="12">{{ item }}</el-col>
|
|
349
|
-
</el-row>
|
|
350
|
-
</el-option>
|
|
351
|
-
</el-select>
|
|
352
|
-
</el-col>
|
|
353
|
-
</el-row>
|
|
354
|
-
</template>
|
|
355
313
|
<el-row class="backgroundSpacer"></el-row>
|
|
356
314
|
<el-row class="backgroundText"> Change background </el-row>
|
|
357
315
|
<el-row class="backgroundChooser">
|
|
@@ -424,7 +382,7 @@
|
|
|
424
382
|
|
|
425
383
|
<script>
|
|
426
384
|
/* eslint-disable no-alert, no-console */
|
|
427
|
-
import { markRaw,
|
|
385
|
+
import { markRaw, shallowRef } from 'vue';
|
|
428
386
|
import {
|
|
429
387
|
WarningFilled as ElIconWarningFilled,
|
|
430
388
|
ArrowDown as ElIconArrowDown,
|
|
@@ -463,16 +421,8 @@ import { AnnotationService } from '@abi-software/sparc-annotation';
|
|
|
463
421
|
import { EventNotifier } from "../scripts/EventNotifier.js";
|
|
464
422
|
import { OrgansViewer } from "../scripts/OrgansRenderer.js";
|
|
465
423
|
import { SearchIndex } from "../scripts/Search.js";
|
|
466
|
-
import { mapState
|
|
467
|
-
import { useMainStore } from "@/
|
|
468
|
-
import { useSettingsStore } from '@/stores/settings'
|
|
469
|
-
import {
|
|
470
|
-
getBiolucidaThumbnails,
|
|
471
|
-
getSegmentationThumbnails,
|
|
472
|
-
getScaffoldThumbnails,
|
|
473
|
-
getPlotThumbnails
|
|
474
|
-
} from '../services/scicrunchQueries'
|
|
475
|
-
import imageMixin from '../mixins/imageMixin.js'
|
|
424
|
+
import { mapState } from 'pinia';
|
|
425
|
+
import { useMainStore } from "@/store/index";
|
|
476
426
|
|
|
477
427
|
/**
|
|
478
428
|
* A vue component of the scaffold viewer.
|
|
@@ -482,7 +432,6 @@ import imageMixin from '../mixins/imageMixin.js'
|
|
|
482
432
|
*/
|
|
483
433
|
export default {
|
|
484
434
|
name: "ScaffoldVuer",
|
|
485
|
-
mixins: [imageMixin],
|
|
486
435
|
components: {
|
|
487
436
|
Button,
|
|
488
437
|
Col,
|
|
@@ -740,24 +689,10 @@ export default {
|
|
|
740
689
|
/**
|
|
741
690
|
* Enable local annotations
|
|
742
691
|
*/
|
|
743
|
-
|
|
692
|
+
enableLocalAnnotations: {
|
|
744
693
|
type: Boolean,
|
|
745
694
|
default: false
|
|
746
695
|
},
|
|
747
|
-
/**
|
|
748
|
-
* Specify the endpoint of the SPARC API.
|
|
749
|
-
*/
|
|
750
|
-
sparcAPI: {
|
|
751
|
-
type: String,
|
|
752
|
-
default: '',
|
|
753
|
-
},
|
|
754
|
-
/**
|
|
755
|
-
* The option to show image thumbnail in sidebar
|
|
756
|
-
*/
|
|
757
|
-
imageThumbnailSidebar: {
|
|
758
|
-
type: Boolean,
|
|
759
|
-
default: false,
|
|
760
|
-
},
|
|
761
696
|
},
|
|
762
697
|
provide() {
|
|
763
698
|
return {
|
|
@@ -765,7 +700,6 @@ export default {
|
|
|
765
700
|
scaffoldUrl: this.url,
|
|
766
701
|
$annotator: this.annotator,
|
|
767
702
|
boundingDims: this.boundingDims,
|
|
768
|
-
getFeaturesAlert: () => undefined,
|
|
769
703
|
};
|
|
770
704
|
},
|
|
771
705
|
data: function () {
|
|
@@ -809,7 +743,6 @@ export default {
|
|
|
809
743
|
inHelp: false,
|
|
810
744
|
helpModeActiveIndex: this.helpModeInitialIndex,
|
|
811
745
|
loading: false,
|
|
812
|
-
imagesDownloading: false,
|
|
813
746
|
duration: 3000,
|
|
814
747
|
drawerOpen: true,
|
|
815
748
|
currentBackground: "white",
|
|
@@ -857,8 +790,7 @@ export default {
|
|
|
857
790
|
active: false,
|
|
858
791
|
},
|
|
859
792
|
fileFormat: "metadata",
|
|
860
|
-
|
|
861
|
-
previousMarkerLabelEntry: markRaw({}),
|
|
793
|
+
previousMarkerLabels: markRaw({}),
|
|
862
794
|
viewingMode: "Exploration",
|
|
863
795
|
viewingModes: {
|
|
864
796
|
"Exploration": "View and explore detailed visualization of 3D scaffolds",
|
|
@@ -880,14 +812,6 @@ export default {
|
|
|
880
812
|
centre: [0, 0, 0],
|
|
881
813
|
size:[1, 1, 1],
|
|
882
814
|
},
|
|
883
|
-
imageRadio: false,
|
|
884
|
-
imageType: 'Image',
|
|
885
|
-
imageTypes: ['Image', 'Segmentation', 'Scaffold', 'Plot'],
|
|
886
|
-
imageClicked: '',
|
|
887
|
-
/**
|
|
888
|
-
* List of group names
|
|
889
|
-
*/
|
|
890
|
-
groupNames: markRaw([]),
|
|
891
815
|
};
|
|
892
816
|
},
|
|
893
817
|
watch: {
|
|
@@ -946,8 +870,10 @@ export default {
|
|
|
946
870
|
},
|
|
947
871
|
currentTime: {
|
|
948
872
|
handler: function () {
|
|
949
|
-
|
|
950
|
-
|
|
873
|
+
/**
|
|
874
|
+
* Emit when time in the current scene has changed
|
|
875
|
+
* @arg {String} "Current time in scene"
|
|
876
|
+
*/
|
|
951
877
|
this.$emit("timeChanged", this.currentTime);
|
|
952
878
|
},
|
|
953
879
|
},
|
|
@@ -967,20 +893,14 @@ export default {
|
|
|
967
893
|
},
|
|
968
894
|
immediate: true,
|
|
969
895
|
},
|
|
970
|
-
markerLabels: function
|
|
971
|
-
|
|
972
|
-
//Only updates the following if marker mode is standard
|
|
973
|
-
this.markerLabelEntry = markRaw({...labels});
|
|
974
|
-
}
|
|
975
|
-
},
|
|
976
|
-
markerLabelEntry: function (entry) {
|
|
977
|
-
for (const [key, value] of Object.entries(this.previousMarkerLabelEntry)) {
|
|
896
|
+
markerLabels: function(labels) {
|
|
897
|
+
for (const [key, value] of Object.entries(this.previousMarkerLabels)) {
|
|
978
898
|
this.setMarkerModeForObjectsWithName(key, value, "off");
|
|
979
899
|
}
|
|
980
|
-
for (const [key, value] of Object.entries(
|
|
900
|
+
for (const [key, value] of Object.entries(labels)) {
|
|
981
901
|
this.setMarkerModeForObjectsWithName(key, value, "on");
|
|
982
902
|
}
|
|
983
|
-
this.
|
|
903
|
+
this.previousMarkerLabels = markRaw({...labels});
|
|
984
904
|
},
|
|
985
905
|
},
|
|
986
906
|
beforeCreate: function () {
|
|
@@ -1020,21 +940,17 @@ export default {
|
|
|
1020
940
|
},
|
|
1021
941
|
computed: {
|
|
1022
942
|
...mapState(useMainStore, ['userToken']),
|
|
1023
|
-
...mapStores(useSettingsStore),
|
|
1024
943
|
annotationDisplay: function() {
|
|
1025
944
|
return this.viewingMode === 'Annotation' && this.tData.active === true &&
|
|
1026
945
|
(this.activeDrawMode === 'Edit' || this.activeDrawMode === 'Delete');
|
|
1027
|
-
},
|
|
1028
|
-
imageThumbnailsEntry: function() {
|
|
1029
|
-
return this.imageClicked ? this.convertUberonToName() : {};
|
|
1030
946
|
}
|
|
1031
947
|
},
|
|
1032
948
|
methods: {
|
|
1033
949
|
/**
|
|
1034
|
-
* @
|
|
950
|
+
* @public
|
|
1035
951
|
* Call this to manually add a zinc object into the current scene.
|
|
1036
952
|
* This will subsequently trigger a zincObjectAdded
|
|
1037
|
-
* @arg ZincObject object to be added
|
|
953
|
+
* @arg {Object} "ZincObject object to be added"
|
|
1038
954
|
*/
|
|
1039
955
|
addZincObject: function (zincObject) {
|
|
1040
956
|
if (this.$module.scene) {
|
|
@@ -1052,11 +968,10 @@ export default {
|
|
|
1052
968
|
if (this.timeVarying === false && zincObject.isTimeVarying()) {
|
|
1053
969
|
this.timeVarying = true;
|
|
1054
970
|
}
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
//@arg The object added to the sceene
|
|
971
|
+
/**
|
|
972
|
+
* Emit when a new object is added to the scene
|
|
973
|
+
* @arg {Object} "The object added to the sceene"
|
|
974
|
+
*/
|
|
1060
975
|
this.$emit("zinc-object-added", zincObject);
|
|
1061
976
|
},
|
|
1062
977
|
/**
|
|
@@ -1137,10 +1052,10 @@ export default {
|
|
|
1137
1052
|
hrefElement.remove();
|
|
1138
1053
|
},
|
|
1139
1054
|
/**
|
|
1140
|
-
* @
|
|
1055
|
+
* @public
|
|
1141
1056
|
* Function for capturing a screenshot of the current rendering.
|
|
1142
1057
|
*
|
|
1143
|
-
* @arg filename given to the screenshot.
|
|
1058
|
+
* @arg {String} "filename given to the screenshot."
|
|
1144
1059
|
*/
|
|
1145
1060
|
captureScreenshot: function (filename) {
|
|
1146
1061
|
this.captureFilename = filename;
|
|
@@ -1149,7 +1064,7 @@ export default {
|
|
|
1149
1064
|
);
|
|
1150
1065
|
},
|
|
1151
1066
|
/**
|
|
1152
|
-
* @
|
|
1067
|
+
* @public
|
|
1153
1068
|
* Function to clear current scene, the tree controls and the search index.
|
|
1154
1069
|
*/
|
|
1155
1070
|
clearScene: function () {
|
|
@@ -1158,8 +1073,12 @@ export default {
|
|
|
1158
1073
|
if (this.$module.scene) this.$module.scene.clearAll();
|
|
1159
1074
|
},
|
|
1160
1075
|
/**
|
|
1161
|
-
* @
|
|
1076
|
+
* @public
|
|
1162
1077
|
* Add and edit local annotations
|
|
1078
|
+
* @arg `region`,
|
|
1079
|
+
* @arg `group`,
|
|
1080
|
+
* @arg `zincObject`,
|
|
1081
|
+
* @arg `comment`
|
|
1163
1082
|
*/
|
|
1164
1083
|
addAndEditAnnotations: function (region, group, zincObject, comment) {
|
|
1165
1084
|
const annotation = addUserAnnotationWithFeature(this.annotator, this.userToken, zincObject,
|
|
@@ -1178,9 +1097,10 @@ export default {
|
|
|
1178
1097
|
this.$emit('userPrimitivesUpdated', {region, group, zincObject});
|
|
1179
1098
|
},
|
|
1180
1099
|
/**
|
|
1181
|
-
* @
|
|
1100
|
+
* @public
|
|
1182
1101
|
* Callback for when primitives have been update using primitive controls.
|
|
1183
1102
|
* This is only called from callback.
|
|
1103
|
+
* @arg `object`
|
|
1184
1104
|
*/
|
|
1185
1105
|
primitivesUpdated: function(object) {
|
|
1186
1106
|
if (object.isZincObject && object.isEditable) {
|
|
@@ -1190,8 +1110,9 @@ export default {
|
|
|
1190
1110
|
}
|
|
1191
1111
|
},
|
|
1192
1112
|
/**
|
|
1193
|
-
* @
|
|
1113
|
+
* @public
|
|
1194
1114
|
* Confirm creation of new primitive. This is only called from callback.
|
|
1115
|
+
* @arg `payload`
|
|
1195
1116
|
*/
|
|
1196
1117
|
confirmCreate: function(payload) {
|
|
1197
1118
|
if (payload) {
|
|
@@ -1281,7 +1202,7 @@ export default {
|
|
|
1281
1202
|
return val ? val.toFixed(2) + " ms" : "0 ms";
|
|
1282
1203
|
},
|
|
1283
1204
|
/**
|
|
1284
|
-
* @
|
|
1205
|
+
* @public
|
|
1285
1206
|
* Function to reset the view to default.
|
|
1286
1207
|
* Also called when the associated button is pressed.
|
|
1287
1208
|
*/
|
|
@@ -1303,7 +1224,7 @@ export default {
|
|
|
1303
1224
|
}
|
|
1304
1225
|
},
|
|
1305
1226
|
/**
|
|
1306
|
-
* @
|
|
1227
|
+
* @public
|
|
1307
1228
|
* Function to zoom in.
|
|
1308
1229
|
* Also called when the associated button is pressed.
|
|
1309
1230
|
*/
|
|
@@ -1316,7 +1237,7 @@ export default {
|
|
|
1316
1237
|
* Function to zoom out.
|
|
1317
1238
|
* Also called when the associated button is pressed.
|
|
1318
1239
|
*
|
|
1319
|
-
* @
|
|
1240
|
+
* @public
|
|
1320
1241
|
*/
|
|
1321
1242
|
zoomOut: function () {
|
|
1322
1243
|
if (this.$module.scene) {
|
|
@@ -1326,7 +1247,8 @@ export default {
|
|
|
1326
1247
|
/**
|
|
1327
1248
|
* Function to change the current play speed.
|
|
1328
1249
|
*
|
|
1329
|
-
* @
|
|
1250
|
+
* @public
|
|
1251
|
+
* @arg `speed`
|
|
1330
1252
|
*/
|
|
1331
1253
|
speedChanged: function (speed) {
|
|
1332
1254
|
this.currentSpeed = speed;
|
|
@@ -1335,7 +1257,7 @@ export default {
|
|
|
1335
1257
|
/**
|
|
1336
1258
|
* Function used to stop the free spin
|
|
1337
1259
|
*
|
|
1338
|
-
* @
|
|
1260
|
+
* @public
|
|
1339
1261
|
*/
|
|
1340
1262
|
stopFreeSpin: function () {
|
|
1341
1263
|
let cameracontrol = this.$module.scene.getZincCameraControls();
|
|
@@ -1344,9 +1266,9 @@ export default {
|
|
|
1344
1266
|
},
|
|
1345
1267
|
/**
|
|
1346
1268
|
* Return a list of obejcts with the provided name.
|
|
1347
|
-
* @arg Group name to search.
|
|
1269
|
+
* @arg "Group name to search."
|
|
1348
1270
|
*
|
|
1349
|
-
* @
|
|
1271
|
+
* @public
|
|
1350
1272
|
*/
|
|
1351
1273
|
findObjectsWithGroupName: function (name) {
|
|
1352
1274
|
let objects = [];
|
|
@@ -1356,10 +1278,10 @@ export default {
|
|
|
1356
1278
|
return objects;
|
|
1357
1279
|
},
|
|
1358
1280
|
/**
|
|
1281
|
+
* @public
|
|
1359
1282
|
* Switch active drawing type
|
|
1360
|
-
* @arg
|
|
1361
|
-
*
|
|
1362
|
-
* @vuese
|
|
1283
|
+
* @arg {String} `type`
|
|
1284
|
+
* @arg {String} `icon`
|
|
1363
1285
|
*/
|
|
1364
1286
|
toggleDrawing: function (type, icon) {
|
|
1365
1287
|
this.createData.toBeDeleted = false;
|
|
@@ -1376,16 +1298,16 @@ export default {
|
|
|
1376
1298
|
/**
|
|
1377
1299
|
* Toggle the drawing box which aid the drawing
|
|
1378
1300
|
*
|
|
1379
|
-
* @
|
|
1301
|
+
* @public
|
|
1380
1302
|
*/
|
|
1381
1303
|
toggleDrawingBox: function () {
|
|
1382
1304
|
this.createData.drawingBox = !this.createData.drawingBox;
|
|
1383
1305
|
},
|
|
1384
1306
|
/**
|
|
1385
1307
|
* Find and and zoom into objects with the provided list of names.
|
|
1386
|
-
* @arg List of names
|
|
1308
|
+
* @arg "List of names"
|
|
1387
1309
|
*
|
|
1388
|
-
* @
|
|
1310
|
+
* @public
|
|
1389
1311
|
*/
|
|
1390
1312
|
viewRegion: function (names) {
|
|
1391
1313
|
const rootRegion = this.$module.scene.getRootRegion();
|
|
@@ -1485,7 +1407,7 @@ export default {
|
|
|
1485
1407
|
/**
|
|
1486
1408
|
* Return renderer information
|
|
1487
1409
|
*
|
|
1488
|
-
* @
|
|
1410
|
+
* @public
|
|
1489
1411
|
*/
|
|
1490
1412
|
getRendererInfo: function () {
|
|
1491
1413
|
if (this.$module.zincRenderer) {
|
|
@@ -1497,7 +1419,7 @@ export default {
|
|
|
1497
1419
|
* Function used to rotate the scene.
|
|
1498
1420
|
* Also called when the associated button is pressed.
|
|
1499
1421
|
*
|
|
1500
|
-
* @
|
|
1422
|
+
* @public
|
|
1501
1423
|
*/
|
|
1502
1424
|
freeSpin: function () {
|
|
1503
1425
|
if (this.$module.scene) {
|
|
@@ -1569,9 +1491,6 @@ export default {
|
|
|
1569
1491
|
? identifier.data.id
|
|
1570
1492
|
: identifier.data.group;
|
|
1571
1493
|
names.push(id);
|
|
1572
|
-
if (identifier.data) {
|
|
1573
|
-
identifier.data.imageType = this.imageRadio ? this.imageType : "Standard"
|
|
1574
|
-
}
|
|
1575
1494
|
}
|
|
1576
1495
|
});
|
|
1577
1496
|
zincObjects = event.zincObjects;
|
|
@@ -1595,15 +1514,10 @@ export default {
|
|
|
1595
1514
|
this.$refs.scaffoldTreeControls.removeActive(false);
|
|
1596
1515
|
}
|
|
1597
1516
|
}
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
} else {
|
|
1603
|
-
this.imageClicked = ''
|
|
1604
|
-
}
|
|
1605
|
-
//Emit when an object is selected
|
|
1606
|
-
//@arg Identifier of selected objects
|
|
1517
|
+
/**
|
|
1518
|
+
* Emit when an object is selected
|
|
1519
|
+
* @arg {Object} "Identifier of selected objects"
|
|
1520
|
+
*/
|
|
1607
1521
|
this.$emit("scaffold-selected", event.identifiers);
|
|
1608
1522
|
}
|
|
1609
1523
|
} else if (event.eventType == 2) {
|
|
@@ -1637,8 +1551,10 @@ export default {
|
|
|
1637
1551
|
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1638
1552
|
}
|
|
1639
1553
|
}
|
|
1640
|
-
|
|
1641
|
-
|
|
1554
|
+
/**
|
|
1555
|
+
* Emit when an object is highlighted
|
|
1556
|
+
* @arg {Object} "Identifier of selected objects"
|
|
1557
|
+
*/
|
|
1642
1558
|
this.$emit("scaffold-highlighted", event.identifiers);
|
|
1643
1559
|
}
|
|
1644
1560
|
} else if (event.eventType == 3) {
|
|
@@ -1652,12 +1568,6 @@ export default {
|
|
|
1652
1568
|
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1653
1569
|
}
|
|
1654
1570
|
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1655
|
-
const id = event.identifiers[0].data.id
|
|
1656
|
-
? event.identifiers[0].data.id
|
|
1657
|
-
: event.identifiers[0].data.group;
|
|
1658
|
-
if (this.imageClicked !== id) {
|
|
1659
|
-
this.imageClicked = ''
|
|
1660
|
-
}
|
|
1661
1571
|
}
|
|
1662
1572
|
}
|
|
1663
1573
|
}
|
|
@@ -1665,7 +1575,7 @@ export default {
|
|
|
1665
1575
|
/**
|
|
1666
1576
|
* Get the coordinates of the current selected region.
|
|
1667
1577
|
*
|
|
1668
|
-
* @
|
|
1578
|
+
* @public
|
|
1669
1579
|
*/
|
|
1670
1580
|
getCoordinatesOfSelected: function () {
|
|
1671
1581
|
if (this.selectedObjects && this.selectedObjects.length > 0) {
|
|
@@ -1678,7 +1588,7 @@ export default {
|
|
|
1678
1588
|
* current selected region which will be updated after each render
|
|
1679
1589
|
* loop.
|
|
1680
1590
|
*
|
|
1681
|
-
* @
|
|
1591
|
+
* @public
|
|
1682
1592
|
*/
|
|
1683
1593
|
getDynamicSelectedCoordinates: function () {
|
|
1684
1594
|
return this.$module.selectedScreenCoordinates;
|
|
@@ -1758,10 +1668,10 @@ export default {
|
|
|
1758
1668
|
}
|
|
1759
1669
|
},
|
|
1760
1670
|
/**
|
|
1761
|
-
* @
|
|
1671
|
+
* @public
|
|
1762
1672
|
* Start the animation.
|
|
1763
1673
|
*
|
|
1764
|
-
* @arg flag to turn the animation on/off
|
|
1674
|
+
* @arg "flag to turn the animation on/off"
|
|
1765
1675
|
*/
|
|
1766
1676
|
play: function (flag) {
|
|
1767
1677
|
this.$module.playAnimation(flag);
|
|
@@ -1770,7 +1680,7 @@ export default {
|
|
|
1770
1680
|
//this.hideRegionTooltip();
|
|
1771
1681
|
},
|
|
1772
1682
|
/**
|
|
1773
|
-
* @
|
|
1683
|
+
* @public
|
|
1774
1684
|
* Function to toggle on/off overlay help.
|
|
1775
1685
|
*/
|
|
1776
1686
|
setHelpMode: function (helpMode) {
|
|
@@ -1998,7 +1908,7 @@ export default {
|
|
|
1998
1908
|
}
|
|
1999
1909
|
this.userInformation = undefined;
|
|
2000
1910
|
this.annotator.authenticate(this.userToken).then((userData) => {
|
|
2001
|
-
if (userData.name && userData.email) {
|
|
1911
|
+
if (userData.name && userData.email && userData.canUpdate) {
|
|
2002
1912
|
this.userInformation = userData;
|
|
2003
1913
|
//Only draw annotations stored in the server on initial authentication
|
|
2004
1914
|
if (!authenticated) {
|
|
@@ -2026,7 +1936,7 @@ export default {
|
|
|
2026
1936
|
}
|
|
2027
1937
|
},
|
|
2028
1938
|
/**
|
|
2029
|
-
* @
|
|
1939
|
+
* @public
|
|
2030
1940
|
* Hide the tooltip
|
|
2031
1941
|
*/
|
|
2032
1942
|
hideRegionTooltip: function () {
|
|
@@ -2060,8 +1970,10 @@ export default {
|
|
|
2060
1970
|
}
|
|
2061
1971
|
},
|
|
2062
1972
|
/**
|
|
2063
|
-
* @
|
|
1973
|
+
* @public
|
|
2064
1974
|
* Set the marker modes for objects specified by the list of annotations
|
|
1975
|
+
* @arg `annotations`
|
|
1976
|
+
* @arg `mode`
|
|
2065
1977
|
*/
|
|
2066
1978
|
setMarkerModeWithAnnotations: function (annotations, mode) {
|
|
2067
1979
|
if (this.$module.scene) {
|
|
@@ -2099,11 +2011,11 @@ export default {
|
|
|
2099
2011
|
}
|
|
2100
2012
|
},
|
|
2101
2013
|
/**
|
|
2102
|
-
* @
|
|
2014
|
+
* @public
|
|
2103
2015
|
*
|
|
2104
2016
|
* Search a object and display the tooltip
|
|
2105
|
-
* @arg text to search across
|
|
2106
|
-
* @arg toggle the tooltip if this is set
|
|
2017
|
+
* @arg "text to search across"
|
|
2018
|
+
* @arg "toggle the tooltip if this is set"
|
|
2107
2019
|
*/
|
|
2108
2020
|
search: function (text, displayLabel) {
|
|
2109
2021
|
if (this.$_searchIndex) {
|
|
@@ -2139,10 +2051,11 @@ export default {
|
|
|
2139
2051
|
return false;
|
|
2140
2052
|
},
|
|
2141
2053
|
/**
|
|
2142
|
-
* @
|
|
2054
|
+
* @public
|
|
2143
2055
|
*
|
|
2144
2056
|
* Get the list of suggested terms based on the provided term.
|
|
2145
2057
|
* This can be used for autocomplete.
|
|
2058
|
+
* @arg `term`
|
|
2146
2059
|
*/
|
|
2147
2060
|
fetchSuggestions: function (term) {
|
|
2148
2061
|
if (this.$_searchIndex === undefined) return [];
|
|
@@ -2197,7 +2110,9 @@ export default {
|
|
|
2197
2110
|
this.$module.updateTime(0);
|
|
2198
2111
|
this.$module.unsetFinishDownloadCallback();
|
|
2199
2112
|
this.addRegionsToSearchIndex();
|
|
2200
|
-
|
|
2113
|
+
/**
|
|
2114
|
+
* Emit when all objects have been loaded
|
|
2115
|
+
*/
|
|
2201
2116
|
this.$emit("on-ready");
|
|
2202
2117
|
this.setMarkers();
|
|
2203
2118
|
//Create a bounding box.
|
|
@@ -2217,7 +2132,7 @@ export default {
|
|
|
2217
2132
|
* Function used for getting the current states of the scene. This exported states
|
|
2218
2133
|
* can be imported using the importStates method.
|
|
2219
2134
|
*
|
|
2220
|
-
* @
|
|
2135
|
+
* @public
|
|
2221
2136
|
*/
|
|
2222
2137
|
getState: function () {
|
|
2223
2138
|
let state = {
|
|
@@ -2238,7 +2153,8 @@ export default {
|
|
|
2238
2153
|
* Function used for importing the states of the scene. This exported states
|
|
2239
2154
|
* can be imported using the read states method.
|
|
2240
2155
|
*
|
|
2241
|
-
* @
|
|
2156
|
+
* @public
|
|
2157
|
+
* @arg `state`
|
|
2242
2158
|
*/
|
|
2243
2159
|
setState: function (state) {
|
|
2244
2160
|
if (state) {
|
|
@@ -2271,9 +2187,9 @@ export default {
|
|
|
2271
2187
|
},
|
|
2272
2188
|
/**
|
|
2273
2189
|
* export current scene in GLTF.
|
|
2274
|
-
* @arg Return in binary form when set to true
|
|
2190
|
+
* @arg "Return in binary form when set to true"
|
|
2275
2191
|
*
|
|
2276
|
-
* @
|
|
2192
|
+
* @public
|
|
2277
2193
|
*/
|
|
2278
2194
|
exportGLTF: function (binary) {
|
|
2279
2195
|
return this.$module.scene.exportGLTF(binary);
|
|
@@ -2283,7 +2199,7 @@ export default {
|
|
|
2283
2199
|
* This list is used for storing user created annotation
|
|
2284
2200
|
* when enableLocalAnnotations is set to true.
|
|
2285
2201
|
*
|
|
2286
|
-
* @
|
|
2202
|
+
* @public
|
|
2287
2203
|
*/
|
|
2288
2204
|
getLocalAnnotations: function () {
|
|
2289
2205
|
return [...this.localAnnotationsList];
|
|
@@ -2293,7 +2209,8 @@ export default {
|
|
|
2293
2209
|
* be imported when enableLocalAnnotations is set to
|
|
2294
2210
|
* true;
|
|
2295
2211
|
*
|
|
2296
|
-
* @
|
|
2212
|
+
* @public
|
|
2213
|
+
* @arg {Array} `annotationsList`
|
|
2297
2214
|
*/
|
|
2298
2215
|
importLocalAnnotations: function (annotationsList) {
|
|
2299
2216
|
if (this.enableLocalAnnotations) {
|
|
@@ -2322,7 +2239,9 @@ export default {
|
|
|
2322
2239
|
* viewport. This function will ignore the state prop and
|
|
2323
2240
|
* read in the new url.
|
|
2324
2241
|
*
|
|
2325
|
-
* @
|
|
2242
|
+
* @public
|
|
2243
|
+
* @arg `newValue`
|
|
2244
|
+
* @arg `state`
|
|
2326
2245
|
*/
|
|
2327
2246
|
setURLAndState: function (newValue, state) {
|
|
2328
2247
|
if (newValue != this._currentURL) {
|
|
@@ -2345,7 +2264,6 @@ export default {
|
|
|
2345
2264
|
visibility: visibility,
|
|
2346
2265
|
})
|
|
2347
2266
|
);
|
|
2348
|
-
this.groupNames.length = 0;
|
|
2349
2267
|
if (this.fileFormat === "gltf") {
|
|
2350
2268
|
this.$module.loadGLTFFromURL(newValue, "scene", true);
|
|
2351
2269
|
} else {
|
|
@@ -2370,7 +2288,8 @@ export default {
|
|
|
2370
2288
|
* Function used for reading in new scaffold metadata. This function will ignore
|
|
2371
2289
|
* the state prop and read in the new url.
|
|
2372
2290
|
*
|
|
2373
|
-
* @
|
|
2291
|
+
* @public
|
|
2292
|
+
* @arg `newValue`
|
|
2374
2293
|
*/
|
|
2375
2294
|
setURL: function (newValue) {
|
|
2376
2295
|
this.setURLAndState(newValue, undefined);
|
|
@@ -2406,7 +2325,7 @@ export default {
|
|
|
2406
2325
|
}
|
|
2407
2326
|
},
|
|
2408
2327
|
/**
|
|
2409
|
-
* @
|
|
2328
|
+
* @public
|
|
2410
2329
|
*
|
|
2411
2330
|
* Force the renderer to resize
|
|
2412
2331
|
*/
|
|
@@ -2420,9 +2339,11 @@ export default {
|
|
|
2420
2339
|
if (this.tData.visible) {
|
|
2421
2340
|
this.showRegionTooltip(this.tData.label, true, true);
|
|
2422
2341
|
}
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2342
|
+
/**
|
|
2343
|
+
* Emit when the scene has been transformed due to navigation,
|
|
2344
|
+
* only triggered during syncControl mode
|
|
2345
|
+
* @arg {Object} "Information on the navigation"
|
|
2346
|
+
*/
|
|
2426
2347
|
this.$emit("scaffold-navigated", payload);
|
|
2427
2348
|
},
|
|
2428
2349
|
/**
|
|
@@ -2433,72 +2354,15 @@ export default {
|
|
|
2433
2354
|
this.$module.toggleSyncControl(flag, rotateMode);
|
|
2434
2355
|
this.$module.setSyncControlCallback(this.syncControlCallback);
|
|
2435
2356
|
},
|
|
2357
|
+
|
|
2436
2358
|
/**
|
|
2437
2359
|
* Set the markers for the scene.
|
|
2438
2360
|
*/
|
|
2439
2361
|
setMarkers: function () {
|
|
2440
|
-
for (const [key, value] of Object.entries(this.
|
|
2362
|
+
for (const [key, value] of Object.entries(this.markerLabels)) {
|
|
2441
2363
|
this.setMarkerModeForObjectsWithName(key, value, "on");
|
|
2442
2364
|
}
|
|
2443
2365
|
},
|
|
2444
|
-
removeImageThumbnails: function () {
|
|
2445
|
-
this.imageThumbnails = {};
|
|
2446
|
-
this.markerLabelEntry = markRaw(this.markerLabels);
|
|
2447
|
-
},
|
|
2448
|
-
setImage: async function (flag) {
|
|
2449
|
-
if (flag) {
|
|
2450
|
-
await this.setImageType(this.imageType);
|
|
2451
|
-
this.$module.scene.enableMarkerCluster(false);
|
|
2452
|
-
} else {
|
|
2453
|
-
this.removeImageThumbnails();
|
|
2454
|
-
this.$module.scene.enableMarkerCluster(this.markerCluster);
|
|
2455
|
-
}
|
|
2456
|
-
},
|
|
2457
|
-
setImageType: async function (type) {
|
|
2458
|
-
this.imageType = type;
|
|
2459
|
-
this.imagesDownloading = true;
|
|
2460
|
-
if (!this.settingsStore.imageTypeCached(type)) {
|
|
2461
|
-
this.loading = true;
|
|
2462
|
-
await this.fetchImageThumbnails(type);
|
|
2463
|
-
this.loading = false;
|
|
2464
|
-
}
|
|
2465
|
-
this.populateImageThumbnails(type);
|
|
2466
|
-
},
|
|
2467
|
-
fetchImageThumbnails: async function (type) {
|
|
2468
|
-
let thumbnails = {};
|
|
2469
|
-
const organCuries = this.settingsStore.organCuries;
|
|
2470
|
-
if (type === 'Image') {
|
|
2471
|
-
thumbnails = await getBiolucidaThumbnails(this.sparcAPI, organCuries, type);
|
|
2472
|
-
} else if (type === 'Segmentation') {
|
|
2473
|
-
thumbnails = await getSegmentationThumbnails(this.sparcAPI, organCuries, type);
|
|
2474
|
-
} else if (type === 'Scaffold') {
|
|
2475
|
-
thumbnails = await getScaffoldThumbnails(this.sparcAPI, organCuries, type);
|
|
2476
|
-
} else if (type === 'Plot') {
|
|
2477
|
-
thumbnails = await getPlotThumbnails(this.sparcAPI, organCuries, type);
|
|
2478
|
-
}
|
|
2479
|
-
this.settingsStore.updateImageThumbnails(type, thumbnails);
|
|
2480
|
-
},
|
|
2481
|
-
convertUberonToName: function () {
|
|
2482
|
-
const organCuries = this.settingsStore.organCuries;
|
|
2483
|
-
const identifiers = organCuries.filter(
|
|
2484
|
-
(curie) => this.groupNames.includes(curie.name.toLowerCase())
|
|
2485
|
-
).map((curie) => curie.id);
|
|
2486
|
-
const imageThumbnails = this.settingsStore.getImageThumbnails(this.imageType, identifiers);
|
|
2487
|
-
return Object.fromEntries(
|
|
2488
|
-
Object.entries(imageThumbnails)
|
|
2489
|
-
.map(([key, value]) => [organCuries.filter((curie) => curie.id === key)[0].name, value]));
|
|
2490
|
-
},
|
|
2491
|
-
populateImageThumbnails: async function (type) {
|
|
2492
|
-
this.removeImageThumbnails();
|
|
2493
|
-
const thumbnails = this.convertUberonToName();
|
|
2494
|
-
this.loading = true;
|
|
2495
|
-
this.markerLabelEntry = markRaw(await this.populateMapWithImages(thumbnails, type));
|
|
2496
|
-
this.loading = false;
|
|
2497
|
-
this.imagesDownloading = false;
|
|
2498
|
-
},
|
|
2499
|
-
onImageThumbnailOpen: function (payload) {
|
|
2500
|
-
this.$emit('image-thumbnail-open', payload);
|
|
2501
|
-
},
|
|
2502
2366
|
},
|
|
2503
2367
|
};
|
|
2504
2368
|
</script>
|
|
@@ -2658,7 +2522,7 @@ export default {
|
|
|
2658
2522
|
background-color: #ffffff;
|
|
2659
2523
|
border: 1px solid $app-primary-color;
|
|
2660
2524
|
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
|
|
2661
|
-
height:
|
|
2525
|
+
height: 140px;
|
|
2662
2526
|
min-width: 200px;
|
|
2663
2527
|
.el-popper__arrow {
|
|
2664
2528
|
&:before {
|
|
@@ -2915,10 +2779,6 @@ export default {
|
|
|
2915
2779
|
min-height: 24px
|
|
2916
2780
|
}
|
|
2917
2781
|
}
|
|
2918
|
-
|
|
2919
|
-
&.imageSelector {
|
|
2920
|
-
width: 125px!important;
|
|
2921
|
-
}
|
|
2922
2782
|
}
|
|
2923
2783
|
|
|
2924
2784
|
:deep(.scaffold_viewer_dropdown) {
|