@abi-software/mapintegratedvuer 1.24.0 → 1.24.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/mapintegratedvuer",
3
- "version": "1.24.0",
3
+ "version": "1.24.1",
4
4
  "license": "Apache-2.0",
5
5
  "engines": {
6
6
  "node": "^24.20.0"
@@ -705,8 +705,10 @@ export default {
705
705
  let validNerves = [];
706
706
 
707
707
  if (!this.connectivityKnowledge[sckanVersion]) {
708
- this.flatmapQueries = markRaw(new FlatmapQueries());
709
- this.flatmapQueries.initialise(this.flatmapAPI);
708
+ if (!this.flatmapQueries) {
709
+ this.flatmapQueries = markRaw(new FlatmapQueries());
710
+ this.flatmapQueries.initialise(this.flatmapAPI);
711
+ }
710
712
  const knowledge = await loadAndStoreKnowledge(flatmapImp, this.flatmapQueries);
711
713
  this.connectivityKnowledge[sckanVersion] = knowledge
712
714
  .filter((item) => item.connectivity?.length)
@@ -783,10 +785,8 @@ export default {
783
785
  EventBus.emit('species-layout-connectivity-update');
784
786
  },
785
787
  knowledgeTooltipQuery: async function (data) {
786
- await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.flatmapService.mapImp, {
787
- resource: [data.id],
788
- });
789
- let tooltip = await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp, {
788
+ // queryTooltipData does not share state between queries, so it can run in parallel
789
+ let tooltip = await this.flatmapQueries.queryTooltipData(this.flatmapService.mapImp, {
790
790
  resource: [data.id],
791
791
  label: data.label,
792
792
  provenanceTaxonomy: data.taxons,
@@ -806,12 +806,10 @@ export default {
806
806
  );
807
807
  EventBus.emit('connectivity-info-open', this.tooltipEntry);
808
808
 
809
- let prom1 = [];
810
809
  // While having placeholders displayed, get details for all paths and then replace.
811
- for (let index = 0; index < payload.data.length; index++) {
812
- prom1.push(await this.knowledgeTooltipQuery(payload.data[index]));
813
- }
814
- this.tooltipEntry = await Promise.all(prom1);
810
+ this.tooltipEntry = await Promise.all(
811
+ payload.data.map((data) => this.knowledgeTooltipQuery(data)),
812
+ );
815
813
  const featureIds = this.tooltipEntry.map((tooltip) => tooltip.featureId[0]);
816
814
  if (featureIds.length > 0) {
817
815
  EventBus.emit('connectivity-info-open', this.tooltipEntry);