@eodash/eodash 5.3.3 → 5.4.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.
Files changed (58) hide show
  1. package/core/client/composables/DefineEodash.js +3 -1
  2. package/core/client/eodashSTAC/EodashCollection.js +18 -35
  3. package/core/client/eodashSTAC/createLayers.js +278 -135
  4. package/core/client/eodashSTAC/helpers.js +53 -40
  5. package/core/client/eodashSTAC/parquet.js +1 -0
  6. package/core/client/eodashSTAC/triggers.js +7 -6
  7. package/core/client/types.ts +3 -1
  8. package/dist/client/{DashboardLayout-Cp8Rv3Ef.js → DashboardLayout-CQOGHPW_.js} +2 -2
  9. package/dist/client/{DynamicWebComponent-CBsxC82P.js → DynamicWebComponent-CoLO8FEf.js} +1 -1
  10. package/dist/client/{EodashDatePicker-Dewym-cx.js → EodashDatePicker-BZeQ6bcu.js} +3 -3
  11. package/dist/client/{EodashItemFilter-CAsZpOoQ.js → EodashItemFilter-CmZkk7GK.js} +1 -1
  12. package/dist/client/{EodashLayerControl-fn-rt8Ac.js → EodashLayerControl-D54fY-bX.js} +2 -2
  13. package/dist/client/{EodashLayoutSwitcher-B9XqQXCS.js → EodashLayoutSwitcher-BCP3FvDb.js} +3 -3
  14. package/dist/client/{EodashMapBtns-nFY6MIAX.js → EodashMapBtns-D-HulIl1.js} +14 -9
  15. package/dist/client/{EodashStacInfo-lxBKoav9.js → EodashStacInfo-BZbmT8vT.js} +1 -1
  16. package/dist/client/{EodashTimeSlider-DI97QkNT.js → EodashTimeSlider-DIcAJr6D.js} +2 -2
  17. package/dist/client/{EodashTools-D5ShUT1g.js → EodashTools-Cz6X6hsF.js} +4 -4
  18. package/dist/client/{ExportState-ruNyRS2E.js → ExportState-DFVFAgKz.js} +4 -4
  19. package/dist/client/{Footer-IQNyfd78.js → Footer-DLzQcjkI.js} +1 -1
  20. package/dist/client/{Header-BBdi_-Lp.js → Header-_D9Z-zFJ.js} +2 -2
  21. package/dist/client/{MobileLayout-BfBeF-JF.js → MobileLayout-3Ko9XSfO.js} +2 -2
  22. package/dist/client/{PopUp-DRgOmD7-.js → PopUp-DwI8V2gW.js} +2 -2
  23. package/dist/client/{ProcessList-DxyCFQdz.js → ProcessList-C9eAg2Sb.js} +4 -4
  24. package/dist/client/{VImg-hwmwzSwG.js → VImg-COXTnCWE.js} +2 -2
  25. package/dist/client/{VMain-vk4-rkw-.js → VMain-C74l1bv-.js} +1 -1
  26. package/dist/client/{VTooltip-BYUZeia1.js → VTooltip-BLS-cQ9N.js} +2 -2
  27. package/dist/client/{WidgetsContainer-DXD_8rqh.js → WidgetsContainer-D-VfMRxE.js} +1 -1
  28. package/dist/client/{asWebComponent-DdguWGDI.js → asWebComponent-Bw03Jutr.js} +304 -181
  29. package/dist/client/{async-D1MvO_Z_.js → async-D4G-FOIc.js} +13 -3
  30. package/dist/client/eo-dash.js +1 -1
  31. package/dist/client/{forwardRefs-DM-E2MfG.js → forwardRefs-CRMFoNYN.js} +2 -2
  32. package/dist/client/{handling-CbgeKrqT.js → handling-DTAhQuPh.js} +94 -10
  33. package/dist/client/{helpers-CtUlAW0N.js → helpers-CsjKHAcK.js} +60 -47
  34. package/dist/client/{index-BJvLt3Xf.js → index-BHilH1qx.js} +17 -13
  35. package/dist/client/{index-BkW06-Lg.js → index-BIcmbjr0.js} +34 -7
  36. package/dist/client/{index-BxDh5v-H.js → index-BoCcZ0l4.js} +3 -3
  37. package/dist/client/{index-DBo0F4Fv.js → index-DEmHaCL3.js} +2 -2
  38. package/dist/client/templates.js +5 -1
  39. package/dist/client/{transition-BdzATvPB.js → transition-6MJLK-_H.js} +1 -1
  40. package/dist/types/core/client/composables/DefineEodash.d.ts +1 -1
  41. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +27 -11
  42. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +30 -23
  43. package/dist/types/core/client/eodashSTAC/helpers.d.ts +10 -4
  44. package/dist/types/core/client/types.d.ts +1 -1
  45. package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +2 -0
  46. package/dist/types/widgets/EodashMap/index.vue.d.ts +2 -0
  47. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +13 -0
  48. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +1 -0
  49. package/package.json +1 -1
  50. package/templates/expert.js +4 -0
  51. package/widgets/EodashMap/EodashMapBtns.vue +15 -0
  52. package/widgets/EodashMap/index.vue +4 -0
  53. package/widgets/EodashMap/methods/create-layers-config.js +23 -0
  54. package/widgets/EodashProcess/index.vue +1 -9
  55. package/widgets/EodashProcess/methods/composables.js +13 -1
  56. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +15 -6
  57. package/widgets/EodashProcess/methods/handling.js +77 -0
  58. package/widgets/EodashProcess/methods/utils.js +10 -0
