@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.
- package/core/client/asWebComponent.js +1 -1
- package/core/client/composables/DefineEodash.js +3 -1
- package/core/client/composables/DefineWidgets.js +12 -2
- package/core/client/eodashSTAC/EodashCollection.js +20 -37
- package/core/client/eodashSTAC/createLayers.js +306 -136
- package/core/client/eodashSTAC/helpers.js +60 -40
- package/core/client/eodashSTAC/parquet.js +2 -0
- package/core/client/eodashSTAC/triggers.js +5 -5
- package/core/client/store/actions.js +17 -17
- package/core/client/store/states.js +26 -4
- package/core/client/types.ts +12 -1
- package/core/client/utils/index.js +18 -1
- package/dist/client/{DashboardLayout-Cp8Rv3Ef.js → DashboardLayout-CkSgvaFF.js} +2 -2
- package/dist/client/{DynamicWebComponent-CBsxC82P.js → DynamicWebComponent-Ncsg6fb9.js} +1 -1
- package/dist/client/EodashChart-5v7adDpG.js +144 -0
- package/dist/client/{EodashDatePicker-Dewym-cx.js → EodashDatePicker-RoQJe6ss.js} +4 -4
- package/dist/client/{EodashItemFilter-CAsZpOoQ.js → EodashItemFilter-CCoVC5BE.js} +2 -2
- package/dist/client/{EodashLayerControl-fn-rt8Ac.js → EodashLayerControl-weVj7aQA.js} +2 -2
- package/dist/client/{EodashLayoutSwitcher-B9XqQXCS.js → EodashLayoutSwitcher-CL-Z9d5_.js} +3 -3
- package/dist/client/EodashMapBtns-CXU8IuPO.js +433 -0
- package/dist/client/{EodashStacInfo-lxBKoav9.js → EodashStacInfo-BbMnjf-n.js} +11 -15
- package/dist/client/{EodashTimeSlider-DI97QkNT.js → EodashTimeSlider-BZXnqfax.js} +2 -2
- package/dist/client/{EodashTools-D5ShUT1g.js → EodashTools-DUJlkkgx.js} +4 -4
- package/dist/client/{ExportState-ruNyRS2E.js → ExportState-CT3FQOHW.js} +46 -21
- package/dist/client/{Footer-IQNyfd78.js → Footer-D_iqP-1K.js} +1 -1
- package/dist/client/{Header-BBdi_-Lp.js → Header-Dzhnvsy-.js} +127 -17
- package/dist/client/MobileLayout-6Rg_PSO8.js +118 -0
- package/dist/client/{PopUp-DRgOmD7-.js → PopUp-DPPv_GSA.js} +8 -59
- package/dist/client/{ProcessList-DxyCFQdz.js → ProcessList-BIN_Mb27.js} +9 -13
- package/dist/client/{VImg-hwmwzSwG.js → VImg-DhbuvNrA.js} +2 -2
- package/dist/client/{VMain-vk4-rkw-.js → VMain-CVabY_NY.js} +1 -1
- package/dist/client/{VTooltip-BYUZeia1.js → VTooltip-Cc6au3Sn.js} +3 -4
- package/dist/client/{WidgetsContainer-DXD_8rqh.js → WidgetsContainer-ChqTJS4h.js} +1 -1
- package/dist/client/asWebComponent-DaIxULaA.js +9207 -0
- package/dist/client/{async-D1MvO_Z_.js → async-D6Lvv-fT.js} +15 -5
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-DM-E2MfG.js → forwardRefs--IccUBdR.js} +196 -37
- package/dist/client/{handling-CbgeKrqT.js → handling-DSA67d6E.js} +160 -37
- package/dist/client/{helpers-CtUlAW0N.js → helpers-BBSdbOmv.js} +239 -126
- package/dist/client/{index-DBo0F4Fv.js → index-6LlXNkke.js} +5 -3
- package/dist/client/{index-BJvLt3Xf.js → index-BS-8Y5FE.js} +34 -77
- package/dist/client/{index-BkW06-Lg.js → index-CQihL_c6.js} +55 -15
- package/dist/client/{index-BxDh5v-H.js → index-qsZhYR_6.js} +15 -16
- package/dist/client/templates.js +52 -2
- package/dist/client/{transition-BdzATvPB.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/composables/DefineEodash.d.ts +1 -1
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +27 -11
- package/dist/types/core/client/eodashSTAC/createLayers.d.ts +30 -23
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +11 -4
- 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 +7 -2
- 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 -19
- package/dist/types/widgets/EodashMap/index.vue.d.ts +647 -92
- 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 +18 -11
- package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +2 -2
- package/dist/types/widgets/EodashProcess/methods/utils.d.ts +1 -0
- 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 +23 -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 +73 -93
- package/widgets/EodashMap/index.vue +14 -2
- package/widgets/EodashMap/methods/btns.js +155 -0
- package/widgets/EodashMap/methods/create-layers-config.js +26 -3
- package/widgets/EodashMap/methods/index.js +2 -1
- package/widgets/EodashProcess/ProcessList.vue +2 -3
- package/widgets/EodashProcess/index.vue +19 -70
- package/widgets/EodashProcess/methods/async.js +1 -1
- package/widgets/EodashProcess/methods/composables.js +13 -6
- package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +20 -7
- package/widgets/EodashProcess/methods/handling.js +100 -22
- package/widgets/EodashProcess/methods/outputs.js +44 -4
- package/widgets/EodashProcess/methods/utils.js +11 -1
- package/widgets/EodashStacInfo.vue +10 -23
- package/widgets/ExportState.vue +9 -15
- package/dist/client/EodashMapBtns-nFY6MIAX.js +0 -301
- package/dist/client/MobileLayout-BfBeF-JF.js +0 -118
- 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,
|
|
3
|
-
import {
|
|
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,
|
|
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("
|
|
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) =>
|
|
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(
|
|
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
|
|
893
|
-
|
|
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
|
-
|
|
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
|
|
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(
|
|
1072
|
-
processResults.value.push(
|
|
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 (
|
|
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(
|
|
1201
|
+
processResults.value.push(tempChartSpec?.data.values);
|
|
1079
1202
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
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
|
-
|
|
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 };
|