@eodash/eodash 5.6.0 → 5.7.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 (91) hide show
  1. package/core/client/components/DashboardLayout.vue +1 -1
  2. package/core/client/composables/index.js +6 -2
  3. package/core/client/eodashSTAC/EodashCollection.js +5 -21
  4. package/core/client/eodashSTAC/createLayers.js +23 -9
  5. package/core/client/eodashSTAC/helpers.js +37 -4
  6. package/core/client/types.ts +8 -1
  7. package/core/client/utils/index.js +4 -0
  8. package/dist/client/{DashboardLayout-DkKDhfgH.js → DashboardLayout-kRsmsNW5.js} +5 -5
  9. package/dist/client/{DynamicWebComponent-BrpkA-e3.js → DynamicWebComponent-CnKhYo0K.js} +1 -1
  10. package/dist/client/{EodashChart-p7_1FRlF.js → EodashChart-CLDqE93C.js} +4 -4
  11. package/dist/client/{EodashDatePicker-HK0Jl7wQ.js → EodashDatePicker-CMPDT-ce.js} +3 -3
  12. package/dist/client/{EodashItemFilter-BYQDA78B.js → EodashItemFilter-BpdA8QQa.js} +1 -1
  13. package/dist/client/{EodashLayerControl-NcrNncGn.js → EodashLayerControl-BHpDA4_0.js} +25 -7
  14. package/dist/client/{EodashLayoutSwitcher-CC2Znd0I.js → EodashLayoutSwitcher-B1fRUt7G.js} +3 -3
  15. package/dist/client/EodashMapBtns-Cpned0tc.js +478 -0
  16. package/dist/client/{EodashStacInfo-BA-0UjvT.js → EodashStacInfo-BQspAHKH.js} +31 -31
  17. package/dist/client/{EodashTools-CWmoH0g_.js → EodashTools-1zHz26gv.js} +4 -4
  18. package/dist/client/{ExportState-CfAfX4RN.js → ExportState-DbOm8hBI.js} +4 -4
  19. package/dist/client/{Footer-DLGxQTZt.js → Footer-BKg-VVkj.js} +1 -1
  20. package/dist/client/{Header-eyEyyzD6.js → Header-DCrwCvmY.js} +2 -2
  21. package/dist/client/MobileLayout-vWSHpluo.js +118 -0
  22. package/dist/client/{PopUp-WNs6Io2N.js → PopUp-9uimfK49.js} +2 -2
  23. package/dist/client/{ProcessList-RzVqbd5E.js → ProcessList-CTTIZa06.js} +4 -4
  24. package/dist/client/{VImg-GKUTFoV-.js → VImg-CrmB76ZY.js} +2 -2
  25. package/dist/client/{VMain-D7_72mHr.js → VMain-OKZNpcEG.js} +1 -1
  26. package/dist/client/{VTooltip-BbmvtvYw.js → VTooltip-CJw2FyWk.js} +2 -2
  27. package/dist/client/{WidgetsContainer-Dw5d7SOW.js → WidgetsContainer-BaWOnE5R.js} +1 -1
  28. package/dist/client/{asWebComponent-DDt7V3Bl.js → asWebComponent-BHWpMuE3.js} +47 -35
  29. package/dist/client/{async-CT3KEV52.js → async-DSKj6g1f.js} +29 -28
  30. package/dist/client/create-layers-config-CBoYedqB.js +182 -0
  31. package/dist/client/eo-dash.js +1 -1
  32. package/dist/client/{forwardRefs-CVzxyoSq.js → forwardRefs-DH51zPUr.js} +2 -2
  33. package/dist/client/{handling-C285F_Mq.js → handling-BrcDDlgS.js} +452 -114
  34. package/dist/client/{helpers-CZFH0EVN.js → helpers-DjZVl_WF.js} +2277 -1504
  35. package/dist/client/{index-B-m7V3Kb.js → index-1JKE68n3.js} +49 -194
  36. package/dist/client/{index-CF3ZMzTz.js → index-5Jhsa8Xe.js} +3 -3
  37. package/dist/client/index-CSG_JoOA.js +436 -0
  38. package/dist/client/{index-DgOXD7wd.js → index-CUjl-ZsI.js} +2 -2
  39. package/dist/client/{index-B_6H-N14.js → index-Cu3-13Xg.js} +84 -90
  40. package/dist/client/material-symbols-outlined.woff2 +0 -0
  41. package/dist/client/material-symbols-rounded.woff2 +0 -0
  42. package/dist/client/material-symbols-sharp.woff2 +0 -0
  43. package/dist/client/material-symbols-subset.woff2 +0 -0
  44. package/dist/client/templates.js +1 -1
  45. package/dist/client/{transition-C2gnrWg0.js → transition-OHcz5Qq1.js} +1 -1
  46. package/dist/node/cli.js +1 -1
  47. package/dist/types/core/client/composables/index.d.ts +1 -3
  48. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +6 -7
  49. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +3 -3
  50. package/dist/types/core/client/eodashSTAC/helpers.d.ts +1 -0
  51. package/dist/types/core/client/types.d.ts +8 -1
  52. package/dist/types/templates/baseConfig.d.ts +12 -0
  53. package/dist/types/widgets/EodashLayerControl.vue.d.ts +1 -1
  54. package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +9 -0
  55. package/dist/types/widgets/EodashMap/index.vue.d.ts +7 -0
  56. package/dist/types/widgets/EodashMap/methods/create-layers-config.d.ts +1 -8
  57. package/dist/types/widgets/EodashProcess/methods/composables.d.ts +2 -3
  58. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +15 -10
  59. package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +3 -1
  60. package/dist/types/widgets/EodashProcess/methods/template-helpers.d.ts +99 -0
  61. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +1 -6
  62. package/dist/types/widgets/EodashProcess/types.d.ts +1 -0
  63. package/dist/types/widgets/EodashStacInfo.vue.d.ts +10 -10
  64. package/dist/types/widgets/EodashTimeSlider/index.vue.d.ts +34 -0
  65. package/dist/types/widgets/EodashTimeSlider/methods/index.d.ts +39 -0
  66. package/dist/types/widgets/EodashTimeSlider/types.d.ts +62 -0
  67. package/package.json +32 -32
  68. package/widgets/EodashLayerControl.vue +22 -3
  69. package/widgets/EodashMap/EodashMapBtns.vue +46 -1
  70. package/widgets/EodashMap/index.vue +17 -5
  71. package/widgets/EodashMap/methods/create-layers-config.js +2 -0
  72. package/widgets/EodashMap/methods/index.js +23 -5
  73. package/widgets/EodashProcess/index.vue +17 -13
  74. package/widgets/EodashProcess/methods/async.js +19 -8
  75. package/widgets/EodashProcess/methods/composables.js +63 -74
  76. package/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.js +9 -5
  77. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +7 -4
  78. package/widgets/EodashProcess/methods/handling.js +125 -76
  79. package/widgets/EodashProcess/methods/outputs.js +74 -29
  80. package/widgets/EodashProcess/methods/template-helpers.js +246 -0
  81. package/widgets/EodashProcess/methods/utils.js +7 -17
  82. package/widgets/EodashProcess/types.ts +1 -0
  83. package/widgets/EodashStacInfo.vue +30 -30
  84. package/widgets/EodashTimeSlider/index.vue +152 -0
  85. package/widgets/EodashTimeSlider/methods/index.js +279 -0
  86. package/widgets/EodashTimeSlider/types.ts +64 -0
  87. package/dist/client/EodashMapBtns-BJSh7qT-.js +0 -435
  88. package/dist/client/EodashTimeSlider-GDv1hbw7.js +0 -53
  89. package/dist/client/MobileLayout-RzLOyXwL.js +0 -118
  90. package/dist/types/widgets/EodashTimeSlider.vue.d.ts +0 -15
  91. package/widgets/EodashTimeSlider.vue +0 -40