@@ -42,13 +42,14 @@ export function generateFeatures(links, extraProperties = {}, rel = "item") {
42
42
  }
43
43
 
44
44
  /**
45
- * Sperates and extracts layerConfig (jsonform schema & legend) from a style json
45
+ * Spearates and extracts layerConfig (jsonform schema & legend) from a style json
46
46
  *
47
47
  * @param {string} collectionId
48
48
  * @param { import("@/types").EodashStyleJson} [style]
49
49
  * @param {Record<string,any>} [rasterJsonform]
50
+ * @param {string} [layerConfigType]
50
51
  * */
51
- export function extractLayerConfig(collectionId, style, rasterJsonform) {
52
+ export function extractLayerConfig(collectionId, style, rasterJsonform, layerConfigType) {
52
53
  if (!style && !rasterJsonform) {
53
54
  return { layerConfig: undefined, style: undefined };
54
55
  }
@@ -56,6 +57,10 @@ export function extractLayerConfig(collectionId, style, rasterJsonform) {
56
57
  style = { ...style };
57
58
  }
58
59
 
60
+ if (style?.variables && Object.keys(style.variables ?? {}).length) {
61
+ style.variables = getStyleVariablesState(collectionId, style.variables);
62
+ }
63
+
59
64
  if (rasterJsonform) {
60
65
  return {
61
66
  layerConfig: {
@@ -67,16 +72,12 @@ export function extractLayerConfig(collectionId, style, rasterJsonform) {
67
72
  };
68
73
  }
69
74
 
70
- if (style?.variables && Object.keys(style.variables ?? {}).length) {
71
- style.variables = getStyleVariablesState(collectionId, style.variables);
72
- }
73
-
74
75
  /** @type {Record<string,unknown> | undefined} */
75
76
  let layerConfig = undefined;
76
77
 
77
78
  if (style?.jsonform) {
78
79
  // this explicitly sets legend only if jsonform is configured
79
- layerConfig = { schema: style.jsonform, type: "style" };
80
+ layerConfig = { schema: style.jsonform, type: layerConfigType || "style" };
80
81
  delete style.jsonform;
81
82
  if (style?.legend) {
82
83
  layerConfig.legend = style.legend;
@@ -90,6 +91,7 @@ export function extractLayerConfig(collectionId, style, rasterJsonform) {
90
91
 
91
92
  return { layerConfig, style };
92
93
  }
94
+
93
95
  /**
94
96
  *
95
97
  * @param {number[]} bbox
@@ -164,35 +166,38 @@ export const extractRoles = (properties, linkOrAsset) => {
164
166
 
165
167
  /**
166
168
  * Extracts a single non-link style JSON from a STAC Item optionally for a selected key mapping
167
- * @param {import("stac-ts").StacItem} item
168
- * @param {string} itemUrl
169
- * @param {string | undefined} key
169
+ * @param { import("stac-ts").StacItem | import("stac-ts").StacCollection } stacObject
170
+ * @param {string | undefined} linkKey
171
+ * @param {string | undefined} assetKey
170
172
  * @returns
171
173
  **/
172
- export const fetchStyle = async (item, itemUrl, key = undefined) => {
174
+ export const fetchStyle = async (
175
+ stacObject,
176
+ linkKey = undefined,
177
+ assetKey = undefined,
178
+ ) => {
173
179
  let styleLink = null;
174
- if (key) {
175
- styleLink = item.links.find(
180
+ if (linkKey) {
181
+ styleLink = stacObject.links.find(
176
182
  (link) =>
177
183
  link.rel.includes("style") &&
178
184
  link["links:keys"] &&
179
- /** @type {Array<string>} */ (link["links:keys"]).includes(key),
185
+ /** @type {Array<string>} */ (link["links:keys"]).includes(linkKey),
180
186
  );
181
- } else {
182
- styleLink = item.links.find(
183
- (link) => link.rel.includes("style") && !link["links:keys"],
187
+ } else if (assetKey) {
188
+ styleLink = stacObject.links.find(
189
+ (link) =>
190
+ link.rel.includes("style") &&
191
+ link["asset:keys"] &&
192
+ /** @type {Array<string>} */ (link["asset:keys"]).includes(assetKey),
184
193
  );
194
+ } else {
195
+ log.debug("Neither link key, nor asset key input, can not match any style to layer.", stacObject.id);
196
+ return {};
185
197
  }
186
198
  if (styleLink) {
187
- let url = "";
188
- if (styleLink.href.startsWith("http")) {
189
- url = styleLink.href;
190
- } else {
191
- url = toAbsolute(styleLink.href, itemUrl);
192
- }
193
-
194
199
  /** @type {import("@/types").EodashStyleJson} */
195
- const styleJson = await axios.get(url).then((resp) => resp.data);
200
+ const styleJson = await axios.get(styleLink.href).then((resp) => resp.data);
196
201
 
197
202
  log.debug("fetched styles JSON", JSON.parse(JSON.stringify(styleJson)));
198
203
  return { ...styleJson };
@@ -201,18 +206,15 @@ export const fetchStyle = async (item, itemUrl, key = undefined) => {
201
206
 
202
207
  /**
203
208
  * Fetches all style JSONs from a STAC Item and returns an array with style objects
204
- * @param {import("stac-ts").StacItem} item
205
- * @param {string} itemUrl
209
+ * @param {import("stac-ts").StacItem | import("stac-ts").StacCollection} stacObject
206
210
  * @returns { Promise <Array<import("@/types").EodashStyleJson>>}
207
211
  **/
208
- export const fetchAllStyles = async (item, itemUrl) => {
209
- const styleLinks = item.links.filter((link) => link.rel.includes("style"));
212
+ export const fetchAllStyles = async (stacObject) => {
213
+ const styleLinks = stacObject.links.filter((link) =>
214
+ link.rel.includes("style"),
215
+ );
210
216
  const fetchPromises = styleLinks.map(async (link) => {
211
- let url = link.href.startsWith("http")
212
- ? link.href
213
- : toAbsolute(link.href, itemUrl);
214
-
215
- const styleJson = await axios.get(url).then((resp) => resp.data);
217
+ const styleJson = await axios.get(link.href).then((resp) => resp.data);
216
218
  log.debug("fetched styles JSON", JSON.parse(JSON.stringify(styleJson)));
217
219
  return styleJson;
218
220
  });
@@ -468,15 +470,11 @@ export const replaceLayer = (currentLayers, oldLayer, newLayers) => {
468
470
  * @param {import('ol/layer').Layer} layer
469
471
  */
470
472
  export const getColFromLayer = async (indicators, layer) => {
471
- const [collectionId, itemId, ..._other] = layer.get("id").split(";:;");
473
+ const [collectionId, ..._other] = layer.get("id").split(";:;");
472
474
 
473
475
  for (const ind of indicators) {
474
476
  if (ind.collectionStac?.id !== collectionId) continue;
475
- const items = await ind.getItems();
476
- const itemIds = items?.map((item) => item.id || item.datetime) ?? [];
477
- if (itemIds.includes(itemId)) {
478
- return ind;
479
- }
477
+ return ind;
480
478
  }
481
479
  };
482
480
 
@@ -850,3 +848,18 @@ export function extractLayerLegend(collection) {
850
848
  }
851
849
  return extraProperties;
852
850
  }
851
+
852
+
853
+ /**
854
+ * @param { import ("stac-ts").StacLink } link
855
+ * @returns {object}
856
+ */
857
+ export function extractEoxLegendLink(link) {
858
+ let extraProperties = {};
859
+ if (link["eox:colorlegend"]) {
860
+ extraProperties = {
861
+ layerLegend: link["eox:colorlegend"],
862
+ };
863
+ }
864
+ return extraProperties;
865
+ }
@@ -95,6 +95,7 @@ function moveItemProperties(item) {
95
95
  "id",
96
96
  "collection",
97
97
  "properties",
98
+ "auth:schemes"
98
99
  ];
99
100
  for (const key in item) {
100
101
  if (!stacProperties.includes(key)) {
@@ -67,25 +67,25 @@ export function getStyleVariablesState(collectionId, variables) {
67
67
  "",
68
68
  "",
69
69
  ];
70
- return (
71
- collection === collectionId &&
72
- ["Vector", "WebGLTile", "VectorTile"].includes(layer?.type ?? "")
73
- );
70
+ return collection === collectionId;
74
71
  });
75
72
 
76
73
  if (!matchingLayer) {
77
74
  return variables;
78
75
  }
76
+ // TODO instead tap into store for changed variables state per layer
77
+ // because XYZ and WMTS use tileurlfunction update, where we can not retrieve
78
+ // current values from OL layers anyhow
79
79
 
80
80
  const olLayer = mapElement.getLayerById(matchingLayer.properties?.id ?? "");
81
- const oldVariablesState =
81
+ let oldVariablesState =
82
82
  /** @type {import("ol/layer").Vector} */ (
83
83
  olLayer
84
84
  //@ts-expect-error variables doesn't exist in non-flat style
85
85
  ).getStyle?.()?.variables ??
86
86
  //@ts-expect-error (styleVariables_ is a private property)
87
87
  /** @type {import("ol/layer").WebGLTile} */ (olLayer).styleVariables_;
88
-
88
+
89
89
  if (!oldVariablesState) {
90
90
  return variables;
91
91
  }
@@ -99,3 +99,4 @@ export function getStyleVariablesState(collectionId, variables) {
99
99
  );
100
100
  return matchingKeys ? oldVariablesState : variables;
101
101
  }
102
+
@@ -481,9 +481,11 @@ export type LayersEventBusKeys =
481
481
  | "layers:updated"
482
482
  | "time:updated"
483
483
  | "process:updated"
484
+ | "layertime:updated"
484
485
  | "compareLayers:updated"
485
486
  | "compareTime:updated"
486
- | "compareProcess:updated";
487
+ | "compareProcess:updated"
488
+ | "compareLayertime:updated";
487
489
 
488
490
  //// STAC API types
489
491
  /** @ignore */
@@ -1,7 +1,7 @@
1
1
  import { createBlock, openBlock, withCtx, createElementVNode, unref, createElementBlock, createCommentVNode, normalizeStyle, Suspense, resolveDynamicComponent, mergeProps, Fragment, renderList, Transition } from 'vue';
2
2
  import '@eox/layout';
3
- import { _ as _export_sfc, u as useDefineTemplate } from './asWebComponent-DdguWGDI.js';
4
- import { V as VMain } from './VMain-vk4-rkw-.js';
3
+ import { _ as _export_sfc, u as useDefineTemplate } from './asWebComponent-Bw03Jutr.js';
4
+ import { V as VMain } from './VMain-C74l1bv-.js';
5
5
 
6
6
  const _style_0 = ".panel[data-v-9c8477cc]{position:relative;overflow:auto;z-index:1;pointer-events:none}.pointer[data-v-9c8477cc]{pointer-events:all}.bg-panel[data-v-9c8477cc]{z-index:0;border-radius:0!important}.fade-enter-active[data-v-9c8477cc],.fade-leave-active[data-v-9c8477cc]{transition:opacity .25s ease}.fade-enter-from[data-v-9c8477cc],.fade-leave-to[data-v-9c8477cc]{opacity:0}.bg-surface[data-v-9c8477cc],.bg-primary[data-v-9c8477cc]{backdrop-filter:blur(10px)!important;border-radius:8px;border:none;box-shadow:0 0 1px #18274b38,0 6px 12px -6px #18274b1f,0 8px 24px -4px #18274b14;max-height:100%;overflow:auto;scrollbar-color:rgba(var(--v-theme-on-surface),.2) transparent;scrollbar-width:thin}.bg-surface[data-v-9c8477cc]{background-color:rgba(var(--v-theme-surface),var(--v-surface-opacity, .8))!important}.bg-primary[data-v-9c8477cc]{background-color:rgba(var(--v-theme-primary),var(--v-primary-opacity, .8))!important}";
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { withAsyncContext, ref, onMounted, onUnmounted, createElementBlock, openBlock, createBlock, resolveDynamicComponent, mergeProps } from 'vue';
2
- import { E as useSTAcStore } from './asWebComponent-DdguWGDI.js';
2
+ import { E as useSTAcStore } from './asWebComponent-Bw03Jutr.js';
3
3
 
4
4
  const _hoisted_1 = { class: "d-flex flex-column fill-height overflow-auto" };
5
5
 
@@ -1,11 +1,11 @@
1
1
  import { useCssVars, ref, useTemplateRef, customRef, computed, reactive, watch, onMounted, createElementBlock, openBlock, createVNode, unref, createSlots, withCtx, createElementVNode, withDirectives, createCommentVNode, createBlock, mergeProps, toHandlers } from 'vue';
2
2
  import { DatePicker } from 'v-calendar';
3
- import { _ as _export_sfc, D as useDisplay, E as useSTAcStore, F as useTransparentPanel, G as VBtn, H as VIcon, I as eodashCollections, J as eodashCompareCollections } from './asWebComponent-DdguWGDI.js';
4
- import { B as datetime } from './helpers-CtUlAW0N.js';
3
+ import { _ as _export_sfc, D as useDisplay, E as useSTAcStore, F as useTransparentPanel, G as VBtn, H as VIcon, I as eodashCollections, J as eodashCompareCollections } from './asWebComponent-Bw03Jutr.js';
4
+ import { C as datetime } from './helpers-CsjKHAcK.js';
5
5
  import { mdiRayEndArrow, mdiRayStartArrow } from '@mdi/js';
6
6
  import log from 'loglevel';
7
7
  import { storeToRefs } from 'pinia';
8
- import { T as Tooltip } from './index-DBo0F4Fv.js';
8
+ import { T as Tooltip } from './index-DEmHaCL3.js';
9
9
 
10
10
  const _style_0 = ".vc-popover-content{--vc-nav-hover-bg: rgba(var(--v-theme-on-surface), .1);--vc-nav-item-active-color: rgb(var(--v-theme-on-secondary));--vc-nav-item-active-bg: rgba(var(--v-theme-secondary), .8);--vc-focus-ring: 0 0 0 2px rgba(var(--v-theme-secondary), .5)}.vc-container{--vc-day-content-hover-bg: rgba(var(--v-theme-on-surface), .2);--vc-focus-ring: 0 0 0 2px rgba(var(--v-theme-secondary), .4);--vc-header-arrow-hover-bg: rgba(var(--v-theme-secondary), .1)}.vc-attr{--vc-accent-600: rgba(var(--v-theme-secondary), .8)}.datePicker{--vc-day-content-hover-bg: red}@media (min-width: 960px){.datePicker{position:absolute;bottom:0;left:0;right:0;margin-inline:auto;width:fit-content}}.vc-day-content{color:#5e5e5e;font-weight:400}.vc-highlight-content-solid{color:#fff!important}.vc-popover-content-wrapper{transform:var(--v5270a4d4)!important}.vc-date-picker-content,.datePicker{backdrop-filter:blur(10px)!important;border-radius:8px;border:none;box-shadow:0 0 1px #18274b38,0 6px 12px -6px #18274b1f,0 8px 24px -4px #18274b14;background-color:rgba(var(--v-theme-surface),var(--v-surface-opacity, .8))!important}.vc-popover-caret.direction-top.align-left{clip-path:polygon(0% 0%,100% 0%,0% 100%,0% 100%)}.vc-bordered{border:none}";
11
11
 
@@ -1,5 +1,5 @@
1
1
  import { withAsyncContext, computed, ref, createElementBlock, openBlock, mergeProps, unref, createElementVNode, toDisplayString } from 'vue';
2
- import { _ as _export_sfc, E as useSTAcStore, Q as isFirstLoad } from './asWebComponent-DdguWGDI.js';
2
+ import { _ as _export_sfc, E as useSTAcStore, Q as isFirstLoad } from './asWebComponent-Bw03Jutr.js';
3
3
 
4
4
  const _style_0 = "eox-itemfilter[data-v-88d0abc7]{--form-flex-direction: row}@media (max-width: 768px){eox-itemfilter[data-v-88d0abc7]{--form-flex-direction: column}}";
5
5
 
@@ -1,8 +1,8 @@
1
1
  import { withAsyncContext, computed, ref, createElementBlock, openBlock, createCommentVNode, mergeProps, unref, renderSlot, createElementVNode, toDisplayString } from 'vue';
2
2
  import 'color-legend-element';
3
3
  import '@eox/timecontrol';
4
- import { N as mapCompareEl, h as mapEl, O as getColFromLayer } from './helpers-CtUlAW0N.js';
5
- import { _ as _export_sfc, E as useSTAcStore, M as layerControlFormValueCompare, N as layerControlFormValue, J as eodashCompareCollections, I as eodashCollections } from './asWebComponent-DdguWGDI.js';
4
+ import { O as mapCompareEl, j as mapEl, P as getColFromLayer } from './helpers-CsjKHAcK.js';
5
+ import { _ as _export_sfc, E as useSTAcStore, M as layerControlFormValueCompare, N as layerControlFormValue, J as eodashCompareCollections, I as eodashCollections } from './asWebComponent-Bw03Jutr.js';
6
6
  import { storeToRefs } from 'pinia';
7
7
 
8
8
  /**
@@ -1,8 +1,8 @@
1
1
  import { ref, createElementBlock, openBlock, createBlock, unref, withCtx, createVNode, mergeProps } from 'vue';
2
- import { D as activeTemplate } from './helpers-CtUlAW0N.js';
2
+ import { E as activeTemplate } from './helpers-CsjKHAcK.js';
3
3
  import { mdiViewDashboard } from '@mdi/js';
4
- import { D as useDisplay, F as useTransparentPanel, H as VIcon } from './asWebComponent-DdguWGDI.js';
5
- import { V as VTooltip } from './VTooltip-BYUZeia1.js';
4
+ import { D as useDisplay, F as useTransparentPanel, H as VIcon } from './asWebComponent-Bw03Jutr.js';
5
+ import { V as VTooltip } from './VTooltip-BLS-cQ9N.js';
6
6
 
7
7
  const _sfc_main = {
8
8
  __name: 'EodashLayoutSwitcher',