@eodash/eodash 5.4.0 → 5.5.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/core/client/App.vue +1 -1
- package/core/client/asWebComponent.js +1 -1
- package/core/client/composables/DefineWidgets.js +12 -2
- package/core/client/eodashSTAC/EodashCollection.js +12 -13
- package/core/client/eodashSTAC/createLayers.js +45 -18
- package/core/client/eodashSTAC/helpers.js +13 -5
- package/core/client/eodashSTAC/parquet.js +2 -1
- package/core/client/eodashSTAC/triggers.js +1 -2
- package/core/client/store/actions.js +17 -17
- package/core/client/store/states.js +26 -4
- package/core/client/types.ts +9 -0
- package/core/client/utils/index.js +18 -1
- package/dist/client/{DashboardLayout-CQOGHPW_.js → DashboardLayout-D_590Zle.js} +2 -2
- package/dist/client/{DynamicWebComponent-CoLO8FEf.js → DynamicWebComponent-67cfzL4o.js} +1 -1
- package/dist/client/EodashChart-BsW18Em1.js +144 -0
- package/dist/client/{EodashDatePicker-BZeQ6bcu.js → EodashDatePicker-BwyFIBlK.js} +10 -7
- package/dist/client/{EodashItemFilter-CmZkk7GK.js → EodashItemFilter-CgdrG-pX.js} +2 -2
- package/dist/client/{EodashLayerControl-D54fY-bX.js → EodashLayerControl-V98fahVJ.js} +2 -2
- package/dist/client/{EodashLayoutSwitcher-BCP3FvDb.js → EodashLayoutSwitcher-B4oI5PAx.js} +3 -3
- package/dist/client/EodashMapBtns-Ce2tFjJK.js +433 -0
- package/dist/client/{EodashStacInfo-BZbmT8vT.js → EodashStacInfo-Cb28jVEr.js} +11 -15
- package/dist/client/{EodashTimeSlider-DIcAJr6D.js → EodashTimeSlider-B5boxpCK.js} +2 -2
- package/dist/client/{EodashTools-Cz6X6hsF.js → EodashTools-RwiXxELa.js} +4 -4
- package/dist/client/{ExportState-DFVFAgKz.js → ExportState-Cp4ftu4f.js} +46 -21
- package/dist/client/{Footer-DLzQcjkI.js → Footer-xGfh2LUv.js} +1 -1
- package/dist/client/{Header-_D9Z-zFJ.js → Header-BggV8BVC.js} +127 -17
- package/dist/client/MobileLayout-BwXCBKFL.js +118 -0
- package/dist/client/{PopUp-DwI8V2gW.js → PopUp-C6x6Rpv0.js} +8 -59
- package/dist/client/{ProcessList-C9eAg2Sb.js → ProcessList-DDwo71cD.js} +9 -13
- package/dist/client/{VImg-COXTnCWE.js → VImg-DN23k6uX.js} +2 -2
- package/dist/client/{VMain-C74l1bv-.js → VMain-BT2ZxPLy.js} +1 -1
- package/dist/client/{VTooltip-BLS-cQ9N.js → VTooltip-CAkym6KY.js} +3 -4
- package/dist/client/{WidgetsContainer-D-VfMRxE.js → WidgetsContainer-CLYZgRgc.js} +1 -1
- package/dist/client/asWebComponent-C5YMrXyg.js +9206 -0
- package/dist/client/{async-D4G-FOIc.js → async-DHmiD7O-.js} +6 -8
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-CRMFoNYN.js → forwardRefs-YqjFe8WZ.js} +196 -37
- package/dist/client/{handling-DTAhQuPh.js → handling-DRaAJMSG.js} +93 -53
- package/dist/client/{helpers-CsjKHAcK.js → helpers-Bi-qmnbZ.js} +188 -87
- package/dist/client/{index-BoCcZ0l4.js → index-BtY2y1sL.js} +15 -16
- package/dist/client/{index-DEmHaCL3.js → index-D4GBjamF.js} +5 -3
- package/dist/client/{index-BIcmbjr0.js → index-DYLTaaU8.js} +27 -14
- package/dist/client/{index-BHilH1qx.js → index-bSHJLUNu.js} +30 -73
- package/dist/client/templates.js +64 -5
- package/dist/client/{transition-6MJLK-_H.js → transition-C4YbXuIb.js} +1 -1
- package/dist/node/cli.js +1 -1
- package/dist/types/core/client/App.vue.d.ts +16 -6
- package/dist/types/core/client/asWebComponent.d.ts +2 -2
- package/dist/types/core/client/components/DashboardLayout.vue.d.ts +2 -1
- package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +36 -16
- package/dist/types/core/client/components/EodashOverlay.vue.d.ts +2 -1
- package/dist/types/core/client/components/ErrorAlert.vue.d.ts +9 -1
- package/dist/types/core/client/components/Footer.vue.d.ts +2 -1
- package/dist/types/core/client/components/Header.vue.d.ts +2 -1
- package/dist/types/core/client/components/IframeWrapper.vue.d.ts +12 -6
- package/dist/types/core/client/components/Loading.vue.d.ts +2 -1
- package/dist/types/core/client/components/MobileLayout.vue.d.ts +2 -1
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +2 -0
- package/dist/types/core/client/store/actions.d.ts +1 -2
- package/dist/types/core/client/store/states.d.ts +22 -4
- package/dist/types/core/client/types.d.ts +6 -1
- package/dist/types/core/client/utils/index.d.ts +1 -0
- package/dist/types/core/client/views/Dashboard.vue.d.ts +20 -8
- package/dist/types/templates/compare.d.ts +20 -0
- package/dist/types/templates/expert.d.ts +30 -1
- package/dist/types/widgets/EodashChart.vue.d.ts +28 -0
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +38 -9
- package/dist/types/widgets/EodashItemCatalog/index.vue.d.ts +88 -13
- package/dist/types/widgets/EodashItemCatalog/methods/map.d.ts +1 -1
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +169 -26
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +38 -10
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +22 -7
- package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +94 -21
- package/dist/types/widgets/EodashMap/index.vue.d.ts +646 -93
- package/dist/types/widgets/EodashMap/methods/btns.d.ts +14 -0
- package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +24 -7
- package/dist/types/widgets/EodashProcess/index.vue.d.ts +26 -7
- package/dist/types/widgets/EodashProcess/methods/composables.d.ts +1 -2
- package/dist/types/widgets/EodashProcess/methods/handling.d.ts +9 -14
- package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +2 -2
- package/dist/types/widgets/EodashProcess/methods/utils.d.ts +2 -2
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +67 -18
- package/dist/types/widgets/EodashTimeSlider.vue.d.ts +14 -6
- package/dist/types/widgets/EodashTools.vue.d.ts +437 -47
- package/dist/types/widgets/ExportState.vue.d.ts +26 -8
- package/dist/types/widgets/PopUp.vue.d.ts +61 -11
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +22 -6
- package/package.json +33 -34
- package/templates/baseConfig.js +14 -0
- package/templates/compare.js +30 -3
- package/templates/expert.js +20 -2
- package/templates/lite.js +1 -1
- package/widgets/EodashChart.vue +139 -0
- package/widgets/EodashDatePicker.vue +5 -2
- package/widgets/EodashItemCatalog/index.vue +2 -2
- package/widgets/EodashItemCatalog/methods/map.js +9 -10
- package/widgets/EodashMap/EodashMapBtns.vue +58 -93
- package/widgets/EodashMap/index.vue +10 -2
- package/widgets/EodashMap/methods/btns.js +155 -0
- package/widgets/EodashMap/methods/create-layers-config.js +3 -3
- package/widgets/EodashMap/methods/index.js +2 -1
- package/widgets/EodashProcess/ProcessList.vue +2 -3
- package/widgets/EodashProcess/index.vue +24 -63
- package/widgets/EodashProcess/methods/async.js +1 -1
- package/widgets/EodashProcess/methods/composables.js +1 -6
- package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +10 -6
- package/widgets/EodashProcess/methods/handling.js +42 -40
- package/widgets/EodashProcess/methods/outputs.js +44 -4
- package/widgets/EodashProcess/methods/utils.js +3 -5
- package/widgets/EodashStacInfo.vue +10 -23
- package/widgets/ExportState.vue +9 -15
- package/dist/client/EodashMapBtns-D-HulIl1.js +0 -306
- package/dist/client/MobileLayout-3Ko9XSfO.js +0 -118
- package/dist/client/asWebComponent-Bw03Jutr.js +0 -9090
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div ref="container" class="
|
|
2
|
+
<div ref="container" class="py-1">
|
|
3
3
|
<ProcessList :map-element="mapElement" :enable-compare="enableCompare" />
|
|
4
|
-
|
|
5
4
|
<eox-jsonform
|
|
6
5
|
v-if="jsonformSchema"
|
|
7
6
|
:key="jsonformKey"
|
|
8
7
|
ref="jsonformEl"
|
|
9
8
|
.schema="jsonformSchema"
|
|
10
9
|
></eox-jsonform>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
:style="chartStyles"
|
|
19
|
-
.opt="vegaEmbedOptions"
|
|
20
|
-
/>
|
|
21
|
-
<div class="mt-4 text-right">
|
|
10
|
+
<EodashChart
|
|
11
|
+
v-if="!areChartsSeparateLayout"
|
|
12
|
+
:vega-embed-options="vegaEmbedOptions"
|
|
13
|
+
:enable-compare="enableCompare"
|
|
14
|
+
>
|
|
15
|
+
</EodashChart>
|
|
16
|
+
<div class="text-right">
|
|
22
17
|
<v-btn
|
|
23
18
|
v-if="showExecBtn"
|
|
24
19
|
:loading="loading"
|
|
25
|
-
style="margin-right:
|
|
20
|
+
style="margin-right: 8px"
|
|
26
21
|
:append-icon="[mdiCogPlayOutline]"
|
|
27
22
|
@click="startProcess"
|
|
28
|
-
|
|
23
|
+
density="comfortable"
|
|
24
|
+
size="small"
|
|
29
25
|
>
|
|
30
26
|
Execute
|
|
31
27
|
</v-btn>
|
|
32
28
|
<v-btn
|
|
33
29
|
v-if="processResults.length && isProcessed && !isAsync"
|
|
34
30
|
color="primary"
|
|
31
|
+
style="margin-right: 8px"
|
|
35
32
|
:append-icon="[mdiDownloadCircleOutline]"
|
|
36
33
|
@click="downloadResults"
|
|
34
|
+
size="small"
|
|
35
|
+
density="comfortable"
|
|
37
36
|
>
|
|
38
37
|
Download
|
|
39
38
|
</v-btn>
|
|
@@ -46,9 +45,10 @@ import "@eox/drawtools";
|
|
|
46
45
|
import "@eox/jsonform";
|
|
47
46
|
import { useSTAcStore } from "@/store/stac";
|
|
48
47
|
import { storeToRefs } from "pinia";
|
|
49
|
-
import { computed, ref,
|
|
48
|
+
import { computed, ref, useTemplateRef } from "vue";
|
|
50
49
|
import ProcessList from "./ProcessList.vue";
|
|
51
|
-
import
|
|
50
|
+
import EodashChart from "../EodashChart.vue";
|
|
51
|
+
import { handleProcesses } from "./methods/handling";
|
|
52
52
|
import { useInitProcess, useAutoExec } from "./methods/composables";
|
|
53
53
|
import { updateJobsStatus } from "./methods/async";
|
|
54
54
|
import {
|
|
@@ -56,8 +56,9 @@ import {
|
|
|
56
56
|
indicator,
|
|
57
57
|
mapCompareEl,
|
|
58
58
|
mapEl,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
chartSpec,
|
|
60
|
+
compareChartSpec,
|
|
61
|
+
areChartsSeparateLayout,
|
|
61
62
|
} from "@/store/states";
|
|
62
63
|
import { download, getDrawToolsProperty } from "./methods/utils";
|
|
63
64
|
import { compareJobs, jobs } from "./states";
|
|
@@ -75,11 +76,7 @@ const { enableCompare, vegaEmbedOptions } = defineProps({
|
|
|
75
76
|
},
|
|
76
77
|
},
|
|
77
78
|
});
|
|
78
|
-
/** @type {import("vue").Ref<import("vega").Spec|null>} */
|
|
79
|
-
const chartSpec = ref(null);
|
|
80
79
|
|
|
81
|
-
/** @type {import("vue").Ref<Record<string,any>|null>} */
|
|
82
|
-
const chartData = ref(null);
|
|
83
80
|
const isProcessed = ref(false);
|
|
84
81
|
|
|
85
82
|
/** @type {import("vue").Ref<Record<string,any>|null>} */
|
|
@@ -89,16 +86,12 @@ const jsonformEl =
|
|
|
89
86
|
/** @type {Readonly<import("vue").ShallowRef<import("@eox/jsonform").EOxJSONForm | null>>} */ (
|
|
90
87
|
useTemplateRef("jsonformEl")
|
|
91
88
|
);
|
|
92
|
-
|
|
93
|
-
/** @type {Readonly<import("vue").ShallowRef<import("@eox/chart").EOxChart | null>>} */ (
|
|
94
|
-
useTemplateRef("chartElRef")
|
|
95
|
-
);
|
|
89
|
+
|
|
96
90
|
const isAsync = computed(
|
|
97
91
|
() =>
|
|
98
92
|
selectedStac.value?.links.filter((l) => l.endpoint === "eoxhub_workspaces")
|
|
99
93
|
.length,
|
|
100
94
|
);
|
|
101
|
-
const containerEl = useTemplateRef("container");
|
|
102
95
|
|
|
103
96
|
const loading = ref(false);
|
|
104
97
|
|
|
@@ -109,10 +102,7 @@ const isPolling = ref(false);
|
|
|
109
102
|
const processResults = ref([]);
|
|
110
103
|
|
|
111
104
|
const showExecBtn = computed(
|
|
112
|
-
() =>
|
|
113
|
-
!autoExec.value &&
|
|
114
|
-
(!!jsonformSchema.value || !!chartSpec.value) &&
|
|
115
|
-
!!jsonformEl.value,
|
|
105
|
+
() => !autoExec.value && !!jsonformSchema.value && !!jsonformEl.value,
|
|
116
106
|
);
|
|
117
107
|
const { selectedStac, selectedCompareStac } = storeToRefs(useSTAcStore());
|
|
118
108
|
const currentSelectedStac = enableCompare ? selectedCompareStac : selectedStac;
|
|
@@ -129,7 +119,6 @@ useInitProcess({
|
|
|
129
119
|
mapElement: mapElement.value,
|
|
130
120
|
jsonformEl,
|
|
131
121
|
jsonformSchema,
|
|
132
|
-
chartSpec,
|
|
133
122
|
isProcessed,
|
|
134
123
|
processResults,
|
|
135
124
|
loading,
|
|
@@ -165,7 +154,8 @@ const startProcess = async () => {
|
|
|
165
154
|
|
|
166
155
|
if (propertyIsEmpty) {
|
|
167
156
|
isProcessed.value = false;
|
|
168
|
-
|
|
157
|
+
const usedChartSpec = enableCompare ? compareChartSpec : chartSpec;
|
|
158
|
+
usedChartSpec.value = null;
|
|
169
159
|
return;
|
|
170
160
|
}
|
|
171
161
|
const errors = jsonformEl.value?.editor.validate();
|
|
@@ -181,8 +171,6 @@ const startProcess = async () => {
|
|
|
181
171
|
selectedStac: currentSelectedStac,
|
|
182
172
|
jsonformEl,
|
|
183
173
|
jsonformSchema,
|
|
184
|
-
chartSpec,
|
|
185
|
-
chartData,
|
|
186
174
|
loading,
|
|
187
175
|
isPolling,
|
|
188
176
|
processResults,
|
|
@@ -193,35 +181,8 @@ const startProcess = async () => {
|
|
|
193
181
|
if (isAsync.value) updateJobsStatus(currentJobs, currentIndicator.value);
|
|
194
182
|
};
|
|
195
183
|
useAutoExec(autoExec, jsonformEl, jsonformSchema, startProcess);
|
|
196
|
-
|
|
197
|
-
const chartStyles = computed(() => {
|
|
198
|
-
/** @type {Record<string,string>} */
|
|
199
|
-
const styles = {};
|
|
200
|
-
if (!chartSpec.value?.["height"]) {
|
|
201
|
-
styles["height"] =
|
|
202
|
-
Math.max(
|
|
203
|
-
(containerEl.value?.offsetHeight ?? 0) -
|
|
204
|
-
(jsonformEl.value?.offsetHeight ?? 0),
|
|
205
|
-
200,
|
|
206
|
-
) + "px";
|
|
207
|
-
}
|
|
208
|
-
return styles;
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
// Assign chart element to global state based on compare mode
|
|
212
|
-
watch(chartElRef, (newVal) => {
|
|
213
|
-
if (enableCompare) {
|
|
214
|
-
compareChartEl.value = newVal;
|
|
215
|
-
} else {
|
|
216
|
-
chartEl.value = newVal;
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
184
|
</script>
|
|
220
185
|
<style>
|
|
221
|
-
eox-chart {
|
|
222
|
-
--background-color: transparent;
|
|
223
|
-
padding-top: 1em;
|
|
224
|
-
}
|
|
225
186
|
eox-jsonform {
|
|
226
187
|
padding: 0.7em;
|
|
227
188
|
min-height: 0px;
|
|
@@ -13,7 +13,6 @@ import { useOnLayersUpdate } from "@/composables";
|
|
|
13
13
|
* @param {import("vue").Ref<import("stac-ts").StacCollection | null>} params.selectedStac
|
|
14
14
|
* @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} params.jsonformEl
|
|
15
15
|
* @param {import("vue").Ref<Record<string,any> | null>} params.jsonformSchema
|
|
16
|
-
* @param {import("vue").Ref<import("@eox/chart").EOxChart["spec"] | null>} params.chartSpec
|
|
17
16
|
* @param {import("vue").Ref<any[]>} params.processResults
|
|
18
17
|
* @param {import("vue").Ref<boolean>} params.isProcessed
|
|
19
18
|
* @param {import("vue").Ref<boolean>} params.loading
|
|
@@ -24,7 +23,6 @@ export const useInitProcess = ({
|
|
|
24
23
|
selectedStac,
|
|
25
24
|
jsonformEl,
|
|
26
25
|
jsonformSchema,
|
|
27
|
-
chartSpec,
|
|
28
26
|
isProcessed,
|
|
29
27
|
processResults,
|
|
30
28
|
loading,
|
|
@@ -41,7 +39,6 @@ export const useInitProcess = ({
|
|
|
41
39
|
selectedStac,
|
|
42
40
|
jsonformEl,
|
|
43
41
|
jsonformSchema,
|
|
44
|
-
chartSpec,
|
|
45
42
|
isProcessed,
|
|
46
43
|
processResults,
|
|
47
44
|
loading,
|
|
@@ -54,7 +51,6 @@ export const useInitProcess = ({
|
|
|
54
51
|
selectedStac,
|
|
55
52
|
jsonformEl,
|
|
56
53
|
jsonformSchema,
|
|
57
|
-
chartSpec,
|
|
58
54
|
isProcessed,
|
|
59
55
|
loading,
|
|
60
56
|
processResults,
|
|
@@ -74,7 +70,7 @@ export const useInitProcess = ({
|
|
|
74
70
|
evt == "compareTime:updated"
|
|
75
71
|
) {
|
|
76
72
|
await updateJsonformIdentifier({
|
|
77
|
-
jsonformSchema,
|
|
73
|
+
jsonformSchema: jsonformSchema.value,
|
|
78
74
|
// @ts-expect-error TODO payload coming from time update events is not an object with layers property
|
|
79
75
|
newLayers: _payload,
|
|
80
76
|
});
|
|
@@ -87,7 +83,6 @@ export const useInitProcess = ({
|
|
|
87
83
|
selectedStac,
|
|
88
84
|
jsonformEl,
|
|
89
85
|
jsonformSchema,
|
|
90
|
-
chartSpec,
|
|
91
86
|
isProcessed,
|
|
92
87
|
processResults,
|
|
93
88
|
loading,
|
|
@@ -19,7 +19,9 @@ export async function handleVedaEndpoint({
|
|
|
19
19
|
enableCompare = false,
|
|
20
20
|
}) {
|
|
21
21
|
const vedaLink = links.find(
|
|
22
|
-
(link) =>
|
|
22
|
+
(link) =>
|
|
23
|
+
link.rel === "service" &&
|
|
24
|
+
(link.endpoint === "veda" || link.endpoint === "veda_stac"),
|
|
23
25
|
);
|
|
24
26
|
if (!vedaLink) {
|
|
25
27
|
return;
|
|
@@ -117,12 +119,14 @@ async function fetchVedaCOGsConfig(selectedStac, absoluteUrl, vedaLink) {
|
|
|
117
119
|
const itemLinks = collection.links.filter((link) => link.rel == "item");
|
|
118
120
|
configs.push(
|
|
119
121
|
...itemLinks.map((link) => {
|
|
120
|
-
const endpoint = /** @type {string} */ (
|
|
122
|
+
const endpoint = /** @type {string} */ (
|
|
123
|
+
vedaLink.endpoint === "veda_stac" ? link.id : link["cog_href"]
|
|
124
|
+
);
|
|
121
125
|
return {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
endpoint,
|
|
127
|
+
datetime: /** @type string **/ (link[datetimeProperty]),
|
|
128
|
+
};
|
|
129
|
+
}),
|
|
126
130
|
);
|
|
127
131
|
}
|
|
128
132
|
|
|
@@ -12,6 +12,10 @@ import {
|
|
|
12
12
|
datetime,
|
|
13
13
|
indicator,
|
|
14
14
|
poi,
|
|
15
|
+
chartData,
|
|
16
|
+
chartSpec,
|
|
17
|
+
compareChartData,
|
|
18
|
+
compareChartSpec,
|
|
15
19
|
} from "@/store/states";
|
|
16
20
|
import axios from "@/plugins/axios";
|
|
17
21
|
import { processCharts, processLayers, processSTAC } from "./outputs";
|
|
@@ -30,7 +34,6 @@ import { getLayers } from "@/store/actions";
|
|
|
30
34
|
* @param {import("vue").Ref<import("stac-ts").StacCollection | null>} params.selectedStac
|
|
31
35
|
* @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} params.jsonformEl
|
|
32
36
|
* @param {import("vue").Ref<Record<string,any> | null>} params.jsonformSchema
|
|
33
|
-
* @param {import("vue").Ref<import("@eox/chart").EOxChart["spec"] | null>} params.chartSpec
|
|
34
37
|
* @param {import("vue").Ref<any[]>} params.processResults
|
|
35
38
|
* @param {import("vue").Ref<boolean>} params.isProcessed
|
|
36
39
|
* @param {import("vue").Ref<boolean>} params.loading
|
|
@@ -41,7 +44,6 @@ export async function initProcess({
|
|
|
41
44
|
selectedStac,
|
|
42
45
|
jsonformEl,
|
|
43
46
|
jsonformSchema,
|
|
44
|
-
chartSpec,
|
|
45
47
|
isProcessed,
|
|
46
48
|
processResults,
|
|
47
49
|
loading,
|
|
@@ -64,25 +66,27 @@ export async function initProcess({
|
|
|
64
66
|
resetProcess({
|
|
65
67
|
loading,
|
|
66
68
|
isProcessed,
|
|
67
|
-
chartSpec,
|
|
68
69
|
jsonformSchema,
|
|
69
70
|
isPolling,
|
|
70
71
|
processResults,
|
|
72
|
+
enableCompare,
|
|
71
73
|
});
|
|
72
74
|
|
|
73
75
|
await jsonformEl.value?.editor.destroy();
|
|
74
76
|
if (updatedJsonform) {
|
|
75
77
|
// make sure correct target layer id is used in jsonform
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
78
|
+
let newJsonForm = null;
|
|
79
|
+
newJsonForm = await updateJsonformIdentifier({
|
|
80
|
+
jsonformSchema: updatedJsonform,
|
|
81
|
+
newLayers: getLayers(),
|
|
82
|
+
});
|
|
82
83
|
if (enableCompare) {
|
|
83
|
-
|
|
84
|
+
newJsonForm = updateJsonformSchemaTarget(newJsonForm);
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
+
// trigger jsonform update in next tick
|
|
87
|
+
jsonformSchema.value = null;
|
|
88
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
89
|
+
jsonformSchema.value = newJsonForm;
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
92
|
|
|
@@ -92,11 +96,12 @@ export async function initProcess({
|
|
|
92
96
|
* @export
|
|
93
97
|
* @async
|
|
94
98
|
* @param {Object} params
|
|
95
|
-
* @param {
|
|
99
|
+
* @param {Record<string,any> | null} params.jsonformSchema params.jsonformSchema
|
|
96
100
|
* @param {Record<string, any>[] | undefined} params.newLayers params.newLayers
|
|
101
|
+
* @returns {Promise<Record<string,any> | null | undefined>} updated jsonform schema
|
|
97
102
|
*/
|
|
98
103
|
export async function updateJsonformIdentifier({ jsonformSchema, newLayers }) {
|
|
99
|
-
const form = jsonformSchema
|
|
104
|
+
const form = jsonformSchema;
|
|
100
105
|
if (!form) {
|
|
101
106
|
return;
|
|
102
107
|
}
|
|
@@ -128,9 +133,8 @@ export async function updateJsonformIdentifier({ jsonformSchema, newLayers }) {
|
|
|
128
133
|
return;
|
|
129
134
|
}
|
|
130
135
|
for (const layer of layersArray) {
|
|
131
|
-
if (layer.layers) {
|
|
132
|
-
|
|
133
|
-
traverseLayers(layer);
|
|
136
|
+
if (layer.type === "Group" && Array.isArray(layer.layers)) {
|
|
137
|
+
traverseLayers(layer.layers);
|
|
134
138
|
} else {
|
|
135
139
|
if (layer.properties?.id?.startsWith(layerId)) {
|
|
136
140
|
matchedLayerId = layer.properties.id;
|
|
@@ -142,16 +146,15 @@ export async function updateJsonformIdentifier({ jsonformSchema, newLayers }) {
|
|
|
142
146
|
traverseLayers(layers);
|
|
143
147
|
if (matchedLayerId) {
|
|
144
148
|
form.properties.feature.options.drawtools.layerId = matchedLayerId;
|
|
145
|
-
|
|
146
|
-
jsonformSchema.value = null;
|
|
147
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
148
|
-
jsonformSchema.value = form;
|
|
149
|
+
return form;
|
|
149
150
|
} else {
|
|
150
|
-
|
|
151
|
+
console.warn(
|
|
151
152
|
`Could not find matching layer for processing form with id: ${layerId}`,
|
|
152
153
|
);
|
|
154
|
+
return null;
|
|
153
155
|
}
|
|
154
156
|
}
|
|
157
|
+
return form;
|
|
155
158
|
}
|
|
156
159
|
|
|
157
160
|
/**
|
|
@@ -161,8 +164,6 @@ export async function updateJsonformIdentifier({ jsonformSchema, newLayers }) {
|
|
|
161
164
|
* @param {import("vue").Ref<import("stac-ts").StacCollection | null>} params.selectedStac
|
|
162
165
|
* @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} params.jsonformEl
|
|
163
166
|
* @param {import("vue").Ref<Record<string,any>|null>} params.jsonformSchema
|
|
164
|
-
* @param {import("vue").Ref<import("@eox/chart").EOxChart["spec"] | null>} params.chartSpec
|
|
165
|
-
* @param {import("vue").Ref<Record<string, any> | null>} params.chartData
|
|
166
167
|
* @param {import("vue").Ref<boolean>} params.isPolling
|
|
167
168
|
* @param {import("vue").Ref<any[]>} params.processResults
|
|
168
169
|
* @param {import("@eox/map").EOxMap | null} params.mapElement
|
|
@@ -173,8 +174,6 @@ export async function handleProcesses({
|
|
|
173
174
|
selectedStac,
|
|
174
175
|
jsonformEl,
|
|
175
176
|
jsonformSchema,
|
|
176
|
-
chartSpec,
|
|
177
|
-
chartData,
|
|
178
177
|
isPolling,
|
|
179
178
|
processResults,
|
|
180
179
|
mapElement,
|
|
@@ -183,6 +182,7 @@ export async function handleProcesses({
|
|
|
183
182
|
if (!jsonformEl.value || !jsonformSchema.value || !selectedStac.value) {
|
|
184
183
|
return;
|
|
185
184
|
}
|
|
185
|
+
const enableCompare = mapElement?.id === "compare";
|
|
186
186
|
|
|
187
187
|
log.debug("Processing...");
|
|
188
188
|
loading.value = true;
|
|
@@ -204,12 +204,14 @@ export async function handleProcesses({
|
|
|
204
204
|
selectedStac.value?.["eodash:vegadefinition"]
|
|
205
205
|
);
|
|
206
206
|
const layerId = selectedStac.value?.id ?? "";
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
const usedChartSpec = enableCompare ? compareChartSpec : chartSpec;
|
|
208
|
+
const usedChartData = enableCompare ? compareChartData : chartData;
|
|
209
|
+
let tempChartSpec = null;
|
|
210
|
+
[tempChartSpec, usedChartData.value] = await processCharts({
|
|
209
211
|
links: serviceLinks,
|
|
210
212
|
jsonformValue: { ...(jsonformValue ?? {}) },
|
|
211
213
|
jsonformSchema: jsonformSchema.value,
|
|
212
|
-
enableCompare
|
|
214
|
+
enableCompare,
|
|
213
215
|
selectedStac: selectedStac.value,
|
|
214
216
|
specUrl,
|
|
215
217
|
isPolling,
|
|
@@ -217,19 +219,19 @@ export async function handleProcesses({
|
|
|
217
219
|
customEndpointsHandler: handleChartCustomEndpoints,
|
|
218
220
|
});
|
|
219
221
|
|
|
220
|
-
if (Object.keys(
|
|
221
|
-
processResults.value.push(
|
|
222
|
+
if (Object.keys(usedChartData.value ?? {}).length) {
|
|
223
|
+
processResults.value.push(usedChartData.value);
|
|
222
224
|
}
|
|
223
225
|
|
|
224
226
|
//@ts-expect-error we assume that the spec data is of type InlineData
|
|
225
|
-
if (
|
|
227
|
+
if (Object.keys(tempChartSpec?.data?.values ?? {}).length) {
|
|
226
228
|
//@ts-expect-error we assume that the spec data is of type InlineData
|
|
227
|
-
processResults.value.push(
|
|
229
|
+
processResults.value.push(tempChartSpec?.data.values);
|
|
228
230
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
chartSpec.value["background"] = "transparent";
|
|
231
|
+
if (tempChartSpec && !("background" in tempChartSpec)) {
|
|
232
|
+
tempChartSpec["background"] = "transparent";
|
|
232
233
|
}
|
|
234
|
+
usedChartSpec.value = tempChartSpec;
|
|
233
235
|
|
|
234
236
|
await processSTAC(
|
|
235
237
|
serviceLinks,
|
|
@@ -280,23 +282,24 @@ export async function handleProcesses({
|
|
|
280
282
|
* @param {Object} params
|
|
281
283
|
* @param {import("vue").Ref<boolean>} params.loading
|
|
282
284
|
* @param {import("vue").Ref<boolean>} params.isProcessed
|
|
283
|
-
* @param {import("vue").Ref<import("@eox/chart").EOxChart["spec"] | null>} params.chartSpec
|
|
284
285
|
* @param {import("vue").Ref<boolean>} params.isPolling
|
|
285
286
|
* @param {import("vue").Ref<any[]>} params.processResults
|
|
286
287
|
* @param {import("vue").Ref<Record<string,any>|null>} params.jsonformSchema
|
|
288
|
+
* @param {boolean} params.enableCompare
|
|
287
289
|
*/
|
|
288
290
|
export function resetProcess({
|
|
289
291
|
loading,
|
|
290
292
|
isProcessed,
|
|
291
|
-
chartSpec,
|
|
292
293
|
jsonformSchema,
|
|
293
294
|
processResults,
|
|
294
295
|
isPolling,
|
|
296
|
+
enableCompare,
|
|
295
297
|
}) {
|
|
296
298
|
loading.value = false;
|
|
297
299
|
isProcessed.value = false;
|
|
298
300
|
isPolling.value = false;
|
|
299
|
-
|
|
301
|
+
const usedChartSpec = enableCompare ? compareChartSpec : chartSpec;
|
|
302
|
+
usedChartSpec.value = null;
|
|
300
303
|
processResults.value = [];
|
|
301
304
|
jsonformSchema.value = null;
|
|
302
305
|
}
|
|
@@ -315,8 +318,7 @@ export const onChartClick = (evt) => {
|
|
|
315
318
|
const chartSpec = evt.target?.spec;
|
|
316
319
|
if (
|
|
317
320
|
!chartSpec ||
|
|
318
|
-
!evt.detail?.item?.datum
|
|
319
|
-
!evt.detail?.item?.datum.datum
|
|
321
|
+
(!evt.detail?.item?.datum && !evt.detail?.item?.datum.datum)
|
|
320
322
|
) {
|
|
321
323
|
return;
|
|
322
324
|
}
|
|
@@ -17,7 +17,7 @@ import { isFirstLoad } from "@/utils/states";
|
|
|
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("
|
|
20
|
+
* @returns {Promise<[import("vega-embed").VisualizationSpec | null,Record<string,any>|null]>}
|
|
21
21
|
**/
|
|
22
22
|
export async function processCharts({
|
|
23
23
|
links,
|
|
@@ -61,10 +61,50 @@ export 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
|
+
default:
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return [spec, dataValues];
|
|
107
|
+
}
|
|
68
108
|
try {
|
|
69
109
|
checkForData: for (const link of dataLinks ?? []) {
|
|
70
110
|
switch (link.type) {
|
|
@@ -104,7 +144,7 @@ export async function processCharts({
|
|
|
104
144
|
} catch (e) {
|
|
105
145
|
console.error("[eodash] Error while injecting Vega data", e);
|
|
106
146
|
}
|
|
107
|
-
return [spec, dataValues];
|
|
147
|
+
return [structuredClone(spec), structuredClone(dataValues)];
|
|
108
148
|
}
|
|
109
149
|
|
|
110
150
|
/**
|
|
@@ -543,7 +543,7 @@ export const applyProcessLayersToMap = (mapElement, processLayers) => {
|
|
|
543
543
|
(l) => l.properties?.id === layer.properties?.id,
|
|
544
544
|
);
|
|
545
545
|
if (!exists) {
|
|
546
|
-
analysisGroup.layers.
|
|
546
|
+
analysisGroup.layers.push(layer);
|
|
547
547
|
} else {
|
|
548
548
|
analysisGroup.layers = replaceLayer(
|
|
549
549
|
analysisGroup.layers,
|
|
@@ -564,7 +564,7 @@ export const applyProcessLayersToMap = (mapElement, processLayers) => {
|
|
|
564
564
|
};
|
|
565
565
|
/**
|
|
566
566
|
* Updates the jsonform schema to target the compare map
|
|
567
|
-
* @param {
|
|
567
|
+
* @param {Record<string,any> | null | undefined} jsonformSchema
|
|
568
568
|
*/
|
|
569
569
|
export function updateJsonformSchemaTarget(jsonformSchema) {
|
|
570
570
|
if (!jsonformSchema) {
|
|
@@ -574,7 +574,5 @@ export function updateJsonformSchemaTarget(jsonformSchema) {
|
|
|
574
574
|
"eox-map#main",
|
|
575
575
|
"eox-map#compare",
|
|
576
576
|
);
|
|
577
|
-
return
|
|
578
|
-
JSON.parse(stringified)
|
|
579
|
-
);
|
|
577
|
+
return JSON.parse(stringified);
|
|
580
578
|
}
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
.body="body"
|
|
7
7
|
.featured="featured"
|
|
8
8
|
.footer="footer"
|
|
9
|
-
.styleOverride="styleOverride"
|
|
10
9
|
.header="header"
|
|
11
|
-
.subheader="subheader"
|
|
12
10
|
.tags="tags"
|
|
13
11
|
style="--color-primary-lighter: none"
|
|
14
12
|
>
|
|
@@ -20,25 +18,12 @@
|
|
|
20
18
|
import "@eox/stacinfo";
|
|
21
19
|
import { currentUrl } from "@/store/states";
|
|
22
20
|
|
|
23
|
-
const {
|
|
24
|
-
allowHtml,
|
|
25
|
-
featured,
|
|
26
|
-
footer,
|
|
27
|
-
header,
|
|
28
|
-
body,
|
|
29
|
-
styleOverride,
|
|
30
|
-
subheader,
|
|
31
|
-
tags,
|
|
32
|
-
} = defineProps({
|
|
21
|
+
const { allowHtml, featured, footer, header, body, tags } = defineProps({
|
|
33
22
|
allowHtml: {
|
|
34
23
|
type: Boolean,
|
|
35
24
|
default: true,
|
|
36
25
|
},
|
|
37
26
|
|
|
38
|
-
styleOverride: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: "",
|
|
41
|
-
},
|
|
42
27
|
header: {
|
|
43
28
|
/** @type {import("vue").PropType<string[]>} */
|
|
44
29
|
type: Array,
|
|
@@ -49,15 +34,17 @@ const {
|
|
|
49
34
|
type: Array,
|
|
50
35
|
default: () => ["themes"],
|
|
51
36
|
},
|
|
52
|
-
subheader: {
|
|
53
|
-
/** @type {import("vue").PropType<string[]>} */
|
|
54
|
-
type: Array,
|
|
55
|
-
default: () => [],
|
|
56
|
-
},
|
|
57
37
|
body: {
|
|
58
38
|
/** @type {import("vue").PropType<string[]>} */
|
|
59
39
|
type: Array,
|
|
60
|
-
default: () => [
|
|
40
|
+
default: () => [
|
|
41
|
+
"satellite",
|
|
42
|
+
"sensor",
|
|
43
|
+
"insituSources",
|
|
44
|
+
"otherSources",
|
|
45
|
+
"agency",
|
|
46
|
+
"extent",
|
|
47
|
+
],
|
|
61
48
|
},
|
|
62
49
|
featured: {
|
|
63
50
|
/** @type {import("vue").PropType<string[]>} */
|
|
@@ -67,7 +54,7 @@ const {
|
|
|
67
54
|
footer: {
|
|
68
55
|
/** @type {import("vue").PropType<string[]>} */
|
|
69
56
|
type: Array,
|
|
70
|
-
default: () => ["sci:citation"],
|
|
57
|
+
default: () => ["sci:citation", "sci:doi", "sci:publication"],
|
|
71
58
|
},
|
|
72
59
|
});
|
|
73
60
|
</script>
|