@eodash/eodash 5.0.0 → 5.2.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.
- package/README.md +1 -0
- package/core/client/App.vue +8 -2
- package/core/client/asWebComponent.js +5 -5
- package/core/client/components/DashboardLayout.vue +43 -26
- package/core/client/components/EodashOverlay.vue +5 -6
- package/core/client/components/ErrorAlert.vue +2 -2
- package/core/client/components/Footer.vue +4 -4
- package/core/client/components/Header.vue +3 -3
- package/core/client/components/MobileLayout.vue +47 -27
- package/core/client/composables/DefineEodash.js +38 -43
- package/core/client/composables/DefineTemplate.js +4 -2
- package/core/client/composables/DefineWidgets.js +14 -8
- package/core/client/composables/index.js +273 -23
- package/core/client/eodashSTAC/EodashCollection.js +84 -62
- package/core/client/eodashSTAC/createLayers.js +30 -0
- package/core/client/eodashSTAC/helpers.js +159 -28
- package/core/client/eodashSTAC/parquet.js +145 -0
- package/core/client/eodashSTAC/triggers.js +6 -3
- package/core/client/plugins/index.js +4 -3
- package/core/client/plugins/vuetify.js +3 -0
- package/core/client/store/actions.js +21 -4
- package/core/client/store/stac.js +93 -56
- package/core/client/store/states.js +15 -5
- package/core/client/types.ts +59 -43
- package/core/client/utils/index.js +79 -0
- package/core/client/utils/keys.js +2 -2
- package/core/client/utils/states.js +30 -5
- package/core/client/views/Dashboard.vue +36 -32
- package/core/client/vite-env.d.ts +7 -0
- package/dist/client/{DashboardLayout-CkWvOMOW.js → DashboardLayout-Dq9Kfe6O.js} +24 -13
- package/dist/client/{DynamicWebComponent-DYBbpvUK.js → DynamicWebComponent-DCBMXskE.js} +1 -1
- package/dist/client/{EodashDatePicker-CALmW3SI.js → EodashDatePicker-DtngxU6s.js} +59 -32
- package/dist/client/{EodashItemFilter-DlQiE713.js → EodashItemFilter-ClQebJQt.js} +20 -10
- package/dist/client/{EodashLayerControl-DEzEbft7.js → EodashLayerControl-BLBds28C.js} +29 -16
- package/dist/client/EodashLayoutSwitcher-DQ8SfVDd.js +61 -0
- package/dist/client/EodashMapBtns-B89_YBDw.js +326 -0
- package/dist/client/{EodashStacInfo-DPPxDkF6.js → EodashStacInfo-Dt1nF06x.js} +3 -18
- package/dist/client/{EodashTools-CUaL9s4H.js → EodashTools-DV5ykmWc.js} +13 -13
- package/dist/client/{ExportState-DjyIZVhl.js → ExportState-B6zZQUmE.js} +57 -52
- package/dist/client/{Footer-DyL0JoWt.js → Footer-DNhXs8k6.js} +15 -13
- package/dist/client/{Header-B5Dgty9l.js → Header-BjhN5JY4.js} +32 -28
- package/dist/client/MobileLayout-JelB6w1G.js +118 -0
- package/dist/client/{PopUp-BfB8s_ki.js → PopUp-CgpvNr3o.js} +18 -10
- package/dist/client/ProcessList-vecpxThi.js +198 -0
- package/dist/client/{VImg-FD1WVphJ.js → VImg-CETuikH2.js} +221 -26
- package/dist/client/{VMain-DJKG4SvM.js → VMain-Ci9DyaGU.js} +7 -7
- package/dist/client/{VTooltip-CfeefrXI.js → VTooltip-J4ac48X7.js} +12 -10
- package/dist/client/{WidgetsContainer-C2TaTdb6.js → WidgetsContainer-CCML4TyV.js} +1 -1
- package/dist/client/asWebComponent-ZyEzWOOf.js +19092 -0
- package/dist/client/async-B7jIrM53.js +804 -0
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{VOverlay-BzOdRu9h.js → forwardRefs-BQclvjMq.js} +332 -28
- package/dist/client/handling-BS24aG1q.js +1227 -0
- package/dist/client/helpers-wXK7Ywio.js +4556 -0
- package/dist/client/index-4UCzZi8B.js +376 -0
- package/dist/client/{index-4CT7Tz83.js → index-9KR-G20t.js} +2 -2
- package/dist/client/{index-CIHH_3dW.js → index-B2XpdgR6.js} +227 -86
- package/dist/client/material-symbols-outlined.woff2 +0 -0
- package/dist/client/material-symbols-rounded.woff2 +0 -0
- package/dist/client/material-symbols-sharp.woff2 +0 -0
- package/dist/client/material-symbols-subset.woff2 +0 -0
- package/dist/client/{ssrBoot-BP7SYRyC.js → ssrBoot-Zgc_Ttvi.js} +2 -2
- package/dist/client/templates.js +840 -0
- package/dist/client/transition-yBii4fu6.js +40 -0
- package/dist/node/cli.js +16 -6
- package/dist/node/types.d.ts +1 -1
- package/dist/types/core/client/App.vue.d.ts +2 -2
- package/dist/types/core/client/asWebComponent.d.ts +1 -1
- package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +1 -3
- package/dist/types/core/client/components/Footer.vue.d.ts +1 -105
- package/dist/types/core/client/components/IframeWrapper.vue.d.ts +1 -1
- package/dist/types/core/client/components/MobileLayout.vue.d.ts +1 -324
- package/dist/types/core/client/composables/DefineEodash.d.ts +2 -2
- package/dist/types/core/client/composables/DefineTemplate.d.ts +1 -1
- package/dist/types/core/client/composables/DefineWidgets.d.ts +4 -4
- package/dist/types/core/client/composables/index.d.ts +24 -2
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +9 -6
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +25 -5
- package/dist/types/core/client/eodashSTAC/parquet.d.ts +2 -0
- package/dist/types/core/client/plugins/vuetify.d.ts +7 -4
- package/dist/types/core/client/store/actions.d.ts +3 -2
- package/dist/types/core/client/store/stac.d.ts +16 -13
- package/dist/types/core/client/store/states.d.ts +14 -4
- package/dist/types/core/client/types.d.ts +46 -31
- package/dist/types/core/client/utils/index.d.ts +2 -0
- package/dist/types/core/client/utils/keys.d.ts +4 -4
- package/dist/types/core/client/utils/states.d.ts +59 -47
- package/dist/types/core/client/views/Dashboard.vue.d.ts +2 -2
- package/dist/types/templates/baseConfig.d.ts +4 -0
- package/dist/types/templates/compare.d.ts +185 -0
- package/dist/types/templates/expert.d.ts +147 -0
- package/dist/types/templates/index.d.ts +6 -0
- package/dist/types/templates/light.d.ts +154 -0
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +1 -458
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +3 -3
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +14 -7
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +1 -3
- package/dist/types/widgets/{EodashMapBtns.vue.d.ts → EodashMap/EodashMapBtns.vue.d.ts} +12 -8
- package/dist/types/widgets/EodashMap/index.vue.d.ts +9 -4
- package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +8 -1
- package/dist/types/widgets/EodashProcess/index.vue.d.ts +8 -4
- package/dist/types/widgets/EodashProcess/methods/async.d.ts +19 -18
- package/dist/types/widgets/EodashProcess/methods/composables.d.ts +3 -2
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/index.d.ts +1 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.d.ts +6 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.d.ts +4 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +5 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/index.d.ts +1 -0
- package/dist/types/widgets/EodashProcess/methods/handling.d.ts +12 -5
- package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +72 -41
- package/dist/types/widgets/EodashProcess/methods/utils.d.ts +41 -21
- package/dist/types/widgets/EodashProcess/states.d.ts +11 -0
- package/dist/types/widgets/EodashProcess/types.d.ts +41 -0
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +14 -14
- package/dist/types/widgets/EodashTools.vue.d.ts +3 -3
- package/dist/types/widgets/ExportState.vue.d.ts +1 -1
- package/dist/types/widgets/PopUp.vue.d.ts +11 -16
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +3 -6
- package/package.json +55 -45
- package/templates/baseConfig.js +68 -0
- package/templates/compare.js +142 -0
- package/templates/expert.js +124 -0
- package/templates/index.js +8 -0
- package/templates/light.js +139 -0
- package/widgets/EodashDatePicker.vue +80 -31
- package/widgets/EodashItemFilter.vue +26 -11
- package/widgets/EodashLayerControl.vue +20 -11
- package/widgets/EodashLayoutSwitcher.vue +6 -3
- package/widgets/EodashMap/EodashMapBtns.vue +269 -0
- package/widgets/EodashMap/index.vue +255 -45
- package/widgets/EodashMap/methods/create-layers-config.js +4 -3
- package/widgets/EodashMap/methods/index.js +33 -23
- package/widgets/EodashProcess/ProcessList.vue +47 -11
- package/widgets/EodashProcess/index.vue +55 -20
- package/widgets/EodashProcess/methods/async.js +99 -60
- package/widgets/EodashProcess/methods/composables.js +21 -14
- package/widgets/EodashProcess/methods/custom-endpoints/chart/index.js +35 -0
- package/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.js +275 -0
- package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +132 -0
- package/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.js +94 -0
- package/widgets/EodashProcess/methods/custom-endpoints/layers/index.js +33 -0
- package/widgets/EodashProcess/methods/handling.js +127 -80
- package/widgets/EodashProcess/methods/outputs.js +376 -125
- package/widgets/EodashProcess/methods/utils.js +442 -10
- package/widgets/EodashProcess/states.js +13 -0
- package/widgets/EodashProcess/types.ts +46 -0
- package/widgets/EodashStacInfo.vue +2 -17
- package/widgets/EodashTools.vue +13 -13
- package/widgets/WidgetsContainer.vue +1 -1
- package/core/client/eodash.js +0 -454
- package/dist/client/EodashLayoutSwitcher-CDeCV8F-.js +0 -52
- package/dist/client/EodashMapBtns-CktQCfa-.js +0 -131
- package/dist/client/MobileLayout-CRsg_5Q4.js +0 -1217
- package/dist/client/ProcessList-DTefwQZx.js +0 -484
- package/dist/client/asWebComponent-CLhcT715.js +0 -12479
- package/dist/client/eo-dash.css +0 -5
- package/dist/client/forwardRefs-Bon_Kku1.js +0 -245
- package/dist/client/index-Bm9cbtx5.js +0 -201
- package/dist/client/index-DiGDvTQU.js +0 -780
- package/dist/client/transition-C5I57hn6.js +0 -37
- package/dist/types/core/client/eodash.d.ts +0 -8
- package/widgets/EodashMapBtns.vue +0 -113
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import log from "loglevel";
|
|
2
|
-
import { extractGeometries, getBboxProperty } from "./utils";
|
|
3
|
-
import { datetime, mapEl } from "@/store/states";
|
|
4
|
-
import axios from "@/plugins/axios";
|
|
5
|
-
import { getLayers } from "@/store/actions";
|
|
6
2
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from "./
|
|
3
|
+
applyProcessLayersToMap,
|
|
4
|
+
extractGeometries,
|
|
5
|
+
getBboxProperty,
|
|
6
|
+
updateJsonformSchemaTarget,
|
|
7
|
+
} from "./utils";
|
|
8
|
+
import {
|
|
9
|
+
compareIndicator,
|
|
10
|
+
comparePoi,
|
|
11
|
+
datetime,
|
|
12
|
+
indicator,
|
|
13
|
+
poi,
|
|
14
|
+
} from "@/store/states";
|
|
15
|
+
import axios from "@/plugins/axios";
|
|
16
|
+
import { processCharts, processLayers, processSTAC } from "./outputs";
|
|
17
|
+
import { handleLayersCustomEndpoints } from "./custom-endpoints/layers";
|
|
18
|
+
import { handleChartCustomEndpoints } from "./custom-endpoints/chart";
|
|
19
|
+
import { useSTAcStore } from "@/store/stac";
|
|
20
|
+
import { useGetSubCodeId } from "@/composables";
|
|
12
21
|
|
|
13
22
|
/**
|
|
14
23
|
* Fetch and set the jsonform schema to initialize the process
|
|
@@ -16,7 +25,7 @@ import {
|
|
|
16
25
|
* @export
|
|
17
26
|
* @async
|
|
18
27
|
* @param {Object} params
|
|
19
|
-
* @param {import("vue").Ref<import("stac-ts").StacCollection>} params.selectedStac
|
|
28
|
+
* @param {import("vue").Ref<import("stac-ts").StacCollection | null>} params.selectedStac
|
|
20
29
|
* @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} params.jsonformEl
|
|
21
30
|
* @param {import("vue").Ref<Record<string,any> | null>} params.jsonformSchema
|
|
22
31
|
* @param {import("vue").Ref<import("@eox/chart").EOxChart["spec"] | null>} params.chartSpec
|
|
@@ -24,6 +33,7 @@ import {
|
|
|
24
33
|
* @param {import("vue").Ref<boolean>} params.isProcessed
|
|
25
34
|
* @param {import("vue").Ref<boolean>} params.loading
|
|
26
35
|
* @param {import("vue").Ref<boolean>} params.isPolling
|
|
36
|
+
* @param {boolean} params.enableCompare
|
|
27
37
|
*/
|
|
28
38
|
export async function initProcess({
|
|
29
39
|
selectedStac,
|
|
@@ -34,8 +44,19 @@ export async function initProcess({
|
|
|
34
44
|
processResults,
|
|
35
45
|
loading,
|
|
36
46
|
isPolling,
|
|
47
|
+
enableCompare,
|
|
37
48
|
}) {
|
|
38
|
-
|
|
49
|
+
const isPoiAlive = enableCompare ? !!comparePoi.value : !!poi.value;
|
|
50
|
+
let updatedJsonform = null;
|
|
51
|
+
if (selectedStac.value?.["eodash:jsonform"]) {
|
|
52
|
+
updatedJsonform = await axios
|
|
53
|
+
//@ts-expect-error eodash extention
|
|
54
|
+
.get(selectedStac.value["eodash:jsonform"])
|
|
55
|
+
.then((resp) => resp.data);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!updatedJsonform && isPoiAlive) {
|
|
59
|
+
jsonformSchema.value = null;
|
|
39
60
|
return;
|
|
40
61
|
}
|
|
41
62
|
resetProcess({
|
|
@@ -46,25 +67,19 @@ export async function initProcess({
|
|
|
46
67
|
isPolling,
|
|
47
68
|
processResults,
|
|
48
69
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.get(selectedStac.value["eodash:jsonform"])
|
|
55
|
-
.then((resp) => resp.data);
|
|
56
|
-
// remove borders from jsonform
|
|
57
|
-
} else {
|
|
58
|
-
if (!jsonformSchema.value) {
|
|
59
|
-
return;
|
|
70
|
+
|
|
71
|
+
await jsonformEl.value?.editor.destroy();
|
|
72
|
+
if (updatedJsonform) {
|
|
73
|
+
if (enableCompare) {
|
|
74
|
+
updatedJsonform = updateJsonformSchemaTarget(updatedJsonform);
|
|
60
75
|
}
|
|
61
|
-
jsonformSchema.value =
|
|
76
|
+
jsonformSchema.value = updatedJsonform;
|
|
62
77
|
}
|
|
63
78
|
}
|
|
64
79
|
|
|
65
80
|
/**
|
|
66
81
|
*
|
|
67
|
-
* @param {
|
|
82
|
+
* @param {object} params
|
|
68
83
|
* @param {import("vue").Ref<boolean>} params.loading
|
|
69
84
|
* @param {import("vue").Ref<import("stac-ts").StacCollection | null>} params.selectedStac
|
|
70
85
|
* @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} params.jsonformEl
|
|
@@ -73,6 +88,8 @@ export async function initProcess({
|
|
|
73
88
|
* @param {import("vue").Ref<Record<string, any> | null>} params.chartData
|
|
74
89
|
* @param {import("vue").Ref<boolean>} params.isPolling
|
|
75
90
|
* @param {import("vue").Ref<any[]>} params.processResults
|
|
91
|
+
* @param {import("@eox/map").EOxMap | null} params.mapElement
|
|
92
|
+
* @param {import("vue").Ref<import("../types").AsyncJob[]>} params.jobs
|
|
76
93
|
*/
|
|
77
94
|
export async function handleProcesses({
|
|
78
95
|
loading,
|
|
@@ -83,16 +100,20 @@ export async function handleProcesses({
|
|
|
83
100
|
chartData,
|
|
84
101
|
isPolling,
|
|
85
102
|
processResults,
|
|
103
|
+
mapElement,
|
|
104
|
+
jobs,
|
|
86
105
|
}) {
|
|
87
106
|
if (!jsonformEl.value || !jsonformSchema.value || !selectedStac.value) {
|
|
88
107
|
return;
|
|
89
108
|
}
|
|
109
|
+
|
|
90
110
|
log.debug("Processing...");
|
|
91
111
|
loading.value = true;
|
|
92
112
|
try {
|
|
93
113
|
const serviceLinks = selectedStac.value?.links?.filter(
|
|
94
114
|
(l) => l.rel === "service",
|
|
95
115
|
);
|
|
116
|
+
|
|
96
117
|
const bboxProperty = getBboxProperty(jsonformSchema.value);
|
|
97
118
|
const jsonformValue = /** @type {Record<string,any>} */ (
|
|
98
119
|
jsonformEl.value?.value
|
|
@@ -105,12 +126,20 @@ export async function handleProcesses({
|
|
|
105
126
|
const specUrl = /** @type {string} */ (
|
|
106
127
|
selectedStac.value?.["eodash:vegadefinition"]
|
|
107
128
|
);
|
|
129
|
+
const layerId = selectedStac.value?.id ?? "";
|
|
108
130
|
|
|
109
|
-
[chartSpec.value, chartData.value] = await
|
|
110
|
-
serviceLinks,
|
|
111
|
-
{ ...(jsonformValue ?? {}) },
|
|
131
|
+
[chartSpec.value, chartData.value] = await processCharts({
|
|
132
|
+
links: serviceLinks,
|
|
133
|
+
jsonformValue: { ...(jsonformValue ?? {}) },
|
|
134
|
+
jsonformSchema: jsonformSchema.value,
|
|
135
|
+
enableCompare: mapElement?.id === "compare",
|
|
136
|
+
selectedStac: selectedStac.value,
|
|
112
137
|
specUrl,
|
|
113
|
-
|
|
138
|
+
isPolling,
|
|
139
|
+
jobs,
|
|
140
|
+
customEndpointsHandler: handleChartCustomEndpoints,
|
|
141
|
+
});
|
|
142
|
+
|
|
114
143
|
if (Object.keys(chartData.value ?? {}).length) {
|
|
115
144
|
processResults.value.push(chartData.value);
|
|
116
145
|
}
|
|
@@ -125,63 +154,40 @@ export async function handleProcesses({
|
|
|
125
154
|
chartSpec.value["background"] = "transparent";
|
|
126
155
|
}
|
|
127
156
|
|
|
128
|
-
|
|
157
|
+
await processSTAC(
|
|
129
158
|
serviceLinks,
|
|
130
159
|
jsonformValue,
|
|
131
|
-
|
|
132
|
-
isPolling,
|
|
133
|
-
//@ts-expect-error TODO
|
|
134
|
-
selectedStac.value?.["eodash:mapProjection"]?.["name"] ?? null,
|
|
160
|
+
mapElement?.id === "compare",
|
|
135
161
|
);
|
|
136
162
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const imageLayers = processImage(serviceLinks, jsonformValue, origBbox);
|
|
156
|
-
if (imageLayers?.length) {
|
|
157
|
-
processResults.value.push(
|
|
158
|
-
...imageLayers.map((layer) => layer.source?.url),
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
log.debug(
|
|
163
|
-
"rendered layers after processing:",
|
|
164
|
-
geotiffLayer,
|
|
165
|
-
vectorLayers,
|
|
166
|
-
imageLayers,
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
if (geotiffLayer || vectorLayers?.length || imageLayers?.length) {
|
|
170
|
-
const layers = [
|
|
171
|
-
...(geotiffLayer ? [geotiffLayer] : []),
|
|
172
|
-
...(vectorLayers ?? []),
|
|
173
|
-
...(imageLayers ?? []),
|
|
174
|
-
];
|
|
175
|
-
let currentLayers = [...getLayers()];
|
|
176
|
-
let analysisGroup = currentLayers.find((l) =>
|
|
177
|
-
l.properties.id.includes("AnalysisGroup"),
|
|
178
|
-
);
|
|
179
|
-
analysisGroup?.layers.push(...layers);
|
|
163
|
+
const newLayers = await processLayers({
|
|
164
|
+
isPolling,
|
|
165
|
+
links: serviceLinks,
|
|
166
|
+
jsonformValue: { ...(jsonformValue ?? {}) },
|
|
167
|
+
jsonformSchema: jsonformSchema.value,
|
|
168
|
+
selectedStac: selectedStac.value,
|
|
169
|
+
enableCompare: mapElement?.id === "compare",
|
|
170
|
+
layerId,
|
|
171
|
+
origBbox,
|
|
172
|
+
jobs,
|
|
173
|
+
customLayersHandler: handleLayersCustomEndpoints,
|
|
174
|
+
projection: /** @type {{name?:string}} */ (
|
|
175
|
+
selectedStac.value["eodash:mapProjection"]
|
|
176
|
+
)?.["name"],
|
|
177
|
+
});
|
|
180
178
|
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
// save layers results
|
|
180
|
+
if (newLayers.length) {
|
|
181
|
+
for (const layer of newLayers) {
|
|
182
|
+
if (layer.type === "WebGLTile" && layer.source?.type === "GeoTIFF") {
|
|
183
|
+
processResults.value.push(...(layer.source.sources ?? []));
|
|
184
|
+
} else if (layer.source && "url" in layer.source) {
|
|
185
|
+
processResults.value.push(layer.source.url);
|
|
186
|
+
}
|
|
183
187
|
}
|
|
184
188
|
}
|
|
189
|
+
|
|
190
|
+
applyProcessLayersToMap(mapElement, newLayers);
|
|
185
191
|
loading.value = false;
|
|
186
192
|
} catch (error) {
|
|
187
193
|
console.error("[eodash] Error while running process:", error);
|
|
@@ -228,7 +234,11 @@ export function resetProcess({
|
|
|
228
234
|
*/
|
|
229
235
|
export const onChartClick = (evt) => {
|
|
230
236
|
const chartSpec = evt.target?.spec;
|
|
231
|
-
if (
|
|
237
|
+
if (
|
|
238
|
+
!chartSpec ||
|
|
239
|
+
!evt.detail?.item?.datum ||
|
|
240
|
+
!evt.detail?.item?.datum.datum
|
|
241
|
+
) {
|
|
232
242
|
return;
|
|
233
243
|
}
|
|
234
244
|
const encodingKey = Object.keys(chartSpec.encoding ?? {}).find(
|
|
@@ -241,9 +251,19 @@ export const onChartClick = (evt) => {
|
|
|
241
251
|
if (!temporalKey) {
|
|
242
252
|
return;
|
|
243
253
|
}
|
|
254
|
+
|
|
244
255
|
try {
|
|
245
256
|
const vegaItem = evt.detail.item;
|
|
246
|
-
|
|
257
|
+
let datestring = "";
|
|
258
|
+
// It seems sometimes we have datum inside datum and sometimes not
|
|
259
|
+
if (vegaItem.datum && vegaItem.datum.datum) {
|
|
260
|
+
// If datum is nested, we use the nested datum
|
|
261
|
+
datestring = vegaItem.datum.datum[temporalKey];
|
|
262
|
+
} else {
|
|
263
|
+
// Otherwise, we use the top-level datum
|
|
264
|
+
datestring = vegaItem.datum[temporalKey];
|
|
265
|
+
}
|
|
266
|
+
const temporalValue = new Date(datestring);
|
|
247
267
|
datetime.value = temporalValue.toISOString();
|
|
248
268
|
} catch (error) {
|
|
249
269
|
console.warn(
|
|
@@ -252,3 +272,30 @@ export const onChartClick = (evt) => {
|
|
|
252
272
|
);
|
|
253
273
|
}
|
|
254
274
|
};
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Loads the main indicator of a Point of Interest (POI)
|
|
278
|
+
*/
|
|
279
|
+
export const loadPOiIndicator = () => {
|
|
280
|
+
if (!indicator.value) {
|
|
281
|
+
indicator.value =
|
|
282
|
+
new URLSearchParams(window.location.search).get("indicator") ?? "";
|
|
283
|
+
}
|
|
284
|
+
const stacStore = useSTAcStore();
|
|
285
|
+
const link = stacStore.stac?.find(
|
|
286
|
+
(link) => useGetSubCodeId(link) === indicator.value,
|
|
287
|
+
);
|
|
288
|
+
stacStore.loadSelectedSTAC(link?.href);
|
|
289
|
+
if (comparePoi.value) {
|
|
290
|
+
if (compareIndicator.value) {
|
|
291
|
+
const comparelink = stacStore.stac?.find(
|
|
292
|
+
(link) => useGetSubCodeId(link) === compareIndicator.value,
|
|
293
|
+
);
|
|
294
|
+
stacStore.loadSelectedCompareSTAC(comparelink?.href).catch((err) => {
|
|
295
|
+
console.error("[eodash] Error loading compare STAC:", err);
|
|
296
|
+
});
|
|
297
|
+
} else {
|
|
298
|
+
stacStore.resetSelectedCompareSTAC();
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
};
|