Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image on scaffold #142

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
475a6a1
Add initial image implementation
ddjnw1yu Jul 29, 2024
9b9e1e4
Update for map utilities component
ddjnw1yu Jul 30, 2024
7216c2e
Update image display issue
ddjnw1yu Jul 30, 2024
b33e2ab
Use map-utilities v1.0.0-beta.1
ddjnw1yu Jul 31, 2024
a284af0
Some scicrunch mixin updates
ddjnw1yu Jul 31, 2024
e59c03a
Update to use same mixin as flatmap
ddjnw1yu Aug 2, 2024
bc53ec4
Option to replace markers with images
ddjnw1yu Aug 12, 2024
608fb10
Update image marker control
ddjnw1yu Aug 15, 2024
ec17470
Merge branch 'main' into image-on-scaffold
ddjnw1yu Aug 15, 2024
e2f837c
Add switch to control image display
ddjnw1yu Aug 16, 2024
5126a62
Update to use new image api
ddjnw1yu Aug 21, 2024
8bd207c
Support to show more image types
ddjnw1yu Aug 22, 2024
21f288a
Improve implementation
ddjnw1yu Aug 22, 2024
8cfc5fd
Upgrade zincjs
ddjnw1yu Aug 22, 2024
603ed9d
Fix image size issue
ddjnw1yu Aug 22, 2024
df50642
Replace hover to show with click to show
ddjnw1yu Aug 25, 2024
f11e668
Create setting store
ddjnw1yu Aug 25, 2024
211a3f2
Add image data emit and flag to show in sidebar
ddjnw1yu Aug 26, 2024
8018dbb
Update default image type to Image
ddjnw1yu Aug 26, 2024
5310658
minor update
ddjnw1yu Aug 27, 2024
192b826
Update setting store and click to show image logic
ddjnw1yu Aug 28, 2024
d54312a
Update image select box
ddjnw1yu Aug 29, 2024
2974d0d
Increase select box width
ddjnw1yu Aug 29, 2024
206d31c
v1.4.0-beta.0 image selector
ddjnw1yu Aug 29, 2024
223d53b
Fix a issue related to label case
ddjnw1yu Aug 30, 2024
8521bca
v1.4.0-beta.1 minor fix
ddjnw1yu Sep 1, 2024
1bb23e7
Add changes.
alan-wu Sep 2, 2024
4be762e
Merge remote-tracking branch 'david/image-on-scaffold' into image-on-…
alan-wu Sep 2, 2024
b1804a7
Add imageType to resource selected callback.
alan-wu Sep 2, 2024
1444c90
Merge pull request #1 from alan-wu/image-on-scaffold
ddjnw1yu Sep 2, 2024
5208cbb
Hide maker display option when sparcAPI not exists
ddjnw1yu Sep 3, 2024
9491d6f
Merge branch 'main' into image-on-scaffold
akhuoa Sep 4, 2024
5dac051
Disable markers display switch while downloading thumbnail images
akhuoa Sep 4, 2024
a3734dc
Merge pull request #2 from akhuoa/image-on-scaffold
ddjnw1yu Sep 4, 2024
ae080e5
Improve image thumbnails.
alan-wu Sep 5, 2024
7d0df67
merge in changes.
alan-wu Sep 5, 2024
e0efa70
Merge pull request #3 from alan-wu/image-on-scaffold
ddjnw1yu Sep 5, 2024
c21738e
Emit image thumbnail open only if there has data
akhuoa Sep 11, 2024
a9ba188
Merge branch 'image-on-scaffold' of github.com:ddjnw1yu/scaffoldvuer …
akhuoa Sep 11, 2024
dc7ff18
Fix markers not showing on first load
akhuoa Sep 11, 2024
1419580
Merge pull request #4 from akhuoa/image-on-scaffold
ddjnw1yu Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
964 changes: 329 additions & 635 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"*.js"
],
"dependencies": {
"@abi-software/map-utilities": "^1.1.0",
"@abi-software/map-utilities": "^1.1.0-beta.2",
"@abi-software/sparc-annotation": "^0.3.1",
"@abi-software/svg-sprite": "^1.0.0",
"@element-plus/icons-vue": "^2.3.1",
Expand All @@ -60,7 +60,7 @@
"devDependencies": {
"@vitejs/plugin-vue": "^4.6.2",
"@vuese/markdown-render": "^2.11.3",
"@vuese/parser": "^2.10.3",
"@vuese/parser": "^2.9.1",
"auto-changelog": "^2.4.0",
"babel-eslint": "^10.1.0",
"babel-plugin-component": "^1.1.1",
Expand Down Expand Up @@ -92,5 +92,8 @@
"browserslist": [
"> 1%",
"last 2 versions"
]
],
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.21.1"
}
}
17 changes: 14 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
:format="format"
:marker-labels="markerLabels"
:enableLocalAnnotations="false"
:sparcAPI="sparcAPI"
@open-map="openMap"
@on-ready="onReady"
@scaffold-selected="onSelected"
Expand Down Expand Up @@ -321,6 +322,9 @@ import {
import { useRoute, useRouter } from 'vue-router'
import { HelpModeDialog } from '@abi-software/map-utilities'
import '@abi-software/map-utilities/dist/style.css'
import { mapStores } from 'pinia';
import { useSettingsStore } from '@/stores/settings';
import { getOrganCuries } from '@/services/scicrunchQueries'

let texture_prefix = undefined;

Expand Down Expand Up @@ -358,7 +362,7 @@ export default {
},
data: function () {
return {
consoleOn: true,
consoleOn: false,
createLinesWithNormal: false,
url: undefined,
input: undefined,
Expand Down Expand Up @@ -406,9 +410,13 @@ export default {
router: useRouter(),
ElIconSetting: shallowRef(ElIconSetting),
ElIconFolderOpened: shallowRef(ElIconFolderOpened),
auto: NaN
auto: NaN,
sparcAPI: import.meta.env.VITE_SPARC_API,
};
},
computed: {
...mapStores(useSettingsStore),
},
watch: {
input: function () {
this.parseInput();
Expand All @@ -422,7 +430,7 @@ export default {
"body proper": 9,
"Spinal cord": 8,
"lung": 11,
"stomach": {number:12, imgURL: 'https://mapcore-bucket1.s3.us-west-2.amazonaws.com/texture/arm1/jpg/0984.jpg'},
"stomach": 12,
"urinary bladder": 11,
"Brainstem": 11,
"heart": 9,
Expand Down Expand Up @@ -454,6 +462,9 @@ export default {
},
mounted: function () {
this._objects = [];
if (this.sparcAPI) {
getOrganCuries(this.sparcAPI).then((organCuries) => this.settingsStore.updateOrganCuries(organCuries))
}
},
created: function () {
texture_prefix = import.meta.env.VITE_TEXTURE_FOOT_PREFIX;
Expand Down
2 changes: 2 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ declare module 'vue' {
ElMain: typeof import('element-plus/es')['ElMain']
ElOption: typeof import('element-plus/es')['ElOption']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSlider: typeof import('element-plus/es')['ElSlider']
Expand Down
51 changes: 39 additions & 12 deletions src/components/ScaffoldTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@
<template #default>
<div class="tooltip-text">{{ label }}</div>
<div class="tooltip-text" v-if="region">Region: {{ region }}</div>
<CreateTooltiipContent
<CreateTooltipContent
v-show="createData.toBeConfirmed"
:createData="createData"
@confirm-create="$emit('confirm-create', $event)"
@cancel-create="$emit('cancel-create')"
/>
<Tooltip
class="p-tooltip"
v-show="annotationDisplay && !createData.toBeConfirmed"
ref="annotationTooltip"
:annotationDisplay="true"
v-show="
(annotationDisplay && !createData.toBeConfirmed) ||
imageEntry.length
"
ref="tooltip"
:tooltipType="annotationDisplay ? 'annotation' : 'image'"
:annotationEntry="annotationEntry"
:imageEntry="imageEntry"
/>
<div v-if="createData.toBeDeleted" class="delete-container">
<el-row>
Expand Down Expand Up @@ -66,9 +70,9 @@ import {
import {
Delete as ElIconDelete,
} from '@element-plus/icons-vue'
import CreateTooltiipContent from "./CreateTooltipContent.vue";
import { mapState } from 'pinia';
import { useMainStore } from "@/store/index";
import { useMainStore } from "@/stores/index";
import CreateTooltipContent from "./CreateTooltipContent.vue";
import { Tooltip } from '@abi-software/map-utilities'
import '@abi-software/map-utilities/dist/style.css'

Expand All @@ -79,7 +83,7 @@ export default {
name: "ScaffoldTooltip",
components: {
Col,
CreateTooltiipContent,
CreateTooltipContent,
ElIconDelete,
Icon,
Popover,
Expand Down Expand Up @@ -121,6 +125,14 @@ export default {
type: Number,
default: 200,
},
imageThumbnails: {
type: Object,
default: {},
},
imageThumbnailSidebar: {
type: Boolean,
default: false,
},
},
inject: ['scaffoldUrl'],
provide() {
Expand All @@ -130,7 +142,6 @@ export default {
},
data: function () {
return {
display: false,
annotationEntry: { },
ElIconDelete: shallowRef(ElIconDelete),
};
Expand All @@ -145,11 +156,29 @@ export default {
const x = this.x - 40;
return { left: x + "px", top: this.y - yOffset + "px" };
},
imageEntry: function () {
let imageEntries = []
const imageThumbnailsEntries = Object.assign({},
Object.fromEntries(
Object.entries(this.imageThumbnails)
.filter(([key, value]) => value.length > 0)
.map(([key, value]) => [key.toLowerCase(), value])))
const lowerCaseLabel = this.label.toLowerCase()
if (lowerCaseLabel in imageThumbnailsEntries) {
imageEntries = imageThumbnailsEntries[lowerCaseLabel];
}
if (this.imageThumbnailSidebar) {
if (imageEntries.length) {
this.$emit('image-thumbnail-open', imageEntries)
}
return [];
}
return imageEntries;
},
},
methods: {
checkForDisplay: function () {
if (this.visible && this.label && this.label !== "") {
this.display = true;
if (this.annotationDisplay) {
const region = this.region ? this.region +"/" : "";
this.annotationEntry = {
Expand All @@ -158,9 +187,7 @@ export default {
"resource": encodeURIComponent(this.scaffoldUrl),
};
}
}
else {
this.display = false;
} else {
this.annotationEntry = { };
}
},
Expand Down
Loading