@eodash/eodash 5.3.3 → 5.5.0

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.
Files changed (115) hide show
  1. package/core/client/asWebComponent.js +1 -1
  2. package/core/client/composables/DefineEodash.js +3 -1
  3. package/core/client/composables/DefineWidgets.js +12 -2
  4. package/core/client/eodashSTAC/EodashCollection.js +20 -37
  5. package/core/client/eodashSTAC/createLayers.js +306 -136
  6. package/core/client/eodashSTAC/helpers.js +60 -40
  7. package/core/client/eodashSTAC/parquet.js +2 -0
  8. package/core/client/eodashSTAC/triggers.js +5 -5
  9. package/core/client/store/actions.js +17 -17
  10. package/core/client/store/states.js +26 -4
  11. package/core/client/types.ts +12 -1
  12. package/core/client/utils/index.js +18 -1
  13. package/dist/client/{DashboardLayout-Cp8Rv3Ef.js → DashboardLayout-CkSgvaFF.js} +2 -2
  14. package/dist/client/{DynamicWebComponent-CBsxC82P.js → DynamicWebComponent-Ncsg6fb9.js} +1 -1
  15. package/dist/client/EodashChart-5v7adDpG.js +144 -0
  16. package/dist/client/{EodashDatePicker-Dewym-cx.js → EodashDatePicker-RoQJe6ss.js} +4 -4
  17. package/dist/client/{EodashItemFilter-CAsZpOoQ.js → EodashItemFilter-CCoVC5BE.js} +2 -2
  18. package/dist/client/{EodashLayerControl-fn-rt8Ac.js → EodashLayerControl-weVj7aQA.js} +2 -2
  19. package/dist/client/{EodashLayoutSwitcher-B9XqQXCS.js → EodashLayoutSwitcher-CL-Z9d5_.js} +3 -3
  20. package/dist/client/EodashMapBtns-CXU8IuPO.js +433 -0
  21. package/dist/client/{EodashStacInfo-lxBKoav9.js → EodashStacInfo-BbMnjf-n.js} +11 -15
  22. package/dist/client/{EodashTimeSlider-DI97QkNT.js → EodashTimeSlider-BZXnqfax.js} +2 -2
  23. package/dist/client/{EodashTools-D5ShUT1g.js → EodashTools-DUJlkkgx.js} +4 -4
  24. package/dist/client/{ExportState-ruNyRS2E.js → ExportState-CT3FQOHW.js} +46 -21
  25. package/dist/client/{Footer-IQNyfd78.js → Footer-D_iqP-1K.js} +1 -1
  26. package/dist/client/{Header-BBdi_-Lp.js → Header-Dzhnvsy-.js} +127 -17
  27. package/dist/client/MobileLayout-6Rg_PSO8.js +118 -0
  28. package/dist/client/{PopUp-DRgOmD7-.js → PopUp-DPPv_GSA.js} +8 -59
  29. package/dist/client/{ProcessList-DxyCFQdz.js → ProcessList-BIN_Mb27.js} +9 -13
  30. package/dist/client/{VImg-hwmwzSwG.js → VImg-DhbuvNrA.js} +2 -2
  31. package/dist/client/{VMain-vk4-rkw-.js → VMain-CVabY_NY.js} +1 -1
  32. package/dist/client/{VTooltip-BYUZeia1.js → VTooltip-Cc6au3Sn.js} +3 -4
  33. package/dist/client/{WidgetsContainer-DXD_8rqh.js → WidgetsContainer-ChqTJS4h.js} +1 -1
  34. package/dist/client/asWebComponent-DaIxULaA.js +9207 -0
  35. package/dist/client/{async-D1MvO_Z_.js → async-D6Lvv-fT.js} +15 -5
  36. package/dist/client/eo-dash.js +1 -1
  37. package/dist/client/{forwardRefs-DM-E2MfG.js → forwardRefs--IccUBdR.js} +196 -37
  38. package/dist/client/{handling-CbgeKrqT.js → handling-DSA67d6E.js} +160 -37
  39. package/dist/client/{helpers-CtUlAW0N.js → helpers-BBSdbOmv.js} +239 -126
  40. package/dist/client/{index-DBo0F4Fv.js → index-6LlXNkke.js} +5 -3
  41. package/dist/client/{index-BJvLt3Xf.js → index-BS-8Y5FE.js} +34 -77
  42. package/dist/client/{index-BkW06-Lg.js → index-CQihL_c6.js} +55 -15
  43. package/dist/client/{index-BxDh5v-H.js → index-qsZhYR_6.js} +15 -16
  44. package/dist/client/templates.js +52 -2
  45. package/dist/client/{transition-BdzATvPB.js → transition-DFr4cXu8.js} +1 -1
  46. package/dist/node/cli.js +1 -1
  47. package/dist/types/core/client/App.vue.d.ts +16 -6
  48. package/dist/types/core/client/asWebComponent.d.ts +2 -2
  49. package/dist/types/core/client/components/DashboardLayout.vue.d.ts +2 -1
  50. package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +36 -16
  51. package/dist/types/core/client/components/EodashOverlay.vue.d.ts +2 -1
  52. package/dist/types/core/client/components/ErrorAlert.vue.d.ts +9 -1
  53. package/dist/types/core/client/components/Footer.vue.d.ts +2 -1
  54. package/dist/types/core/client/components/Header.vue.d.ts +2 -1
  55. package/dist/types/core/client/components/IframeWrapper.vue.d.ts +12 -6
  56. package/dist/types/core/client/components/Loading.vue.d.ts +2 -1
  57. package/dist/types/core/client/components/MobileLayout.vue.d.ts +2 -1
  58. package/dist/types/core/client/composables/DefineEodash.d.ts +1 -1
  59. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +27 -11
  60. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +30 -23
  61. package/dist/types/core/client/eodashSTAC/helpers.d.ts +11 -4
  62. package/dist/types/core/client/store/actions.d.ts +1 -2
  63. package/dist/types/core/client/store/states.d.ts +22 -4
  64. package/dist/types/core/client/types.d.ts +7 -2
  65. package/dist/types/core/client/utils/index.d.ts +1 -0
  66. package/dist/types/core/client/views/Dashboard.vue.d.ts +20 -8
  67. package/dist/types/templates/compare.d.ts +20 -0
  68. package/dist/types/templates/expert.d.ts +30 -1
  69. package/dist/types/widgets/EodashChart.vue.d.ts +28 -0
  70. package/dist/types/widgets/EodashDatePicker.vue.d.ts +38 -9
  71. package/dist/types/widgets/EodashItemCatalog/index.vue.d.ts +88 -13
  72. package/dist/types/widgets/EodashItemCatalog/methods/map.d.ts +1 -1
  73. package/dist/types/widgets/EodashItemFilter.vue.d.ts +169 -26
  74. package/dist/types/widgets/EodashLayerControl.vue.d.ts +38 -10
  75. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +22 -7
  76. package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +94 -19
  77. package/dist/types/widgets/EodashMap/index.vue.d.ts +647 -92
  78. package/dist/types/widgets/EodashMap/methods/btns.d.ts +14 -0
  79. package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +24 -7
  80. package/dist/types/widgets/EodashProcess/index.vue.d.ts +26 -7
  81. package/dist/types/widgets/EodashProcess/methods/composables.d.ts +1 -2
  82. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +18 -11
  83. package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +2 -2
  84. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +1 -0
  85. package/dist/types/widgets/EodashStacInfo.vue.d.ts +67 -18
  86. package/dist/types/widgets/EodashTimeSlider.vue.d.ts +14 -6
  87. package/dist/types/widgets/EodashTools.vue.d.ts +437 -47
  88. package/dist/types/widgets/ExportState.vue.d.ts +26 -8
  89. package/dist/types/widgets/PopUp.vue.d.ts +61 -11
  90. package/dist/types/widgets/WidgetsContainer.vue.d.ts +22 -6
  91. package/package.json +33 -34
  92. package/templates/baseConfig.js +2 -1
  93. package/templates/compare.js +28 -1
  94. package/templates/expert.js +23 -1
  95. package/widgets/EodashChart.vue +139 -0
  96. package/widgets/EodashItemCatalog/index.vue +2 -2
  97. package/widgets/EodashItemCatalog/methods/map.js +9 -10
  98. package/widgets/EodashMap/EodashMapBtns.vue +73 -93
  99. package/widgets/EodashMap/index.vue +14 -2
  100. package/widgets/EodashMap/methods/btns.js +155 -0
  101. package/widgets/EodashMap/methods/create-layers-config.js +26 -3
  102. package/widgets/EodashMap/methods/index.js +2 -1
  103. package/widgets/EodashProcess/ProcessList.vue +2 -3
  104. package/widgets/EodashProcess/index.vue +19 -70
  105. package/widgets/EodashProcess/methods/async.js +1 -1
  106. package/widgets/EodashProcess/methods/composables.js +13 -6
  107. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +20 -7
  108. package/widgets/EodashProcess/methods/handling.js +100 -22
  109. package/widgets/EodashProcess/methods/outputs.js +44 -4
  110. package/widgets/EodashProcess/methods/utils.js +11 -1
  111. package/widgets/EodashStacInfo.vue +10 -23
  112. package/widgets/ExportState.vue +9 -15
  113. package/dist/client/EodashMapBtns-nFY6MIAX.js +0 -301
  114. package/dist/client/MobileLayout-BfBeF-JF.js +0 -118
  115. package/dist/client/asWebComponent-DdguWGDI.js +0 -8967
