From bb4756e9398709bb4bb746da51dbb563f794e775 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Wed, 15 Jul 2026 18:00:53 +1200 Subject: [PATCH 01/20] Show long label for paths on flatmap tooltips --- src/components/viewers/Flatmap.vue | 26 +++++++++++++++++++++++++ src/components/viewers/MultiFlatmap.vue | 26 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/components/viewers/Flatmap.vue b/src/components/viewers/Flatmap.vue index 909e1879..87b137a4 100644 --- a/src/components/viewers/Flatmap.vue +++ b/src/components/viewers/Flatmap.vue @@ -41,6 +41,7 @@ @pathway-selection-changed="onPathwaySelectionChanged" @mapmanager-loaded="onMapmanagerLoaded" :showPathwayFilter="false" + :tooltipContentProvider="tooltipPathLabelProvider" @trackEvent="trackEvent" /> @@ -94,6 +95,31 @@ export default { getFlatmapImp() { return this.$refs.flatmap?.mapImp; }, + /** + * Tooltip content provider for FlatmapVuer. + * Looks up the 'long-label' from connectivity knowledge for path features. + * Only activates for path IDs (starting with 'ilxtr:' or 'ilx:'). + * Returns null (default tooltip) for non-path features or when no long-label is found. + */ + tooltipPathLabelProvider: function (featureData) { + const featureId = featureData?.id; + // Only applies to path features + if (!featureId || !(featureId.startsWith('ilxtr:') || featureId.startsWith('ilx:'))) { + return null; + } + + // Look up long-label from the connectivity store + const uuid = featureData.mapUUID; + if (uuid && this.connectivitiesStore?.globalConnectivities?.[uuid]) { + const connectivities = this.connectivitiesStore.globalConnectivities[uuid]; + const match = connectivities.find(c => c.id === featureId); + if (match && match['long-label']) { + return `
${match['long-label']}
${featureData.label || ''}
`; + } + } + + return null; // Use default tooltip + }, contextRestored(flatmap) { this.flatmapReadyForMarkerUpdates(flatmap); this.updateViewerSettings(); diff --git a/src/components/viewers/MultiFlatmap.vue b/src/components/viewers/MultiFlatmap.vue index 3ddacd8c..aa447440 100644 --- a/src/components/viewers/MultiFlatmap.vue +++ b/src/components/viewers/MultiFlatmap.vue @@ -42,6 +42,7 @@ @open-pubmed-url="onOpenPubmedUrl" @mapmanager-loaded="onMapmanagerLoaded" :showPathwayFilter="false" + :tooltipContentProvider="tooltipPathLabelProvider" @trackEvent="trackEvent" /> @@ -153,6 +154,31 @@ export default { }); } }, + /** + * Tooltip content provider for FlatmapVuer. + * Looks up the 'long-label' from connectivity knowledge for path features. + * Only activates for path IDs (starting with 'ilxtr:' or 'ilx:'). + * Returns null (default tooltip) for non-path features or when no long-label is found. + */ + tooltipPathLabelProvider: function (featureData) { + const featureId = featureData?.id; + // Only applies to path features + if (!featureId || !(featureId.startsWith('ilxtr:') || featureId.startsWith('ilx:'))) { + return null; + } + + // Look up long-label from the connectivity store + const uuid = featureData.mapUUID; + if (uuid && this.connectivitiesStore?.globalConnectivities?.[uuid]) { + const connectivities = this.connectivitiesStore.globalConnectivities[uuid]; + const match = connectivities.find(c => c.id === featureId); + if (match && match['long-label']) { + return `
${match['long-label']}
${featureData.label || ''}
`; + } + } + + return null; // Use default tooltip + }, onPathwaySelectionChanged: function (data) { const { label, property, checked, selectionsTitle } = data; // GA Tagging From f2564d9947d490b54624410a720d3ef40b9a7f5c Mon Sep 17 00:00:00 2001 From: akhuoa Date: Thu, 16 Jul 2026 10:28:17 +1200 Subject: [PATCH 02/20] Remove existing label for long-label in flatmap tooltip --- src/components/viewers/Flatmap.vue | 2 +- src/components/viewers/MultiFlatmap.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/viewers/Flatmap.vue b/src/components/viewers/Flatmap.vue index 87b137a4..91eade98 100644 --- a/src/components/viewers/Flatmap.vue +++ b/src/components/viewers/Flatmap.vue @@ -114,7 +114,7 @@ export default { const connectivities = this.connectivitiesStore.globalConnectivities[uuid]; const match = connectivities.find(c => c.id === featureId); if (match && match['long-label']) { - return `
${match['long-label']}
${featureData.label || ''}
`; + return `
${match['long-label']}
`; } } diff --git a/src/components/viewers/MultiFlatmap.vue b/src/components/viewers/MultiFlatmap.vue index aa447440..a2f4658d 100644 --- a/src/components/viewers/MultiFlatmap.vue +++ b/src/components/viewers/MultiFlatmap.vue @@ -173,7 +173,7 @@ export default { const connectivities = this.connectivitiesStore.globalConnectivities[uuid]; const match = connectivities.find(c => c.id === featureId); if (match && match['long-label']) { - return `
${match['long-label']}
${featureData.label || ''}
`; + return `
${match['long-label']}
`; } } From abe54b39cf43cbc355c2d4cf7e3ff89c3ece4a7d Mon Sep 17 00:00:00 2001 From: akhuoa Date: Thu, 16 Jul 2026 12:18:59 +1200 Subject: [PATCH 03/20] Update connectivity tooltip on flatmap with multi lines feature --- src/components/viewers/Flatmap.vue | 33 +++++++++++++++--------- src/components/viewers/MultiFlatmap.vue | 34 ++++++++++++++++--------- 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/src/components/viewers/Flatmap.vue b/src/components/viewers/Flatmap.vue index 91eade98..c4db1622 100644 --- a/src/components/viewers/Flatmap.vue +++ b/src/components/viewers/Flatmap.vue @@ -102,22 +102,31 @@ export default { * Returns null (default tooltip) for non-path features or when no long-label is found. */ tooltipPathLabelProvider: function (featureData) { - const featureId = featureData?.id; - // Only applies to path features - if (!featureId || !(featureId.startsWith('ilxtr:') || featureId.startsWith('ilx:'))) { - 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; - // Look up long-label from the connectivity store - const uuid = featureData.mapUUID; - if (uuid && this.connectivitiesStore?.globalConnectivities?.[uuid]) { - const connectivities = this.connectivitiesStore.globalConnectivities[uuid]; - const match = connectivities.find(c => c.id === featureId); - if (match && match['long-label']) { - return `
${match['long-label']}
`; + for (const feature of features) { + 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); + if (match && match['long-label']) { + longLabels.push(match['long-label']); + } } } + if (longLabels.length > 0) { + return `
${longLabels.join('
')}
`; + } + return null; // Use default tooltip }, contextRestored(flatmap) { diff --git a/src/components/viewers/MultiFlatmap.vue b/src/components/viewers/MultiFlatmap.vue index a2f4658d..6f33ae23 100644 --- a/src/components/viewers/MultiFlatmap.vue +++ b/src/components/viewers/MultiFlatmap.vue @@ -161,22 +161,32 @@ export default { * Returns null (default tooltip) for non-path features or when no long-label is found. */ tooltipPathLabelProvider: function (featureData) { - const featureId = featureData?.id; - // Only applies to path features - if (!featureId || !(featureId.startsWith('ilxtr:') || featureId.startsWith('ilx:'))) { - 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; - // Look up long-label from the connectivity store - const uuid = featureData.mapUUID; - if (uuid && this.connectivitiesStore?.globalConnectivities?.[uuid]) { - const connectivities = this.connectivitiesStore.globalConnectivities[uuid]; - const match = connectivities.find(c => c.id === featureId); - if (match && match['long-label']) { - return `
${match['long-label']}
`; + for (const feature of features) { + 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); + if (match && match['long-label']) { + longLabels.push(match['long-label']); + } } } + if (longLabels.length > 0) { + return `
${longLabels.join('
')}
`; + } + return null; // Use default tooltip }, onPathwaySelectionChanged: function (data) { From ad881d9509a45545c8920cb1a4ba8bafbc750f7d Mon Sep 17 00:00:00 2001 From: akhuoa Date: Thu, 16 Jul 2026 12:24:05 +1200 Subject: [PATCH 04/20] Refactor duplicated codes --- src/components/viewers/Flatmap.vue | 34 ------------------------ src/components/viewers/MultiFlatmap.vue | 35 ------------------------- src/mixins/ContentMixin.js | 34 ++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 69 deletions(-) diff --git a/src/components/viewers/Flatmap.vue b/src/components/viewers/Flatmap.vue index c4db1622..3a131cc4 100644 --- a/src/components/viewers/Flatmap.vue +++ b/src/components/viewers/Flatmap.vue @@ -95,40 +95,6 @@ export default { getFlatmapImp() { return this.$refs.flatmap?.mapImp; }, - /** - * Tooltip content provider for FlatmapVuer. - * Looks up the 'long-label' from connectivity knowledge for path features. - * Only activates for path IDs (starting with 'ilxtr:' or 'ilx:'). - * Returns null (default tooltip) for non-path features or when no long-label is found. - */ - tooltipPathLabelProvider: function (featureData) { - // 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; - - for (const feature of features) { - 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); - if (match && match['long-label']) { - longLabels.push(match['long-label']); - } - } - } - - if (longLabels.length > 0) { - return `
${longLabels.join('
')}
`; - } - - return null; // Use default tooltip - }, contextRestored(flatmap) { this.flatmapReadyForMarkerUpdates(flatmap); this.updateViewerSettings(); diff --git a/src/components/viewers/MultiFlatmap.vue b/src/components/viewers/MultiFlatmap.vue index 6f33ae23..586acf2c 100644 --- a/src/components/viewers/MultiFlatmap.vue +++ b/src/components/viewers/MultiFlatmap.vue @@ -154,41 +154,6 @@ export default { }); } }, - /** - * Tooltip content provider for FlatmapVuer. - * Looks up the 'long-label' from connectivity knowledge for path features. - * Only activates for path IDs (starting with 'ilxtr:' or 'ilx:'). - * Returns null (default tooltip) for non-path features or when no long-label is found. - */ - tooltipPathLabelProvider: function (featureData) { - // 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; - - for (const feature of features) { - 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); - if (match && match['long-label']) { - longLabels.push(match['long-label']); - } - } - } - - if (longLabels.length > 0) { - return `
${longLabels.join('
')}
`; - } - - return null; // Use default tooltip - }, onPathwaySelectionChanged: function (data) { const { label, property, checked, selectionsTitle } = data; // GA Tagging diff --git a/src/mixins/ContentMixin.js b/src/mixins/ContentMixin.js index b08052d0..c7337c9d 100644 --- a/src/mixins/ContentMixin.js +++ b/src/mixins/ContentMixin.js @@ -766,6 +766,40 @@ export default { trackEvent: function (data) { Tagging.sendEvent(data); }, + /** + * Tooltip content provider for FlatmapVuer. + * Looks up the 'long-label' from connectivity knowledge for path features. + * Only activates for path IDs (starting with 'ilxtr:' or 'ilx:'). + * Returns null (default tooltip) for non-path features or when no long-label is found. + */ + tooltipPathLabelProvider: function (featureData) { + // 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; + + for (const feature of features) { + 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); + if (match && match['long-label']) { + longLabels.push(match['long-label']); + } + } + } + + if (longLabels.length > 0) { + return `
${longLabels.join('
')}
`; + } + + return null; // Use default tooltip + }, }, data: function () { return { From e569c4381a71c30c8b611fe2e92387ef9973306d Mon Sep 17 00:00:00 2001 From: akhuoa Date: Thu, 16 Jul 2026 17:14:37 +1200 Subject: [PATCH 05/20] Add long label truncate toggle for flatmap tooltips --- src/App.vue | 5 ++++- src/components/MapContent.vue | 6 ++++++ src/mixins/ContentMixin.js | 20 +++++++++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 3977e04e..080aa383 100644 --- a/src/App.vue +++ b/src/App.vue @@ -24,7 +24,8 @@ Set to Wholebody Set Flatmap Set Search - Toggle Long Label + Toggle Long Label (sidebar) + Truncate Long Label (map)