@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
|
@@ -3,7 +3,7 @@ import { defineCustomElement } from "vue";
|
|
|
3
3
|
import { registerPlugins } from "./plugins";
|
|
4
4
|
/**
|
|
5
5
|
* @type {import("vue").VueElementConstructor<
|
|
6
|
-
* import("vue").ExtractPropTypes<{ config
|
|
6
|
+
* import("vue").ExtractPropTypes<{ config?: string | Function }>>}
|
|
7
7
|
* */
|
|
8
8
|
const EodashConstructor = defineCustomElement(App, {
|
|
9
9
|
//styles will be imported here using vite-plugin-vue-custom-element-style-injector
|
|
@@ -10,7 +10,9 @@ import { inject, reactive } from "vue";
|
|
|
10
10
|
* @returns {Promise<import("@/types").Eodash | null | undefined>}
|
|
11
11
|
* @see {@linkplain '@/eodash.js'}
|
|
12
12
|
*/
|
|
13
|
-
export const useEodashRuntime = async (
|
|
13
|
+
export const useEodashRuntime = async (
|
|
14
|
+
runtimeConfig = process.env.EODASH_RUNTIME_CONFIG,
|
|
15
|
+
) => {
|
|
14
16
|
let eodashConfig;
|
|
15
17
|
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
16
18
|
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { defineAsyncComponent, reactive, shallowRef, watch } from "vue";
|
|
2
2
|
import { useSTAcStore } from "@/store/stac";
|
|
3
3
|
import { storeToRefs } from "pinia";
|
|
4
|
-
|
|
4
|
+
import {
|
|
5
|
+
areChartsSeparateLayout,
|
|
6
|
+
chartSpec,
|
|
7
|
+
compareChartSpec,
|
|
8
|
+
} from "@/store/states";
|
|
5
9
|
/**
|
|
6
10
|
* @typedef {{
|
|
7
11
|
* component: import("vue").Component | null;
|
|
@@ -71,7 +75,13 @@ export const useDefineWidgets = (widgetConfigs) => {
|
|
|
71
75
|
if ("defineWidget" in (config ?? {})) {
|
|
72
76
|
const { selectedStac, selectedCompareStac } = storeToRefs(useSTAcStore());
|
|
73
77
|
watch(
|
|
74
|
-
[
|
|
78
|
+
[
|
|
79
|
+
selectedStac,
|
|
80
|
+
selectedCompareStac,
|
|
81
|
+
areChartsSeparateLayout,
|
|
82
|
+
chartSpec,
|
|
83
|
+
compareChartSpec,
|
|
84
|
+
],
|
|
75
85
|
([updatedStac, updatedCompareStac]) => {
|
|
76
86
|
let definedConfig =
|
|
77
87
|
/** @type {import("@/types").FunctionalWidget} */ (
|
|
@@ -28,6 +28,8 @@ import {
|
|
|
28
28
|
import axios from "@/plugins/axios";
|
|
29
29
|
import log from "loglevel";
|
|
30
30
|
import { dataThemesBrands } from "@/utils/states";
|
|
31
|
+
import { useEventBus } from "@vueuse/core";
|
|
32
|
+
import { eoxLayersKey } from "@/utils/keys";
|
|
31
33
|
|
|
32
34
|
export class EodashCollection {
|
|
33
35
|
#collectionUrl = "";
|
|
@@ -129,26 +131,20 @@ export class EodashCollection {
|
|
|
129
131
|
const item = new Item(this.selectedItem);
|
|
130
132
|
this.selectedItem = item;
|
|
131
133
|
const title = this.#collectionStac?.title || this.#collectionStac?.id || "";
|
|
132
|
-
layersJson.
|
|
133
|
-
...(await this.buildJsonArray(
|
|
134
|
-
item,
|
|
135
|
-
stacItemUrl,
|
|
136
|
-
title,
|
|
137
|
-
isObservationPoint,
|
|
138
|
-
)),
|
|
134
|
+
layersJson.push(
|
|
135
|
+
...(await this.buildJsonArray(item, title, isObservationPoint)),
|
|
139
136
|
);
|
|
140
137
|
return layersJson;
|
|
141
138
|
};
|
|
142
139
|
|
|
143
140
|
/**
|
|
144
141
|
* @param {import("stac-ts").StacItem} item
|
|
145
|
-
* @param {string} itemUrl
|
|
146
142
|
* @param {string} title
|
|
147
143
|
* @param {boolean} isObservationPoint
|
|
148
144
|
* @param {string} [itemDatetime]
|
|
149
145
|
* @returns {Promise<Record<string,any>[]>} layers
|
|
150
146
|
* */
|
|
151
|
-
async buildJsonArray(item,
|
|
147
|
+
async buildJsonArray(item, title, isObservationPoint, itemDatetime) {
|
|
152
148
|
if (!item) {
|
|
153
149
|
console.warn("[eodash] no item provided to buildJsonArray");
|
|
154
150
|
return [];
|
|
@@ -157,7 +153,6 @@ export class EodashCollection {
|
|
|
157
153
|
log.debug(
|
|
158
154
|
"Building JSON array",
|
|
159
155
|
item,
|
|
160
|
-
itemUrl,
|
|
161
156
|
title,
|
|
162
157
|
isObservationPoint,
|
|
163
158
|
itemDatetime,
|
|
@@ -184,19 +179,6 @@ export class EodashCollection {
|
|
|
184
179
|
// will try to extract anything it supports but for which we have
|
|
185
180
|
// less control.
|
|
186
181
|
|
|
187
|
-
const rasterformURL = /** @type {string|undefined} */ (
|
|
188
|
-
this.#collectionStac?.["eodash:rasterform"]
|
|
189
|
-
);
|
|
190
|
-
/** @type {import("@/types").EodashRasterJSONForm|undefined} */
|
|
191
|
-
const rasterForm = rasterformURL
|
|
192
|
-
? await axios.get(rasterformURL).then((resp) => resp.data)
|
|
193
|
-
: undefined;
|
|
194
|
-
let { layerConfig, style } = extractLayerConfig(
|
|
195
|
-
this.#collectionStac?.id ?? "",
|
|
196
|
-
await fetchStyle(item, itemUrl),
|
|
197
|
-
rasterForm,
|
|
198
|
-
);
|
|
199
|
-
|
|
200
182
|
const { layerDatetime, timeControlValues } = extractLayerTimeValues(
|
|
201
183
|
await this.getItems(),
|
|
202
184
|
item.properties?.datetime ??
|
|
@@ -210,6 +192,7 @@ export class EodashCollection {
|
|
|
210
192
|
}
|
|
211
193
|
return data;
|
|
212
194
|
}, /** @type {Record<string,import('stac-ts').StacAsset>} */ ({}));
|
|
195
|
+
|
|
213
196
|
const isSupported =
|
|
214
197
|
item.links.some((link) =>
|
|
215
198
|
["wms", "xyz", "wmts", "vector-tile"].includes(link.rel),
|
|
@@ -231,31 +214,28 @@ export class EodashCollection {
|
|
|
231
214
|
this.#collectionStac?.id ?? "",
|
|
232
215
|
title,
|
|
233
216
|
item,
|
|
234
|
-
itemUrl,
|
|
235
217
|
layerDatetime,
|
|
236
218
|
extraProperties,
|
|
219
|
+
this.#collectionStac,
|
|
237
220
|
);
|
|
238
221
|
|
|
239
222
|
jsonArray.push(
|
|
240
223
|
...((this.rasterEndpoint &&
|
|
241
|
-
createLayerFromRender(
|
|
224
|
+
(await createLayerFromRender(
|
|
242
225
|
this.rasterEndpoint,
|
|
243
226
|
this.#collectionStac,
|
|
244
227
|
item,
|
|
245
228
|
{
|
|
246
229
|
...extraProperties,
|
|
247
|
-
...(layerConfig && { layerConfig }),
|
|
248
230
|
...(layerDatetime && { layerDatetime }),
|
|
249
231
|
},
|
|
250
|
-
)) ||
|
|
232
|
+
))) ||
|
|
251
233
|
[]),
|
|
252
234
|
...(await createLayersFromAssets(
|
|
253
235
|
this.#collectionStac?.id ?? "",
|
|
254
236
|
title || this.#collectionStac?.title || item.id,
|
|
255
237
|
dataAssets,
|
|
256
238
|
item,
|
|
257
|
-
style,
|
|
258
|
-
layerConfig,
|
|
259
239
|
layerDatetime,
|
|
260
240
|
extraProperties,
|
|
261
241
|
)),
|
|
@@ -263,6 +243,10 @@ export class EodashCollection {
|
|
|
263
243
|
...links,
|
|
264
244
|
);
|
|
265
245
|
} else {
|
|
246
|
+
// get the correct style which is not attached to a link
|
|
247
|
+
const id = this.#collectionStac?.id ?? "";
|
|
248
|
+
const styles = await fetchStyle(item);
|
|
249
|
+
let { layerConfig, style } = extractLayerConfig(id, styles);
|
|
266
250
|
// fallback to STAC
|
|
267
251
|
const json = {
|
|
268
252
|
type: "STAC",
|
|
@@ -270,7 +254,7 @@ export class EodashCollection {
|
|
|
270
254
|
displayFootprint: false,
|
|
271
255
|
data: item,
|
|
272
256
|
properties: {
|
|
273
|
-
id
|
|
257
|
+
id,
|
|
274
258
|
title: title || item.id,
|
|
275
259
|
layerConfig,
|
|
276
260
|
},
|
|
@@ -404,10 +388,7 @@ export class EodashCollection {
|
|
|
404
388
|
return [];
|
|
405
389
|
}
|
|
406
390
|
// get all style links, which could contribute by tooltip config and aggregate them
|
|
407
|
-
const styles = await fetchAllStyles(
|
|
408
|
-
this.selectedItem,
|
|
409
|
-
`${this.#collectionUrl}/${this.selectedItem.id}`,
|
|
410
|
-
);
|
|
391
|
+
const styles = await fetchAllStyles(this.selectedItem);
|
|
411
392
|
// get only unique ids to avoid duplicates
|
|
412
393
|
const aggregatedTooltips = [
|
|
413
394
|
...new Map(
|
|
@@ -451,7 +432,6 @@ export class EodashCollection {
|
|
|
451
432
|
// if specifiedLink is an item, we create layers from it
|
|
452
433
|
newLayers = await this.buildJsonArray(
|
|
453
434
|
specifiedLink,
|
|
454
|
-
this.#collectionUrl + `/items/${specifiedLink.id}`,
|
|
455
435
|
this.#collectionStac?.title || this.#collectionStac?.id || "",
|
|
456
436
|
this.#collectionStac?.endpointtype === "GeoDB" ||
|
|
457
437
|
!!this.#collectionStac?.locations,
|
|
@@ -480,6 +460,10 @@ export class EodashCollection {
|
|
|
480
460
|
newLayers,
|
|
481
461
|
);
|
|
482
462
|
|
|
463
|
+
// Emit event to update potential widget dependencies such as process layer ids
|
|
464
|
+
const layersEvents = useEventBus(eoxLayersKey);
|
|
465
|
+
layersEvents.emit("layertime:updated", newLayers);
|
|
466
|
+
|
|
483
467
|
return updatedLayers;
|
|
484
468
|
}
|
|
485
469
|
|
|
@@ -502,17 +486,16 @@ export class EodashCollection {
|
|
|
502
486
|
);
|
|
503
487
|
|
|
504
488
|
return [
|
|
505
|
-
//@ts-expect-error indicator instead of item
|
|
506
489
|
...(await createLayersFromLinks(
|
|
507
490
|
indicator?.id ?? "",
|
|
508
491
|
indicator?.title || indicator.id,
|
|
492
|
+
//@ts-expect-error indicator instead of item
|
|
509
493
|
indicator,
|
|
510
494
|
)),
|
|
511
495
|
...(await createLayersFromAssets(
|
|
512
496
|
indicator?.id ?? "",
|
|
513
497
|
indicator?.title || indicator.id,
|
|
514
498
|
indicatorAssets,
|
|
515
|
-
//@ts-expect-error indicator instead of item
|
|
516
499
|
indicator,
|
|
517
500
|
)),
|
|
518
501
|
];
|