Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bb4756e
Show long label for paths on flatmap tooltips
akhuoa Jul 15, 2026
f2564d9
Remove existing label for long-label in flatmap tooltip
akhuoa Jul 15, 2026
abe54b3
Update connectivity tooltip on flatmap with multi lines feature
akhuoa Jul 16, 2026
ad881d9
Refactor duplicated codes
akhuoa Jul 16, 2026
e569c43
Add long label truncate toggle for flatmap tooltips
akhuoa Jul 16, 2026
b4feeb5
Show long labels on map only if showLongLabel is true
akhuoa Jul 16, 2026
401579b
Capitalise long labels
akhuoa Jul 16, 2026
deb25c1
Update demo app options popup close on button clicks
akhuoa Jul 16, 2026
7df5019
Update demo app for show long label buttton
akhuoa Jul 16, 2026
d3cd286
Update line clamp on long labels
akhuoa Jul 16, 2026
f4fe701
Update long label truncate lines
akhuoa Jul 23, 2026
3577889
Update long labels with id tags
akhuoa Jul 23, 2026
1b6061d
Make ID in tooltip as option
akhuoa Jul 23, 2026
5bf92f7
Fix mouse over features unique
akhuoa Jul 23, 2026
6c072a7
Update demo app options
akhuoa Jul 23, 2026
6d74f09
Merge branch 'ABI-Software:main' into feature/long-label-tooltip
akhuoa Jul 23, 2026
faf107e
Fix typo in comment
akhuoa Jul 24, 2026
5fd74d8
Update flatmap tooltip for long label
akhuoa Jul 24, 2026
8a7fd13
Make long label in sidebar always available
akhuoa Jul 27, 2026
ae09efb
Make truncate long label as default
akhuoa Aug 4, 2026
1da84c1
Merge branch 'ABI-Software:main' into feature/long-label-tooltip
akhuoa Aug 4, 2026
f7ff41b
Merge remote-tracking branch 'upstream/main' into feature/long-label-…
alan-wu Aug 5, 2026
732a1e9
Merge branch 'ABI-Software:main' into feature/long-label-tooltip
akhuoa Aug 6, 2026
fcf0225
Update flatmapvuer to 1.14.1
alan-wu Aug 6, 2026
6cb4080
Merge remote-tracking branch 'aung/feature/long-label-tooltip' into f…
alan-wu Aug 6, 2026
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
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"*.js"
],
"dependencies": {
"@abi-software/flatmapvuer": "1.14.0",
"@abi-software/flatmapvuer": "^1.14.1",
"@abi-software/map-side-bar": "2.16.0",
"@abi-software/map-utilities": "1.9.0",
"@abi-software/plotvuer": "1.1.0",
Expand Down
82 changes: 58 additions & 24 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,46 @@
href="https://fonts.googleapis.com/css?family=Asap:400,400i,500,600,700&display=swap">
<div class="button-container">
<el-popover
ref="optionsPopover"
placement="bottom"
trigger="click"
width=500
class="popover"
:teleported=false
>
<div class="options-container">
<div class="row">
<el-button @click="saveSettings()" size="small">Save Settings</el-button>
<el-button @click="restoreSettings()" size="small">Restore Settings</el-button>
<el-button @click="getShareableURL()" size="small">Get Link</el-button>
</div>
<div class="row">
<el-button @click="setRatFlatmap()" size="small">Set Rat Flatmap</el-button>
<el-button @click="setMultiFlatmap()" size="small">Set MultiFlatmap</el-button>
<el-button @click="setLegacyMultiFlatmap()" size="small">Set Legacy MultiFlatmap</el-button>
<el-button @click="setScaffold()" size="small">Set To Scaffold</el-button>
<el-button @click="setWholebody()" size="small">Set to Wholebody</el-button>
<el-button @click="setFlatmap()" size="small">Set Flatmap</el-button>
<el-button @click="setSearch()" size="small">Set Search</el-button>
<el-button @click="toggleLongLabel()" size="small">Toggle Long Label</el-button>
</div>
>
<div class="options-container">
<div class="row">
<el-button @click="saveSettings()" size="small">Save Settings</el-button>
<el-button @click="restoreSettings()" size="small">Restore Settings</el-button>
<el-button @click="getShareableURL()" size="small">Get Link</el-button>
</div>
<template #reference>

<el-button class="options-button" :icon="ElIconSetting">Options</el-button>

</template>
<div class="row">
<el-button @click="setRatFlatmap()" size="small">Set Rat Flatmap</el-button>
<el-button @click="setMultiFlatmap()" size="small">Set MultiFlatmap</el-button>
<el-button @click="setLegacyMultiFlatmap()" size="small">Set Legacy MultiFlatmap</el-button>
<el-button @click="setScaffold()" size="small">Set To Scaffold</el-button>
<el-button @click="setWholebody()" size="small">Set to Wholebody</el-button>
<el-button @click="setFlatmap()" size="small">Set Flatmap</el-button>
<el-button @click="setSearch()" size="small">Set Search</el-button>
</div>
<div class="row">
<div style="font-weight: 600">Connectivity tooltip labels:</div>
</div>
<div class="row">
<el-checkbox @change="onShowLongLabelChange" v-model="showLongLabel" size="small">
Show long label
</el-checkbox>
<el-checkbox @change="onTruncateLongLabelChange" :disabled="!showLongLabel" v-model="truncateLongLabel" size="small">
Truncate long label
</el-checkbox>
<el-checkbox @change="onShowIdInTooltipChange" :disabled="!showLongLabel" v-model="showIdInTooltip" size="small">
Show ID in tooltip
</el-checkbox>
</div>
</div>
<template #reference>
<el-button class="options-button" :icon="ElIconSetting">Options</el-button>
</template>
</el-popover>
</div>
<div class="map-app">
Expand All @@ -42,6 +54,8 @@
:options="options"
:state="state"
:showLongLabel="showLongLabel"
:truncateLongLabel="truncateLongLabel"
:showIdInTooltip="showIdInTooltip"
:shareLink="shareLink"
:useHelpModeDialog="true"
:connectivityInfoSidebar="true"
Expand Down Expand Up @@ -161,6 +175,8 @@ export default {
ElIconSetting: shallowRef(ElIconSetting),
routerIsReady: false,
showLongLabel: true,
truncateLongLabel: true,
showIdInTooltip: true,
}
},
computed: {
Expand All @@ -182,6 +198,11 @@ export default {
}
},
methods: {
closePopover: function() {
if (this.$refs.optionsPopover) {
this.$refs.optionsPopover.hide();
}
},
changeViewingMode: function(modeName) {
this.$refs.map.changeViewingMode(modeName);
},
Expand Down Expand Up @@ -261,6 +282,7 @@ export default {
label: "Functional"
}
);
this.closePopover();
},
setLegacyMultiFlatmap: function() {
this.$refs.map.setCurrentEntry(
Expand All @@ -270,6 +292,7 @@ export default {
uuid: "01fedbf9-d783-509c-a10c-827941ab13da",
}
);
this.closePopover();
},
setMultiFlatmap: function() {
this.$refs.map.setCurrentEntry(
Expand All @@ -281,6 +304,7 @@ export default {
organ: "UBERON:0018675"
}
);
this.closePopover();
},
setRatFlatmap: function() {
this.$refs.map.setCurrentEntry(
Expand All @@ -289,6 +313,7 @@ export default {
taxo: "NCBITaxon:10114"
}
);
this.closePopover();
},
setScaffold: function() {
this.$refs.map.setCurrentEntry(
Expand All @@ -299,6 +324,7 @@ export default {
viewUrl: "colonMouse_Layout1_view.json"
}
);
this.closePopover();
},
setWholebody: function() {
this.$refs.map.setCurrentEntry(
Expand All @@ -308,12 +334,20 @@ export default {
isBodyScaffold: true
}
);
this.closePopover();
},
setSearch: function() {
this.$refs.map.openSearch([], "10.26275/1uno-tynt");
this.closePopover();
},
onShowLongLabelChange: function() {
this.closePopover();
},
onTruncateLongLabelChange: function() {
this.closePopover();
},
toggleLongLabel: function() {
this.showLongLabel = !this.showLongLabel;
onShowIdInTooltipChange: function() {
this.closePopover();
},
mapIsLoaded: function(map) {
console.log("map is loaded", map)
Expand Down
11 changes: 11 additions & 0 deletions src/components/MapContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<script>
/* eslint-disable no-alert, no-console */
import { computed } from 'vue';
import Tagging from '../services/tagging.js';
import SplitFlow from './SplitFlow.vue';
import EventBus from './EventBus';
Expand Down Expand Up @@ -64,6 +65,14 @@ export default {
type: Boolean,
default: true,
},
truncateLongLabel: {
type: Boolean,
default: true,
},
showIdInTooltip: {
type: Boolean,
default: true,
},
/**
* The options include APIs and Keys.
*/
Expand Down Expand Up @@ -133,6 +142,8 @@ export default {
return {
showGlobalSettings: this.showGlobalSettings,
showOpenMapButton: this.showOpenMapButton,
truncateLongLabel: computed(() => this.truncateLongLabel),
showIdInTooltip: computed(() => this.showIdInTooltip),
};
},
data: function () {
Expand Down
11 changes: 6 additions & 5 deletions src/components/SplitFlow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
:connectivityKnowledge="connectivityKnowledge"
:filterOptions="filterOptions"
:showVisibilityFilter="showVisibilityFilter"
:showLongLabel="showLongLabel"
:showLongLabel="true"
@tabClicked="onSidebarTabClicked"
@tabClosed="onSidebarTabClosed"
@actionClick="actionClick"
Expand Down Expand Up @@ -67,7 +67,7 @@

<script>
/* eslint-disable no-alert, no-console */
import { provide, markRaw } from 'vue'
import { provide, markRaw, computed } from 'vue';
import Tagging from '../services/tagging.js';
import DialogToolbarContent from "./DialogToolbarContent.vue";
import EventBus from "./EventBus";
Expand Down Expand Up @@ -141,12 +141,13 @@ export default {
SplitDialog,
SideBar,
},
setup() {
setup(props) {
const mainStore = useMainStore();
provide('userApiKey', mainStore.userToken);
const settings = useSettingsStore();
let annotator = markRaw(new AnnotationService(`${settings.flatmapAPI}annotator`));
provide('$annotator', annotator)
provide('userApiKey', mainStore.userToken);
provide('$annotator', annotator);
provide('showLongLabel', computed(() => props.showLongLabel));
return { annotator }
},
props: {
Expand Down
3 changes: 2 additions & 1 deletion src/components/viewers/Flatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
@pathway-selection-changed="onPathwaySelectionChanged"
@mapmanager-loaded="onMapmanagerLoaded"
:showPathwayFilter="false"
:tooltipContentProvider="tooltipPathLabelProvider"
@trackEvent="trackEvent"
/>

Expand Down Expand Up @@ -86,7 +87,7 @@ export default {
},
/**
* Perform a local search on this contentvuer
* This is similar to directly clicking onthe map
* This is similar to directly clicking on the map
*/
search: function (term) {
return this.$refs.flatmap.searchAndShowResult(term, true, true);
Expand Down
1 change: 1 addition & 0 deletions src/components/viewers/MultiFlatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
@open-pubmed-url="onOpenPubmedUrl"
@mapmanager-loaded="onMapmanagerLoaded"
:showPathwayFilter="false"
:tooltipContentProvider="tooltipPathLabelProvider"
@trackEvent="trackEvent"
/>

Expand Down
82 changes: 81 additions & 1 deletion src/mixins/ContentMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,23 @@ export default {
default: false,
},
},
inject: ['showGlobalSettings', 'showOpenMapButton'],
inject: {
showGlobalSettings: {
default: true,
},
showOpenMapButton: {
default: true,
},
showLongLabel: {
default: true,
},
truncateLongLabel: {
default: true,
},
showIdInTooltip: {
default: true,
},
},
computed: {
...mapStores(useEntriesStore, useSettingsStore, useSplitFlowStore, useConnectivitiesStore),
idNamePair() {
Expand Down Expand Up @@ -776,6 +792,70 @@ export default {
trackEvent: function (data) {
Tagging.sendEvent(data);
},
/**
* Provides custom tooltip content for FlatmapVuer path features.
* Uses connectivity 'long-label' values for IDs starting with 'ilxtr:' or 'ilx:'.
* Returns null to use the default tooltip when long labels are disabled or unavailable.
*/
tooltipPathLabelProvider: function (featureData) {
const showLong = this.showLongLabel?.value ?? this.showLongLabel;
if (!showLong) {
return null;
}

// Handle both single feature data object and array of feature data (multi-feature case)
const features = Array.isArray(featureData) ? featureData : [featureData];
const longLabels = [];
const uuid = features[0]?.mapUUID;
const connectivities = uuid ? this.connectivitiesStore?.globalConnectivities?.[uuid] : null;

// Make features unique by it's id.
const uniqueFeatures = features.filter((feature, index, self) =>
index === self.findIndex((f) => f.id === feature.id)
);

for (const feature of uniqueFeatures) {
const featureId = feature?.id;
// Only applies to path features
if (!featureId || !(featureId.startsWith('ilxtr:') || featureId.startsWith('ilx:'))) {
continue;
}
// Look up long-label from the connectivity store
if (connectivities) {
const match = connectivities.find(c => c.id === featureId);
const truncate = this.truncateLongLabel?.value ?? this.truncateLongLabel;
const lineClamp = 3;
const withIdStyles = [
`margin-bottom: 4px`,
];
const truncateStyles = [
`display: -webkit-box`,
`-webkit-line-clamp: ${lineClamp}`,
`-webkit-box-orient: vertical`,
`overflow: hidden`,
];
const styles = [
...(this.showIdInTooltip ? withIdStyles : []),
...(truncate ? truncateStyles : [])
].join(';');

if (match && match['long-label']) {
let labelTag = []
labelTag.push(`<div style="${styles}">${capitalise(match['long-label'])}</div>`);
if (this.showIdInTooltip) {
labelTag.push(`<span class="id-tag">${featureId}</span>`);
}
longLabels.push(labelTag.join(''));
}
}
}

if (longLabels.length > 0) {
return `<div class='flatmap-feature-label flatmap-connectivity-label'>${longLabels.join('<hr/>')}</div>`;
}

return null; // Use default tooltip
},
},
data: function () {
return {
Expand Down