@@ -1,5 +1,5 @@
1
- import { t as replaceLayer, b as extractLayerConfig, x as extractLayerLegend, m as mergeGeojsons, d as axios, w as getCompareLayers, v as getLayers, $ as axios$1, I as compareIndicator, F as indicator } from './helpers-CZFH0EVN.js';
2
- import { S as useEmitLayersUpdate } from './asWebComponent-DDt7V3Bl.js';
1
+ import { t as replaceLayer, b as extractLayerConfig, w as extractLayerLegend, m as mergeGeojsons, d as axios, Y as getCompareLayers, v as getLayers, $ as axios$1, H as compareIndicator, E as indicator } from './helpers-DjZVl_WF.js';
2
+ import { R as useEmitLayersUpdate } from './asWebComponent-BHWpMuE3.js';
3
3
  import { isMulti } from '@eox/jsonform/src/custom-inputs/spatial/utils';
4
4
  import log from 'loglevel';
5
5
 
@@ -494,13 +494,17 @@ function extractAsyncResults(resultItem) {
494
494
  return extracted;
495
495
  }
496
496
 
497
- /** @param {*} jsonformSchema */
498
- const getDrawToolsProperty = (jsonformSchema) => {
497
+ /** @param {*} jsonformSchema
498
+ * @returns { string[] }
499
+ */
500
+ const getDrawToolsProperties = (jsonformSchema) => {
501
+ const properties = [];
499
502
  for (const property in jsonformSchema.properties) {
500
503
  if (jsonformSchema.properties[property]?.options?.drawtools) {
501
- return property;
504
+ properties.push(property);
502
505
  }
503
506
  }
507
+ return properties;
504
508
  };
505
509
 
506
510
  /**
@@ -547,20 +551,6 @@ const applyProcessLayersToMap = (mapElement, processLayers) => {
547
551
  mapElement.layers = layers;
548
552
  }
549
553
  };
550
- /**
551
- * Updates the jsonform schema to target the compare map
552
- * @param {Record<string,any> | null | undefined} jsonformSchema
553
- */
554
- function updateJsonformSchemaTarget(jsonformSchema) {
555
- if (!jsonformSchema) {
556
- return jsonformSchema;
557
- }
558
- const stringified = JSON.stringify(jsonformSchema).replaceAll(
559
- "eox-map#main",
560
- "eox-map#compare",
561
- );
562
- return JSON.parse(stringified);
563
- }
564
554
 
565
555
  /**
566
556
  * Polls the process status and fetches a result item when the process is successful.
@@ -659,16 +649,27 @@ async function updateJobsStatus(jobs, indicator) {
659
649
  jobsUrls.map((url) =>
660
650
  axios$1
661
651
  .get(url, { params: { t: Date.now() } })
662
- .then((response) => response.data),
652
+ .then((response) => response.data)
653
+ .catch((error) => {
654
+ if (axios$1.isAxiosError(error)) {
655
+ console.warn(
656
+ `Job URL not accessible: ${url}. Maybe was deleted from the processing endpoint or endpoint is unavailable. Skipping...`,
657
+ );
658
+ return null;
659
+ }
660
+ throw error;
661
+ }),
663
662
  ),
664
663
  );
665
- jobResults.sort((a, b) => {
666
- return (
667
- new Date(b.job_start_datetime).getTime() -
668
- new Date(a.job_start_datetime).getTime()
669
- );
670
- });
671
- jobs.value.splice(0, jobs.value.length, ...jobResults);
664
+ const validResults = jobResults
665
+ .filter((job) => job !== null)
666
+ .sort((a, b) => {
667
+ return (
668
+ new Date(b.job_start_datetime).getTime() -
669
+ new Date(a.job_start_datetime).getTime()
670
+ );
671
+ });
672
+ jobs.value.splice(0, jobs.value.length, ...validResults);
672
673
  }
673
674
 
674
675
  /**
@@ -800,4 +801,4 @@ const getJobStatusUrl = (jobID, indicator) => {
800
801
  return jobUrl;
801
802
  };
802
803
 
803
- export { creatAsyncProcessLayerDefinitions as a, getBboxProperty as b, createTiffLayerDefinition as c, download as d, extractAsyncResults as e, generateTimePairs as f, getDrawToolsProperty as g, updateJsonformSchemaTarget as h, extractGeometries as i, applyProcessLayersToMap as j, getJobStatusUrl as k, loadProcess as l, downloadPreviousResults as m, deleteJob as n, pollProcessStatus as p, separateEndpointLinks as s, updateJobsStatus as u };
804
+ export { creatAsyncProcessLayerDefinitions as a, getBboxProperty as b, createTiffLayerDefinition as c, download as d, extractAsyncResults as e, generateTimePairs as f, getDrawToolsProperties as g, extractGeometries as h, applyProcessLayersToMap as i, getJobStatusUrl as j, downloadPreviousResults as k, loadProcess as l, deleteJob as m, pollProcessStatus as p, separateEndpointLinks as s, updateJobsStatus as u };
@@ -0,0 +1,182 @@
1
+ import { a1 as EodashCollection } from './asWebComponent-BHWpMuE3.js';
2
+ import log from 'loglevel';
3
+
4
+ /**
5
+ * Creates full layer configuration from indicator and time information
6
+ * @param {import("stac-ts").StacCatalog
7
+ * | import("stac-ts").StacCollection
8
+ * | import("stac-ts").StacItem
9
+ * | null
10
+ * } selectedIndicator
11
+ * @param {EodashCollection[]} eodashCols
12
+ * @param {string | import("stac-ts").StacItem | null} [timeOrItem] - time as a string, or a stac item
13
+ * @returns {Promise<Record<string, any>[]>}
14
+ */
15
+
16
+ const createLayersConfig = async (
17
+ selectedIndicator,
18
+ eodashCols,
19
+ timeOrItem,
20
+ ) => {
21
+ log.debug(
22
+ "Creating layers config",
23
+ selectedIndicator,
24
+ eodashCols,
25
+ timeOrItem,
26
+ );
27
+ const layersCollection = [];
28
+ const dataLayers = {
29
+ type: "Group",
30
+ properties: {
31
+ id: "AnalysisGroup",
32
+ title: "Data Layers",
33
+ layerControlExpand: true,
34
+ },
35
+ layers: /** @type {Record<string,any>[]}*/ ([]),
36
+ };
37
+
38
+ for (const ec of eodashCols) {
39
+ /** @type {Record<string,any>[]} */
40
+ let layers;
41
+ if (timeOrItem) {
42
+ const dateOrItem =
43
+ typeof timeOrItem === "string" ? new Date(timeOrItem) : timeOrItem;
44
+ layers = await ec.createLayersJson(dateOrItem);
45
+ } else {
46
+ layers = await ec.createLayersJson(undefined);
47
+ }
48
+ // Add expand to all analysis layers
49
+ layers.forEach((dl) => {
50
+ dl.properties.layerControlExpand = true;
51
+ dl.properties.layerControlToolsExpand = true;
52
+ });
53
+ dataLayers.layers.push(...layers);
54
+ }
55
+
56
+ /* check for roles in indicator links to assign visibility property for the data layers */
57
+ if (selectedIndicator?.links) {
58
+ const visibilityLinks = selectedIndicator.links.filter(
59
+ (link) =>
60
+ Array.isArray(link.roles) &&
61
+ (link.roles.includes("disable") || link.roles.includes("hidden")),
62
+ );
63
+ if (visibilityLinks.length > 0) {
64
+ visibilityLinks.forEach((vl) => {
65
+ const targetLayerId = vl.id;
66
+ const targetLayer = dataLayers.layers.find(
67
+ (dl) => dl.properties.id.split(";:;")[0] === targetLayerId,
68
+ );
69
+ if (targetLayer) {
70
+ if (Array.isArray(vl.roles) && vl.roles.includes("disable")) {
71
+ targetLayer.properties.visible = false;
72
+ targetLayer.properties.layerControlExpand = false;
73
+ } else if (Array.isArray(vl.roles) && vl.roles.includes("hidden")) {
74
+ targetLayer.properties.layerControlHide = true;
75
+ }
76
+ }
77
+ });
78
+ }
79
+ }
80
+ layersCollection.push(dataLayers);
81
+ const indicatorLayers =
82
+ //@ts-expect-error indicator is collection
83
+ await EodashCollection.getIndicatorLayers(selectedIndicator);
84
+ const observationPointsLayer =
85
+ EodashCollection.getObservationPointsLayer(eodashCols);
86
+ if (observationPointsLayer) {
87
+ dataLayers.layers.push(observationPointsLayer);
88
+ }
89
+ const baseLayers = {
90
+ type: "Group",
91
+ properties: {
92
+ id: "BaseLayersGroup",
93
+ title: "Base Layers",
94
+ },
95
+ layers: /** @type {Record<string,any>[]}*/ ([]),
96
+ };
97
+
98
+ const indicatorBaseLayers = indicatorLayers.filter(
99
+ (l) => l.properties.group === "baselayer",
100
+ );
101
+
102
+ if (indicatorBaseLayers.length) {
103
+ // Only one baselayer can be set to visible, let's first set all to
104
+ // false that have not a dedicated property visible, then check
105
+ // if there are more then one visible and only allow one
106
+ let counter = 0;
107
+ let lastPos = 0;
108
+ for (let indx = 0; indx < indicatorBaseLayers.length; indx++) {
109
+ const bl = indicatorBaseLayers[indx];
110
+ if (!("visible" in bl.properties)) {
111
+ bl.properties.visible = false;
112
+ }
113
+
114
+ if (bl.properties.visible) {
115
+ counter++;
116
+ lastPos = indx;
117
+ }
118
+ }
119
+
120
+ // if none visible set the last one as visible
121
+ if (counter === 0) {
122
+ indicatorBaseLayers[0].properties.visible = true;
123
+ }
124
+
125
+ // disable all apart from last
126
+ if (counter > 0) {
127
+ indicatorBaseLayers.forEach((bl, indx) => {
128
+ if (indx !== lastPos) {
129
+ bl.properties.visible = false;
130
+ } else {
131
+ bl.properties.visible = true;
132
+ }
133
+ });
134
+ }
135
+
136
+ baseLayers.layers.push(...indicatorBaseLayers);
137
+
138
+ // Add exclusive to baselayers and make sure only one is selected
139
+ baseLayers.layers.forEach((bl) => {
140
+ bl.properties.layerControlExclusive = true;
141
+ });
142
+ } else {
143
+ // Default to some baselayer
144
+ baseLayers.layers.push({
145
+ type: "Tile",
146
+ properties: {
147
+ id: "osm",
148
+ title: "Background",
149
+ layerControlExclusive: true,
150
+ },
151
+ source: {
152
+ type: "OSM",
153
+ },
154
+ });
155
+ }
156
+
157
+ if (baseLayers.layers.length) {
158
+ layersCollection.unshift(baseLayers);
159
+ }
160
+
161
+ const overlayLayers = {
162
+ type: "Group",
163
+ properties: {
164
+ id: "OverlayGroup",
165
+ title: "Overlay Layers",
166
+ },
167
+ layers: /** @type {Record<string,any>[]}*/ ([]),
168
+ };
169
+
170
+ const indicatorOverlays = indicatorLayers.filter(
171
+ (l) => l.properties.group === "overlay",
172
+ );
173
+
174
+ if (indicatorOverlays.length) {
175
+ overlayLayers.layers.push(...indicatorOverlays);
176
+ layersCollection.push(overlayLayers);
177
+ }
178
+
179
+ return layersCollection;
180
+ };
181
+
182
+ export { createLayersConfig as c };
@@ -1,2 +1,2 @@
1
- export { aI as EodashConstructor, aJ as register, aK as store } from './asWebComponent-DDt7V3Bl.js';
1
+ export { aI as EodashConstructor, aJ as register, aK as store } from './asWebComponent-BHWpMuE3.js';
2
2
  import 'vue';
@@ -1,6 +1,6 @@
1
1
  import { computed, watch, onScopeDispose, nextTick, ref, watchEffect, effectScope, inject, mergeProps, toRef, toValue, shallowRef, onMounted, reactive, provide, toRaw, readonly, warn, onBeforeUnmount, createElementVNode, Fragment, createVNode, Teleport, withDirectives, vShow, Transition } from 'vue';
2
- import { aq as isOn, ar as eventName, p as propsFactory, as as destructComputed, at as parseAnchor, au as flipSide, av as flipAlign, aw as flipCorner, ax as CircularBuffer, ay as deepEqual, a0 as consoleError, az as getAxis, q as convertToUnit, x as clamp, aA as IN_BROWSER, A as useToggleScope, aB as defer, al as getCurrentInstance, aC as templateRef, aD as matchesSelector, aE as focusableChildren, G as useDisplay, r as makeThemeProps, d as makeDimensionProps, e as makeComponentProps, g as genericComponent, z as useProxiedModel, l as provideTheme, n as useRtl, f as useBackgroundColor, b as useDimension, aF as useRouter, aG as useBackButton, ao as standardEasing, c as useRender, C as omit } from './asWebComponent-DDt7V3Bl.js';
3
- import { m as makeTransitionProps, M as MaybeTransition } from './transition-C2gnrWg0.js';
2
+ import { aq as isOn, ar as eventName, p as propsFactory, as as destructComputed, at as parseAnchor, au as flipSide, av as flipAlign, aw as flipCorner, ax as CircularBuffer, ay as deepEqual, $ as consoleError, az as getAxis, q as convertToUnit, x as clamp, aA as IN_BROWSER, A as useToggleScope, aB as defer, al as getCurrentInstance, aC as templateRef, aD as matchesSelector, aE as focusableChildren, G as useDisplay, r as makeThemeProps, d as makeDimensionProps, e as makeComponentProps, g as genericComponent, z as useProxiedModel, l as provideTheme, n as useRtl, f as useBackgroundColor, b as useDimension, aF as useRouter, aG as useBackButton, ao as standardEasing, c as useRender, C as omit } from './asWebComponent-BHWpMuE3.js';
3
+ import { m as makeTransitionProps, M as MaybeTransition } from './transition-OHcz5Qq1.js';
4
4
 
5
5
  class Box {
6
6
  constructor(args) {