@@ -1,8 +1,8 @@
1
1
  import log from 'loglevel';
2
- import { s as separateEndpointLinks, c as createTiffLayerDefinition, p as pollProcessStatus, e as extractAsyncResults, u as updateJobsStatus, a as creatAsyncProcessLayerDefinitions, g as getBboxProperty, b as generateTimePairs, f as updateJsonformSchemaTarget, h as extractGeometries, i as applyProcessLayersToMap } from './async-D1MvO_Z_.js';
3
- import { j as axios, a as extractLayerConfig, H as compareIndicator, F as indicator, x as extractCollectionUrls, G as currentCompareUrl, A as currentUrl, y as generateLinksFromItems, n as getDatetimeProperty, B as datetime, I as comparePoi, C as poi } from './helpers-CtUlAW0N.js';
2
+ import { s as separateEndpointLinks, c as createTiffLayerDefinition, p as pollProcessStatus, e as extractAsyncResults, u as updateJobsStatus, a as creatAsyncProcessLayerDefinitions, b as getBboxProperty, f as generateTimePairs, h as updateJsonformSchemaTarget, i as extractGeometries, j as applyProcessLayersToMap, g as getDrawToolsProperty } from './async-D6Lvv-fT.js';
3
+ import { d as axios, b as extractLayerConfig, I as compareIndicator, G as indicator, y as extractCollectionUrls, H as currentCompareUrl, B as currentUrl, z as generateLinksFromItems, o as getDatetimeProperty, J as comparePoi, C as datetime, w as getLayers, Z as compareChartData, _ as chartData, O as compareChartSpec, N as chartSpec, D as poi } from './helpers-BBSdbOmv.js';
4
4
  import mustache from 'mustache';
