@eodash/eodash 5.4.0 → 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.
- package/core/client/asWebComponent.js +1 -1
- package/core/client/composables/DefineWidgets.js +12 -2
- package/core/client/eodashSTAC/EodashCollection.js +3 -3
- package/core/client/eodashSTAC/createLayers.js +44 -17
- package/core/client/eodashSTAC/helpers.js +12 -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-CkSgvaFF.js} +2 -2
- package/dist/client/{DynamicWebComponent-CoLO8FEf.js → DynamicWebComponent-Ncsg6fb9.js} +1 -1
- package/dist/client/EodashChart-5v7adDpG.js +144 -0
- package/dist/client/{EodashDatePicker-BZeQ6bcu.js → EodashDatePicker-RoQJe6ss.js} +4 -4
- package/dist/client/{EodashItemFilter-CmZkk7GK.js → EodashItemFilter-CCoVC5BE.js} +2 -2
- package/dist/client/{EodashLayerControl-D54fY-bX.js → EodashLayerControl-weVj7aQA.js} +2 -2
- package/dist/client/{EodashLayoutSwitcher-BCP3FvDb.js → EodashLayoutSwitcher-CL-Z9d5_.js} +3 -3
- package/dist/client/EodashMapBtns-CXU8IuPO.js +433 -0
- package/dist/client/{EodashStacInfo-BZbmT8vT.js → EodashStacInfo-BbMnjf-n.js} +11 -15
- package/dist/client/{EodashTimeSlider-DIcAJr6D.js → EodashTimeSlider-BZXnqfax.js} +2 -2
- package/dist/client/{EodashTools-Cz6X6hsF.js → EodashTools-DUJlkkgx.js} +4 -4
- package/dist/client/{ExportState-DFVFAgKz.js → ExportState-CT3FQOHW.js} +46 -21
- package/dist/client/{Footer-DLzQcjkI.js → Footer-D_iqP-1K.js} +1 -1
- package/dist/client/{Header-_D9Z-zFJ.js → Header-Dzhnvsy-.js} +127 -17
- package/dist/client/MobileLayout-6Rg_PSO8.js +118 -0
- package/dist/client/{PopUp-DwI8V2gW.js → PopUp-DPPv_GSA.js} +8 -59
- package/dist/client/{ProcessList-C9eAg2Sb.js → ProcessList-BIN_Mb27.js} +9 -13
- package/dist/client/{VImg-COXTnCWE.js → VImg-DhbuvNrA.js} +2 -2
- package/dist/client/{VMain-C74l1bv-.js → VMain-CVabY_NY.js} +1 -1
- package/dist/client/{VTooltip-BLS-cQ9N.js → VTooltip-Cc6au3Sn.js} +3 -4
- package/dist/client/{WidgetsContainer-D-VfMRxE.js → WidgetsContainer-ChqTJS4h.js} +1 -1
- package/dist/client/asWebComponent-DaIxULaA.js +9207 -0
- package/dist/client/{async-D4G-FOIc.js → async-D6Lvv-fT.js} +4 -4
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-CRMFoNYN.js → forwardRefs--IccUBdR.js} +196 -37
- package/dist/client/{handling-DTAhQuPh.js → handling-DSA67d6E.js} +74 -35
- package/dist/client/{helpers-CsjKHAcK.js → helpers-BBSdbOmv.js} +187 -87
- package/dist/client/{index-DEmHaCL3.js → index-6LlXNkke.js} +5 -3
- package/dist/client/{index-BHilH1qx.js → index-BS-8Y5FE.js} +22 -69
- package/dist/client/{index-BIcmbjr0.js → index-CQihL_c6.js} +27 -14
- package/dist/client/{index-BoCcZ0l4.js → index-qsZhYR_6.js} +15 -16
- package/dist/client/templates.js +48 -2
- package/dist/client/{transition-6MJLK-_H.js → transition-DFr4cXu8.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 +1 -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 +5 -11
- package/dist/types/widgets/EodashProcess/methods/outputs.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 +2 -1
- package/templates/compare.js +28 -1
- package/templates/expert.js +19 -1
- package/widgets/EodashChart.vue +139 -0
- 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 +18 -61
- package/widgets/EodashProcess/methods/async.js +1 -1
- package/widgets/EodashProcess/methods/composables.js +0 -5
- package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +10 -6
- package/widgets/EodashProcess/methods/handling.js +23 -22
- package/widgets/EodashProcess/methods/outputs.js +44 -4
- package/widgets/EodashProcess/methods/utils.js +1 -1
- 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
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<!-- prettier-ignore -->
|
|
47
47
|
<EodashMapBtns
|
|
48
48
|
:style="{
|
|
49
|
-
gridColumn: (indicator || compareIndicator || poi) ? responsiveX : '12',
|
|
49
|
+
gridColumn: (indicator || compareIndicator || poi) && !isGlobe ? responsiveX : '12',
|
|
50
50
|
gridRow: responsiveY,
|
|
51
51
|
}"
|
|
52
52
|
:exportMap="(indicator || compareIndicator || poi) ? btnsProps.exportMap : false"
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"
|
|
61
61
|
:enableZoom="(indicator || compareIndicator || poi) ? btnsProps.enableZoom : false
|
|
62
62
|
"
|
|
63
|
+
:enableGlobe="(indicator || compareIndicator || poi) ? btnsProps.enableGlobe : false"
|
|
63
64
|
:searchParams="btnsProps.searchParams"
|
|
64
65
|
/>
|
|
65
66
|
</div>
|
|
@@ -77,6 +78,7 @@ import {
|
|
|
77
78
|
indicator,
|
|
78
79
|
compareIndicator,
|
|
79
80
|
poi,
|
|
81
|
+
isGlobe,
|
|
80
82
|
} from "@/store/states";
|
|
81
83
|
import { storeToRefs } from "pinia";
|
|
82
84
|
import { useSTAcStore } from "@/store/stac";
|
|
@@ -139,6 +141,7 @@ const props = defineProps({
|
|
|
139
141
|
* enableSearch?: boolean;
|
|
140
142
|
* searchParams?: object;
|
|
141
143
|
* enableZoom?: boolean;
|
|
144
|
+
* enableGlobe?: boolean;
|
|
142
145
|
* enableCompareIndicators?: boolean | {
|
|
143
146
|
* compareTemplate?:string;
|
|
144
147
|
* fallbackTemplate?:string;
|
|
@@ -153,6 +156,7 @@ const props = defineProps({
|
|
|
153
156
|
enableBackToPOIs: true,
|
|
154
157
|
enableSearch: true,
|
|
155
158
|
enableZoom: true,
|
|
159
|
+
enableGlobe: true,
|
|
156
160
|
searchParams: {},
|
|
157
161
|
}),
|
|
158
162
|
},
|
|
@@ -195,9 +199,13 @@ const btnsProps = computed(() => ({
|
|
|
195
199
|
backToPOIs: props.btns.enableBackToPOIs ?? true,
|
|
196
200
|
enableSearch: props.btns.enableSearch ?? true,
|
|
197
201
|
enableZoom: props.btns.enableZoom ?? true,
|
|
202
|
+
enableGlobe: props.btns.enableGlobe ?? true,
|
|
198
203
|
searchParams: props.btns.searchParams,
|
|
199
204
|
}));
|
|
200
205
|
|
|
206
|
+
if (btnsProps.value.enableGlobe) {
|
|
207
|
+
await import("@eox/map/src/plugins/globe");
|
|
208
|
+
}
|
|
201
209
|
// Prepare containers for scale line and cursor coordinates
|
|
202
210
|
const scaleLineRef = useTemplateRef("scale-line");
|
|
203
211
|
const cursorCoordsRef = useTemplateRef("cursor-coords");
|
|
@@ -386,7 +394,7 @@ onMounted(() => {
|
|
|
386
394
|
left: 24px;
|
|
387
395
|
bottom: 54px; /* Tighter spacing: watermark at 6px + ~48px */
|
|
388
396
|
color: rgba(0, 0, 0, 0.9);
|
|
389
|
-
font-size:
|
|
397
|
+
font-size: 10px;
|
|
390
398
|
font-family: var(--eox-body-font-family);
|
|
391
399
|
background: #fffe;
|
|
392
400
|
border-radius: 4px;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { getLayers, setActiveTemplate } from "@/store/actions";
|
|
2
|
+
import { useSTAcStore } from "@/store/stac";
|
|
3
|
+
import { activeTemplate, isGlobe, mapEl } from "@/store/states";
|
|
4
|
+
import { easeOut } from "ol/easing.js";
|
|
5
|
+
import { storeToRefs } from "pinia";
|
|
6
|
+
import { ref } from "vue";
|
|
7
|
+
import { triggerRef } from "vue";
|
|
8
|
+
|
|
9
|
+
export const switchGlobe = () => {
|
|
10
|
+
if (!mapEl.value) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (!isGlobe.value) {
|
|
14
|
+
mapEl.value.layers = addCorsAnonym([...getLayers()]);
|
|
15
|
+
}
|
|
16
|
+
mapEl.value.projection = isGlobe.value ? "EPSG:3857" : "globe";
|
|
17
|
+
if (isGlobe.value) {
|
|
18
|
+
showAllPanels();
|
|
19
|
+
} else hideAllPanels();
|
|
20
|
+
isGlobe.value = !isGlobe.value;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function hideAllPanels() {
|
|
24
|
+
const allPanels = document.querySelectorAll(
|
|
25
|
+
"eox-layout-item:not([class='bg-panel'])",
|
|
26
|
+
);
|
|
27
|
+
allPanels.forEach((panel) => {
|
|
28
|
+
if (!panel || !(panel instanceof HTMLElement)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
panel.style.display = "none";
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function showAllPanels() {
|
|
35
|
+
const allPanels = document.querySelectorAll(
|
|
36
|
+
"eox-layout-item:not([class='bg-panel'])",
|
|
37
|
+
);
|
|
38
|
+
allPanels.forEach((panel) => {
|
|
39
|
+
if (!panel || !(panel instanceof HTMLElement)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
panel.style.display = "";
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @param {import("@eox/map").EoxLayer[]} layers
|
|
48
|
+
* @return {import("@eox/map").EoxLayer[]}
|
|
49
|
+
*/
|
|
50
|
+
function addCorsAnonym(layers) {
|
|
51
|
+
//@ts-expect-error todo
|
|
52
|
+
return layers.map((layer) => {
|
|
53
|
+
if (layer.type === "Group") {
|
|
54
|
+
layer.layers = addCorsAnonym([...(layer.layers ?? [])]);
|
|
55
|
+
return layer;
|
|
56
|
+
}
|
|
57
|
+
// check if not mapbox style as a fix for ts error
|
|
58
|
+
if (layer.type === "MapboxStyle") {
|
|
59
|
+
return layer;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
...layer,
|
|
64
|
+
...(layer.source && {
|
|
65
|
+
source: {
|
|
66
|
+
...layer.source,
|
|
67
|
+
crossOrigin: "anonymous",
|
|
68
|
+
},
|
|
69
|
+
...(layer.sources && {
|
|
70
|
+
sources: layer.sources.map((source) => ({
|
|
71
|
+
...source,
|
|
72
|
+
crossOrigin: "anonymous",
|
|
73
|
+
})),
|
|
74
|
+
}),
|
|
75
|
+
}),
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const onMapZoomOut = () => {
|
|
81
|
+
const map = mapEl.value?.map;
|
|
82
|
+
const currentZoom = map?.getView().getZoom();
|
|
83
|
+
if (currentZoom !== undefined && currentZoom !== null) {
|
|
84
|
+
const view = map?.getView();
|
|
85
|
+
|
|
86
|
+
if (view !== undefined && view.getZoom()) {
|
|
87
|
+
view.animate({
|
|
88
|
+
zoom: currentZoom - 1,
|
|
89
|
+
duration: 250,
|
|
90
|
+
easing: easeOut,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const onMapZoomIn = () => {
|
|
97
|
+
const map = mapEl.value?.map;
|
|
98
|
+
const currentZoom = map?.getView().getZoom();
|
|
99
|
+
if (currentZoom !== undefined && currentZoom !== null) {
|
|
100
|
+
const view = map?.getView();
|
|
101
|
+
|
|
102
|
+
if (view !== undefined && view.getZoom()) {
|
|
103
|
+
view.animate({
|
|
104
|
+
zoom: currentZoom + 1,
|
|
105
|
+
duration: 250,
|
|
106
|
+
easing: easeOut,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const showCompareIndicators = ref(false);
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @param {boolean | {
|
|
116
|
+
* compareTemplate?:string;
|
|
117
|
+
* fallbackTemplate?:string;
|
|
118
|
+
* itemFilterConfig?:Partial<InstanceType<import("./EodashItemFilter.vue").default>["$props"]>
|
|
119
|
+
* }} compareIndicators
|
|
120
|
+
*/
|
|
121
|
+
export const onSelectCompareIndicator = (compareIndicators) => {
|
|
122
|
+
const compareTemplate =
|
|
123
|
+
(typeof compareIndicators === "object" &&
|
|
124
|
+
compareIndicators.compareTemplate) ||
|
|
125
|
+
"compare";
|
|
126
|
+
setActiveTemplate(compareTemplate);
|
|
127
|
+
showCompareIndicators.value = !showCompareIndicators.value;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
*
|
|
132
|
+
* @param {boolean | {
|
|
133
|
+
* compareTemplate?:string;
|
|
134
|
+
* fallbackTemplate?:string;
|
|
135
|
+
* itemFilterConfig?:Partial<InstanceType<import("./EodashItemFilter.vue").default>["$props"]>
|
|
136
|
+
* }} compareIndicators
|
|
137
|
+
*/
|
|
138
|
+
export const onCompareClick = (compareIndicators) => {
|
|
139
|
+
const { selectedStac, selectedCompareStac } = storeToRefs(useSTAcStore());
|
|
140
|
+
const { resetSelectedCompareSTAC } = useSTAcStore();
|
|
141
|
+
showCompareIndicators.value =
|
|
142
|
+
activeTemplate.value !==
|
|
143
|
+
((typeof compareIndicators === "object" &&
|
|
144
|
+
compareIndicators.compareTemplate) ||
|
|
145
|
+
"compare");
|
|
146
|
+
|
|
147
|
+
const fallbackTemplate =
|
|
148
|
+
(typeof compareIndicators === "object" &&
|
|
149
|
+
compareIndicators.fallbackTemplate) ||
|
|
150
|
+
"expert";
|
|
151
|
+
selectedCompareStac.value = null;
|
|
152
|
+
resetSelectedCompareSTAC();
|
|
153
|
+
setActiveTemplate(fallbackTemplate);
|
|
154
|
+
triggerRef(selectedStac);
|
|
155
|
+
};
|
|
@@ -82,7 +82,7 @@ export const createLayersConfig = async (
|
|
|
82
82
|
const observationPointsLayer =
|
|
83
83
|
EodashCollection.getObservationPointsLayer(eodashCols);
|
|
84
84
|
if (observationPointsLayer) {
|
|
85
|
-
dataLayers.layers.
|
|
85
|
+
dataLayers.layers.push(observationPointsLayer);
|
|
86
86
|
}
|
|
87
87
|
const baseLayers = {
|
|
88
88
|
type: "Group",
|
|
@@ -153,7 +153,7 @@ export const createLayersConfig = async (
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
if (baseLayers.layers.length) {
|
|
156
|
-
layersCollection.
|
|
156
|
+
layersCollection.unshift(baseLayers);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
const overlayLayers = {
|
|
@@ -171,7 +171,7 @@ export const createLayersConfig = async (
|
|
|
171
171
|
|
|
172
172
|
if (indicatorOverlays.length) {
|
|
173
173
|
overlayLayers.layers.push(...indicatorOverlays);
|
|
174
|
-
layersCollection.
|
|
174
|
+
layersCollection.push(overlayLayers);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
return layersCollection;
|
|
@@ -8,6 +8,7 @@ import { isFirstLoad } from "@/utils/states";
|
|
|
8
8
|
import { useEmitLayersUpdate, useOnLayersUpdate } from "@/composables";
|
|
9
9
|
import { mapPosition } from "@/store/states";
|
|
10
10
|
import { sanitizeBbox } from "@/eodashSTAC/helpers";
|
|
11
|
+
import { transformExtent } from "@eox/map";
|
|
11
12
|
/**
|
|
12
13
|
* Holder for previous compare map view as it is overwritten by sync
|
|
13
14
|
* @type { import("ol").View | null} mapElement
|
|
@@ -201,7 +202,7 @@ export const useInitMap = (
|
|
|
201
202
|
const b = updatedStac.extent?.spatial.bbox[0];
|
|
202
203
|
const sanitizedExtent = sanitizeBbox([...b]);
|
|
203
204
|
|
|
204
|
-
const reprojExtent =
|
|
205
|
+
const reprojExtent = transformExtent(
|
|
205
206
|
sanitizedExtent,
|
|
206
207
|
"EPSG:4326",
|
|
207
208
|
mapElement.value?.map?.getView().getProjection(),
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
>{{
|
|
26
26
|
new Date(item.job_start_datetime).toISOString().slice(0, 16)
|
|
27
27
|
}}
|
|
28
|
-
<v-icon
|
|
29
|
-
>
|
|
28
|
+
<v-icon :icon="[mdiOpenInNew]" />
|
|
29
|
+
</a>
|
|
30
30
|
</td>
|
|
31
31
|
<td>{{ item.status }}</td>
|
|
32
32
|
<td style="padding: 0px">
|
|
@@ -73,7 +73,6 @@
|
|
|
73
73
|
</div>
|
|
74
74
|
</template>
|
|
75
75
|
<script setup>
|
|
76
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
77
76
|
import {
|
|
78
77
|
mdiUploadBox,
|
|
79
78
|
mdiDownloadBox,
|
|
@@ -1,24 +1,19 @@
|
|
|
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="mt-2 text-right">
|
|
22
17
|
<v-btn
|
|
23
18
|
v-if="showExecBtn"
|
|
24
19
|
:loading="loading"
|
|
@@ -46,9 +41,10 @@ import "@eox/drawtools";
|
|
|
46
41
|
import "@eox/jsonform";
|
|
47
42
|
import { useSTAcStore } from "@/store/stac";
|
|
48
43
|
import { storeToRefs } from "pinia";
|
|
49
|
-
import { computed, ref,
|
|
44
|
+
import { computed, ref, useTemplateRef } from "vue";
|
|
50
45
|
import ProcessList from "./ProcessList.vue";
|
|
51
|
-
import
|
|
46
|
+
import EodashChart from "../EodashChart.vue";
|
|
47
|
+
import { handleProcesses } from "./methods/handling";
|
|
52
48
|
import { useInitProcess, useAutoExec } from "./methods/composables";
|
|
53
49
|
import { updateJobsStatus } from "./methods/async";
|
|
54
50
|
import {
|
|
@@ -56,8 +52,9 @@ import {
|
|
|
56
52
|
indicator,
|
|
57
53
|
mapCompareEl,
|
|
58
54
|
mapEl,
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
chartSpec,
|
|
56
|
+
compareChartSpec,
|
|
57
|
+
areChartsSeparateLayout,
|
|
61
58
|
} from "@/store/states";
|
|
62
59
|
import { download, getDrawToolsProperty } from "./methods/utils";
|
|
63
60
|
import { compareJobs, jobs } from "./states";
|
|
@@ -75,11 +72,7 @@ const { enableCompare, vegaEmbedOptions } = defineProps({
|
|
|
75
72
|
},
|
|
76
73
|
},
|
|
77
74
|
});
|
|
78
|
-
/** @type {import("vue").Ref<import("vega").Spec|null>} */
|
|
79
|
-
const chartSpec = ref(null);
|
|
80
75
|
|
|
81
|
-
/** @type {import("vue").Ref<Record<string,any>|null>} */
|
|
82
|
-
const chartData = ref(null);
|
|
83
76
|
const isProcessed = ref(false);
|
|
84
77
|
|
|
85
78
|
/** @type {import("vue").Ref<Record<string,any>|null>} */
|
|
@@ -89,16 +82,12 @@ const jsonformEl =
|
|
|
89
82
|
/** @type {Readonly<import("vue").ShallowRef<import("@eox/jsonform").EOxJSONForm | null>>} */ (
|
|
90
83
|
useTemplateRef("jsonformEl")
|
|
91
84
|
);
|
|
92
|
-
|
|
93
|
-
/** @type {Readonly<import("vue").ShallowRef<import("@eox/chart").EOxChart | null>>} */ (
|
|
94
|
-
useTemplateRef("chartElRef")
|
|
95
|
-
);
|
|
85
|
+
|
|
96
86
|
const isAsync = computed(
|
|
97
87
|
() =>
|
|
98
88
|
selectedStac.value?.links.filter((l) => l.endpoint === "eoxhub_workspaces")
|
|
99
89
|
.length,
|
|
100
90
|
);
|
|
101
|
-
const containerEl = useTemplateRef("container");
|
|
102
91
|
|
|
103
92
|
const loading = ref(false);
|
|
104
93
|
|
|
@@ -109,10 +98,7 @@ const isPolling = ref(false);
|
|
|
109
98
|
const processResults = ref([]);
|
|
110
99
|
|
|
111
100
|
const showExecBtn = computed(
|
|
112
|
-
() =>
|
|
113
|
-
!autoExec.value &&
|
|
114
|
-
(!!jsonformSchema.value || !!chartSpec.value) &&
|
|
115
|
-
!!jsonformEl.value,
|
|
101
|
+
() => !autoExec.value && !!jsonformSchema.value && !!jsonformEl.value,
|
|
116
102
|
);
|
|
117
103
|
const { selectedStac, selectedCompareStac } = storeToRefs(useSTAcStore());
|
|
118
104
|
const currentSelectedStac = enableCompare ? selectedCompareStac : selectedStac;
|
|
@@ -129,7 +115,6 @@ useInitProcess({
|
|
|
129
115
|
mapElement: mapElement.value,
|
|
130
116
|
jsonformEl,
|
|
131
117
|
jsonformSchema,
|
|
132
|
-
chartSpec,
|
|
133
118
|
isProcessed,
|
|
134
119
|
processResults,
|
|
135
120
|
loading,
|
|
@@ -165,7 +150,8 @@ const startProcess = async () => {
|
|
|
165
150
|
|
|
166
151
|
if (propertyIsEmpty) {
|
|
167
152
|
isProcessed.value = false;
|
|
168
|
-
|
|
153
|
+
const usedChartSpec = enableCompare ? compareChartSpec : chartSpec;
|
|
154
|
+
usedChartSpec.value = null;
|
|
169
155
|
return;
|
|
170
156
|
}
|
|
171
157
|
const errors = jsonformEl.value?.editor.validate();
|
|
@@ -181,8 +167,6 @@ const startProcess = async () => {
|
|
|
181
167
|
selectedStac: currentSelectedStac,
|
|
182
168
|
jsonformEl,
|
|
183
169
|
jsonformSchema,
|
|
184
|
-
chartSpec,
|
|
185
|
-
chartData,
|
|
186
170
|
loading,
|
|
187
171
|
isPolling,
|
|
188
172
|
processResults,
|
|
@@ -193,35 +177,8 @@ const startProcess = async () => {
|
|
|
193
177
|
if (isAsync.value) updateJobsStatus(currentJobs, currentIndicator.value);
|
|
194
178
|
};
|
|
195
179
|
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
180
|
</script>
|
|
220
181
|
<style>
|
|
221
|
-
eox-chart {
|
|
222
|
-
--background-color: transparent;
|
|
223
|
-
padding-top: 1em;
|
|
224
|
-
}
|
|
225
182
|
eox-jsonform {
|
|
226
183
|
padding: 0.7em;
|
|
227
184
|
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,
|
|
@@ -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,10 +66,10 @@ 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();
|
|
@@ -161,8 +163,6 @@ export async function updateJsonformIdentifier({ jsonformSchema, newLayers }) {
|
|
|
161
163
|
* @param {import("vue").Ref<import("stac-ts").StacCollection | null>} params.selectedStac
|
|
162
164
|
* @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} params.jsonformEl
|
|
163
165
|
* @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
166
|
* @param {import("vue").Ref<boolean>} params.isPolling
|
|
167
167
|
* @param {import("vue").Ref<any[]>} params.processResults
|
|
168
168
|
* @param {import("@eox/map").EOxMap | null} params.mapElement
|
|
@@ -173,8 +173,6 @@ export async function handleProcesses({
|
|
|
173
173
|
selectedStac,
|
|
174
174
|
jsonformEl,
|
|
175
175
|
jsonformSchema,
|
|
176
|
-
chartSpec,
|
|
177
|
-
chartData,
|
|
178
176
|
isPolling,
|
|
179
177
|
processResults,
|
|
180
178
|
mapElement,
|
|
@@ -183,6 +181,7 @@ export async function handleProcesses({
|
|
|
183
181
|
if (!jsonformEl.value || !jsonformSchema.value || !selectedStac.value) {
|
|
184
182
|
return;
|
|
185
183
|
}
|
|
184
|
+
const enableCompare = mapElement?.id === "compare";
|
|
186
185
|
|
|
187
186
|
log.debug("Processing...");
|
|
188
187
|
loading.value = true;
|
|
@@ -204,12 +203,14 @@ export async function handleProcesses({
|
|
|
204
203
|
selectedStac.value?.["eodash:vegadefinition"]
|
|
205
204
|
);
|
|
206
205
|
const layerId = selectedStac.value?.id ?? "";
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
const usedChartSpec = enableCompare ? compareChartSpec : chartSpec;
|
|
207
|
+
const usedChartData = enableCompare ? compareChartData : chartData;
|
|
208
|
+
let tempChartSpec = null;
|
|
209
|
+
[tempChartSpec, usedChartData.value] = await processCharts({
|
|
209
210
|
links: serviceLinks,
|
|
210
211
|
jsonformValue: { ...(jsonformValue ?? {}) },
|
|
211
212
|
jsonformSchema: jsonformSchema.value,
|
|
212
|
-
enableCompare
|
|
213
|
+
enableCompare,
|
|
213
214
|
selectedStac: selectedStac.value,
|
|
214
215
|
specUrl,
|
|
215
216
|
isPolling,
|
|
@@ -217,19 +218,19 @@ export async function handleProcesses({
|
|
|
217
218
|
customEndpointsHandler: handleChartCustomEndpoints,
|
|
218
219
|
});
|
|
219
220
|
|
|
220
|
-
if (Object.keys(
|
|
221
|
-
processResults.value.push(
|
|
221
|
+
if (Object.keys(usedChartData.value ?? {}).length) {
|
|
222
|
+
processResults.value.push(usedChartData.value);
|
|
222
223
|
}
|
|
223
224
|
|
|
224
225
|
//@ts-expect-error we assume that the spec data is of type InlineData
|
|
225
|
-
if (
|
|
226
|
+
if (tempChartSpec.data?.values?.length) {
|
|
226
227
|
//@ts-expect-error we assume that the spec data is of type InlineData
|
|
227
|
-
processResults.value.push(
|
|
228
|
+
processResults.value.push(tempChartSpec?.data.values);
|
|
228
229
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
chartSpec.value["background"] = "transparent";
|
|
230
|
+
if (tempChartSpec && !("background" in tempChartSpec)) {
|
|
231
|
+
tempChartSpec["background"] = "transparent";
|
|
232
232
|
}
|
|
233
|
+
usedChartSpec.value = tempChartSpec;
|
|
233
234
|
|
|
234
235
|
await processSTAC(
|
|
235
236
|
serviceLinks,
|
|
@@ -280,23 +281,24 @@ export async function handleProcesses({
|
|
|
280
281
|
* @param {Object} params
|
|
281
282
|
* @param {import("vue").Ref<boolean>} params.loading
|
|
282
283
|
* @param {import("vue").Ref<boolean>} params.isProcessed
|
|
283
|
-
* @param {import("vue").Ref<import("@eox/chart").EOxChart["spec"] | null>} params.chartSpec
|
|
284
284
|
* @param {import("vue").Ref<boolean>} params.isPolling
|
|
285
285
|
* @param {import("vue").Ref<any[]>} params.processResults
|
|
286
286
|
* @param {import("vue").Ref<Record<string,any>|null>} params.jsonformSchema
|
|
287
|
+
* @param {boolean} params.enableCompare
|
|
287
288
|
*/
|
|
288
289
|
export function resetProcess({
|
|
289
290
|
loading,
|
|
290
291
|
isProcessed,
|
|
291
|
-
chartSpec,
|
|
292
292
|
jsonformSchema,
|
|
293
293
|
processResults,
|
|
294
294
|
isPolling,
|
|
295
|
+
enableCompare,
|
|
295
296
|
}) {
|
|
296
297
|
loading.value = false;
|
|
297
298
|
isProcessed.value = false;
|
|
298
299
|
isPolling.value = false;
|
|
299
|
-
|
|
300
|
+
const usedChartSpec = enableCompare ? compareChartSpec : chartSpec;
|
|
301
|
+
usedChartSpec.value = null;
|
|
300
302
|
processResults.value = [];
|
|
301
303
|
jsonformSchema.value = null;
|
|
302
304
|
}
|
|
@@ -315,8 +317,7 @@ export const onChartClick = (evt) => {
|
|
|
315
317
|
const chartSpec = evt.target?.spec;
|
|
316
318
|
if (
|
|
317
319
|
!chartSpec ||
|
|
318
|
-
!evt.detail?.item?.datum
|
|
319
|
-
!evt.detail?.item?.datum.datum
|
|
320
|
+
(!evt.detail?.item?.datum && !evt.detail?.item?.datum.datum)
|
|
320
321
|
) {
|
|
321
322
|
return;
|
|
322
323
|
}
|