5
- import { Q as isFirstLoad, E as useSTAcStore, S as readParquetItems, T as useGetSubCodeId } from './asWebComponent-DdguWGDI.js';
5
+ import { Q as isFirstLoad, E as useSTAcStore, T as readParquetItems, U as useGetSubCodeId } from './asWebComponent-DaIxULaA.js';
6
6
  import { toAbsolute } from 'stac-js/src/http.js';
7
7
 
8
8
  ////// --- CHARTS --- //////
@@ -17,7 +17,7 @@ import { toAbsolute } from 'stac-js/src/http.js';
17
17
  * @param {Record<string,any>} options.jsonformSchema
18
18
  * @param {import("vue").Ref<import("../types").AsyncJob[]>} options.jobs
19
19
  * @param {boolean} [options.enableCompare=false] - Whether to enable compare mode
20
- * @returns {Promise<[import("@eox/chart").EOxChart["spec"] | null,Record<string,any>|null]>}
20
+ * @returns {Promise<[import("vega-embed").VisualizationSpec | null,Record<string,any>|null]>}
21
21
  **/
22
22
  async function processCharts({
23
23
  links,
@@ -61,10 +61,48 @@ async function processCharts({
61
61
  if (data && data.length) {
62
62
  //@ts-expect-error we assume data to exist in spec
63
63
  spec.data.values = data;
64
- return [spec, dataValues];
64
+ return [structuredClone(spec), structuredClone(dataValues)];
65
65
  }
66
-
67
66
  const dataLinks = standardLinks.filter((link) => link.rel === "service");
67
+
68
+ // We count if there are at least two application/json links, if yes,
69
+ // we download the data and assign them to specific data ids in the spec
70
+ const jsonLinks = dataLinks.filter(
71
+ (link) => link.type === "application/json",
72
+ );
73
+ if (jsonLinks.length >= 2) {
74
+ for (const link of jsonLinks ?? []) {
75
+ let linkType = link.type;
76
+ switch (linkType) {
77
+ case undefined:
78
+ continue;
79
+ case "application/json":
80
+ dataValues[/** @type {string} */ (link.id)] = await axios
81
+ .get(
82
+ mustache.render(link.href, {
83
+ ...(jsonformValue ?? {}),
84
+ }),
85
+ )
86
+ .then((resp) => resp.data);
87
+ // assign to spec datasets, assuming spec.data is InlineData
88
+ // Always assign values as an object with string keys
89
+ if (spec.data) {
90
+ /** @type {import("vega-lite/build/src/data").InlineData} */
91
+ (spec.data).values = {
92
+ ...(spec.data &&
93
+ "values" in spec.data &&
94
+ typeof spec.data.values === "object"
95
+ ? spec.data.values
96
+ : {}),
97
+ [/** @type {string} */ (link.id)]:
98
+ dataValues[/** @type {string} */ (link.id)],
99
+ };
100
+ }
101
+ break;
102
+ }
103
+ }
104
+ return [spec, dataValues];
105
+ }
68
106
  try {
69
107
  checkForData: for (const link of dataLinks ?? []) {
70
108
  switch (link.type) {
@@ -91,7 +129,7 @@ async function processCharts({
91
129
  } catch (e) {
92
130
  console.error("[eodash] Error while injecting Vega data", e);
93
131
  }
94
- return [spec, dataValues];
132
+ return [structuredClone(spec), structuredClone(dataValues)];
95
133
  }
96
134
 
97
135
  /**
@@ -797,7 +835,9 @@ async function handleVedaEndpoint({
797
835
  enableCompare = false,
798
836
  }) {
799
837
  const vedaLink = links.find(
800
- (link) => link.rel === "service" && link.endpoint === "veda",
838
+ (link) =>
839
+ link.rel === "service" &&
840
+ (link.endpoint === "veda" || link.endpoint === "veda_stac"),
801
841
  );
802
842
  if (!vedaLink) {
803
843
  return;
@@ -810,12 +850,17 @@ async function handleVedaEndpoint({
810
850
  const configs = await fetchVedaCOGsConfig(
811
851
  selectedStac,
812
852
  enableCompare ? currentCompareUrl.value : currentUrl.value,
853
+ vedaLink,
813
854
  );
814
855
  // TODO: convert jsonform bbox type to geojson in the schema to avoid the conversion here
815
856
  return await Promise.all(
816
857
  configs.map(({ endpoint, datetime }) => {
858
+ const url = new URL(vedaEndpoint);
859
+ const key = vedaLink.endpoint === "veda_stac" ? "ids" : "url";
860
+ url.searchParams.set(key, endpoint);
861
+
817
862
  return axios
818
- .post(vedaEndpoint + `?url=${endpoint}`, {
863
+ .post(url.toString(), {
819
864
  ...{
820
865
  type: "Feature",
821
866
  properties: {},
@@ -841,8 +886,9 @@ async function handleVedaEndpoint({
841
886
  * Fetches the COGs endpoints from the STAC collections
842
887
  * @param {import("stac-ts").StacCollection} selectedStac
843
888
  * @param {string} absoluteUrl
889
+ * @param {import("stac-ts").StacLink} vedaLink
844
890
  */
845
- async function fetchVedaCOGsConfig(selectedStac, absoluteUrl) {
891
+ async function fetchVedaCOGsConfig(selectedStac, absoluteUrl, vedaLink) {
846
892
  // retrieve the collections from the indicator
847
893
  const collectionLinks = selectedStac.links.filter(
848
894
  (link) => link.rel == "child",
@@ -888,10 +934,15 @@ async function fetchVedaCOGsConfig(selectedStac, absoluteUrl) {
888
934
  );
889
935
  const itemLinks = collection.links.filter((link) => link.rel == "item");
890
936
  configs.push(
891
- ...itemLinks.map((link) => ({
892
- endpoint: /** @type {string} */ (link["cog_href"]),
893
- datetime: /** @type string **/ (link[datetimeProperty]),
894
- })),
937
+ ...itemLinks.map((link) => {
938
+ const endpoint = /** @type {string} */ (
939
+ vedaLink.endpoint === "veda_stac" ? link.id : link["cog_href"]
940
+ );
941
+ return {
942
+ endpoint,
943
+ datetime: /** @type string **/ (link[datetimeProperty]),
944
+ };
945
+ }),
895
946
  );
896
947
  }
897
948
 
@@ -956,7 +1007,6 @@ function createCustomChartEndpointsHandler(callbacks) {
956
1007
  * @param {import("vue").Ref<import("stac-ts").StacCollection | null>} params.selectedStac
957
1008
  * @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} params.jsonformEl
958
1009
  * @param {import("vue").Ref<Record<string,any> | null>} params.jsonformSchema
959
- * @param {import("vue").Ref<import("@eox/chart").EOxChart["spec"] | null>} params.chartSpec
960
1010
  * @param {import("vue").Ref<any[]>} params.processResults
961
1011
  * @param {import("vue").Ref<boolean>} params.isProcessed
962
1012
  * @param {import("vue").Ref<boolean>} params.loading
@@ -967,7 +1017,6 @@ async function initProcess({
967
1017
  selectedStac,
968
1018
  jsonformEl,
969
1019
  jsonformSchema,
970
- chartSpec,
971
1020
  isProcessed,
972
1021
  processResults,
973
1022
  loading,
@@ -990,14 +1039,21 @@ async function initProcess({
990
1039
  resetProcess({
991
1040
  loading,
992
1041
  isProcessed,
993
- chartSpec,
994
1042
  jsonformSchema,
995
1043
  isPolling,
996
1044
  processResults,
1045
+ enableCompare,
997
1046
  });
998
1047
 
999
1048
  await jsonformEl.value?.editor.destroy();
1000
1049
  if (updatedJsonform) {
1050
+ // make sure correct target layer id is used in jsonform
1051
+ if (updatedJsonform.properties?.feature?.options?.drawtools?.layerId) {
1052
+ await updateJsonformIdentifier({
1053
+ jsonformSchema,
1054
+ newLayers: await getLayers(),
1055
+ });
1056
+ }
1001
1057
  if (enableCompare) {
1002
1058
  updatedJsonform = updateJsonformSchemaTarget(updatedJsonform);
1003
1059
  }
@@ -1005,6 +1061,74 @@ async function initProcess({
1005
1061
  }
1006
1062
  }
1007
1063
 
1064
+ /**
1065
+ * Update the jsonform schema to have the correct layer id from the map
1066
+ *
1067
+ * @export
1068
+ * @async
1069
+ * @param {Object} params
1070
+ * @param {import("vue").Ref<Record<string,any> | null>} params.jsonformSchema params.jsonformSchema
1071
+ * @param {Record<string, any>[] | undefined} params.newLayers params.newLayers
1072
+ */
1073
+ async function updateJsonformIdentifier({ jsonformSchema, newLayers }) {
1074
+ const form = jsonformSchema.value;
1075
+ if (!form) {
1076
+ return;
1077
+ }
1078
+ const drawToolsProperty = getDrawToolsProperty(form);
1079
+ if (
1080
+ drawToolsProperty &&
1081
+ newLayers &&
1082
+ form?.properties[drawToolsProperty]?.options?.drawtools?.layerId
1083
+ ) {
1084
+ // get partial or full id and try to match with correct eoxmap layer
1085
+ // check if newLayers is an array or an object with layers property
1086
+ let layers = newLayers;
1087
+ // @ts-expect-error TODO payload coming from time update sometimes is not an object with layers property
1088
+ if (newLayers.layers && Array.isArray(newLayers.layers)) {
1089
+ // @ts-expect-error TODO payload coming from time update sometimes is not an object with layers property
1090
+ layers = newLayers.layers;
1091
+ }
1092
+
1093
+ const layerId =
1094
+ form.properties[drawToolsProperty].options.drawtools.layerId.split(
1095
+ ";:;",
1096
+ )[0];
1097
+ let matchedLayerId = null;
1098
+ // layers are not flat can be grouped, we need to recursively search
1099
+ const traverseLayers = (
1100
+ /** @type {Record<string, any>[] | undefined} */ layersArray,
1101
+ ) => {
1102
+ if (!layersArray) {
1103
+ return;
1104
+ }
1105
+ for (const layer of layersArray) {
1106
+ if (layer.layers) {
1107
+ // @ts-expect-error TODO payload coming from time update events is not an object with layers property
1108
+ traverseLayers(layer);
1109
+ } else {
1110
+ if (layer.properties?.id?.startsWith(layerId)) {
1111
+ matchedLayerId = layer.properties.id;
1112
+ break;
1113
+ }
1114
+ }
1115
+ }
1116
+ };
1117
+ traverseLayers(layers);
1118
+ if (matchedLayerId) {
1119
+ form.properties.feature.options.drawtools.layerId = matchedLayerId;
1120
+ // trigger jsonform update in next tick
1121
+ jsonformSchema.value = null;
1122
+ await new Promise((resolve) => setTimeout(resolve, 0));
1123
+ jsonformSchema.value = form;
1124
+ } else {
1125
+ throw new Error(
1126
+ `Could not find matching layer for processing form with id: ${layerId}`,
1127
+ );
1128
+ }
1129
+ }
1130
+ }
1131
+
1008
1132
  /**
1009
1133
  *
1010
1134
  * @param {object} params
@@ -1012,8 +1136,6 @@ async function initProcess({
1012
1136
  * @param {import("vue").Ref<import("stac-ts").StacCollection | null>} params.selectedStac
1013
1137
  * @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} params.jsonformEl
1014
1138
  * @param {import("vue").Ref<Record<string,any>|null>} params.jsonformSchema
1015
- * @param {import("vue").Ref<import("@eox/chart").EOxChart["spec"] | null>} params.chartSpec
1016
- * @param {import("vue").Ref<Record<string, any> | null>} params.chartData
1017
1139
  * @param {import("vue").Ref<boolean>} params.isPolling
1018
1140
  * @param {import("vue").Ref<any[]>} params.processResults
1019
1141
  * @param {import("@eox/map").EOxMap | null} params.mapElement
@@ -1024,8 +1146,6 @@ async function handleProcesses({
1024
1146
  selectedStac,
1025
1147
  jsonformEl,
1026
1148
  jsonformSchema,
1027
- chartSpec,
1028
- chartData,
1029
1149
  isPolling,
1030
1150
  processResults,
1031
1151
  mapElement,
@@ -1034,6 +1154,7 @@ async function handleProcesses({
1034
1154
  if (!jsonformEl.value || !jsonformSchema.value || !selectedStac.value) {
1035
1155
  return;
1036
1156
  }
1157
+ const enableCompare = mapElement?.id === "compare";
1037
1158
 
1038
1159
  log.debug("Processing...");
1039
1160
  loading.value = true;
@@ -1055,12 +1176,14 @@ async function handleProcesses({
1055
1176
  selectedStac.value?.["eodash:vegadefinition"]
1056
1177
  );
1057
1178
  const layerId = selectedStac.value?.id ?? "";
1058
-
1059
- [chartSpec.value, chartData.value] = await processCharts({
1179
+ const usedChartSpec = enableCompare ? compareChartSpec : chartSpec;
1180
+ const usedChartData = enableCompare ? compareChartData : chartData;
1181
+ let tempChartSpec = null;
1182
+ [tempChartSpec, usedChartData.value] = await processCharts({
1060
1183
  links: serviceLinks,
1061
1184
  jsonformValue: { ...(jsonformValue ?? {}) },
1062
1185
  jsonformSchema: jsonformSchema.value,
1063
- enableCompare: mapElement?.id === "compare",
1186
+ enableCompare,
1064
1187
  selectedStac: selectedStac.value,
1065
1188
  specUrl,
1066
1189
  isPolling,
@@ -1068,19 +1191,19 @@ async function handleProcesses({
1068
1191
  customEndpointsHandler: handleChartCustomEndpoints,
1069
1192
  });
1070
1193
 
1071
- if (Object.keys(chartData.value ?? {}).length) {
1072
- processResults.value.push(chartData.value);
1194
+ if (Object.keys(usedChartData.value ?? {}).length) {
1195
+ processResults.value.push(usedChartData.value);
1073
1196
  }
1074
1197
 
1075
1198
  //@ts-expect-error we assume that the spec data is of type InlineData
1076
- if (chartSpec.value?.data?.values?.length) {
1199
+ if (tempChartSpec.data?.values?.length) {
1077
1200
  //@ts-expect-error we assume that the spec data is of type InlineData
1078
- processResults.value.push(chartSpec.value?.data.values);
1201
+ processResults.value.push(tempChartSpec?.data.values);
1079
1202
  }
1080
-
1081
- if (chartSpec.value && !("background" in chartSpec.value)) {
1082
- chartSpec.value["background"] = "transparent";
1203
+ if (tempChartSpec && !("background" in tempChartSpec)) {
1204
+ tempChartSpec["background"] = "transparent";
1083
1205
  }
1206
+ usedChartSpec.value = tempChartSpec;
1084
1207
 
1085
1208
  await processSTAC(
1086
1209
  serviceLinks,
@@ -1131,23 +1254,24 @@ async function handleProcesses({
1131
1254
  * @param {Object} params
1132
1255
  * @param {import("vue").Ref<boolean>} params.loading
1133
1256
  * @param {import("vue").Ref<boolean>} params.isProcessed
1134
- * @param {import("vue").Ref<import("@eox/chart").EOxChart["spec"] | null>} params.chartSpec
1135
1257
  * @param {import("vue").Ref<boolean>} params.isPolling
1136
1258
  * @param {import("vue").Ref<any[]>} params.processResults
1137
1259
  * @param {import("vue").Ref<Record<string,any>|null>} params.jsonformSchema
1260
+ * @param {boolean} params.enableCompare
1138
1261
  */
1139
1262
  function resetProcess({
1140
1263
  loading,
1141
1264
  isProcessed,
1142
- chartSpec,
1143
1265
  jsonformSchema,
1144
1266
  processResults,
1145
1267
  isPolling,
1268
+ enableCompare,
1146
1269
  }) {
1147
1270
  loading.value = false;
1148
1271
  isProcessed.value = false;
1149
1272
  isPolling.value = false;
1150
- chartSpec.value = null;
1273
+ const usedChartSpec = enableCompare ? compareChartSpec : chartSpec;
1274
+ usedChartSpec.value = null;
1151
1275
  processResults.value = [];
1152
1276
  jsonformSchema.value = null;
1153
1277
  }
@@ -1166,8 +1290,7 @@ const onChartClick = (evt) => {
1166
1290
  const chartSpec = evt.target?.spec;
1167
1291
  if (
1168
1292
  !chartSpec ||
1169
- !evt.detail?.item?.datum ||
1170
- !evt.detail?.item?.datum.datum
1293
+ (!evt.detail?.item?.datum && !evt.detail?.item?.datum.datum)
1171
1294
  ) {
1172
1295
  return;
1173
1296
  }
@@ -1230,4 +1353,4 @@ const loadPOiIndicator = () => {
1230
1353
  }
1231
1354
  };
1232
1355
 
1233
- export { handleProcesses as h, initProcess as i, loadPOiIndicator as l, onChartClick as o };
1356
+ export { handleProcesses as h, initProcess as i, loadPOiIndicator as l, onChartClick as o, updateJsonformIdentifier as u };