@eodash/eodash 5.0.0-rc.3 → 5.1.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 (155) hide show
  1. package/README.md +1 -0
  2. package/core/client/App.vue +8 -2
  3. package/core/client/asWebComponent.js +5 -5
  4. package/core/client/components/DashboardLayout.vue +42 -25
  5. package/core/client/components/EodashOverlay.vue +1 -1
  6. package/core/client/components/ErrorAlert.vue +2 -2
  7. package/core/client/components/Footer.vue +4 -4
  8. package/core/client/components/Header.vue +3 -3
  9. package/core/client/components/MobileLayout.vue +9 -10
  10. package/core/client/composables/DefineEodash.js +38 -43
  11. package/core/client/composables/DefineTemplate.js +4 -2
  12. package/core/client/composables/DefineWidgets.js +14 -8
  13. package/core/client/composables/index.js +273 -23
  14. package/core/client/eodashSTAC/EodashCollection.js +80 -47
  15. package/core/client/eodashSTAC/helpers.js +136 -27
  16. package/core/client/eodashSTAC/parquet.js +145 -0
  17. package/core/client/eodashSTAC/triggers.js +6 -3
  18. package/core/client/plugins/index.js +4 -3
  19. package/core/client/plugins/vuetify.js +3 -0
  20. package/core/client/store/actions.js +21 -4
  21. package/core/client/store/stac.js +93 -56
  22. package/core/client/store/states.js +15 -5
  23. package/core/client/types.ts +59 -43
  24. package/core/client/utils/index.js +79 -0
  25. package/core/client/utils/keys.js +2 -2
  26. package/core/client/utils/states.js +30 -5
  27. package/core/client/views/Dashboard.vue +36 -32
  28. package/core/client/vite-env.d.ts +7 -0
  29. package/dist/client/{DashboardLayout-t_PavJPO.js → DashboardLayout-ByVs1DrY.js} +23 -12
  30. package/dist/client/{DynamicWebComponent-y07rVJch.js → DynamicWebComponent-C3W7HSQm.js} +1 -1
  31. package/dist/client/{EodashDatePicker-CcOfyzGD.js → EodashDatePicker-BIAf1sMT.js} +59 -32
  32. package/dist/client/{EodashItemFilter-B9HCvIMi.js → EodashItemFilter-DPznh8UB.js} +20 -10
  33. package/dist/client/{EodashLayerControl-KStn7Nb_.js → EodashLayerControl-Bhxjw4V2.js} +29 -16
  34. package/dist/client/EodashLayoutSwitcher-C5qTEffW.js +61 -0
  35. package/dist/client/EodashMapBtns-WoGq8MuV.js +173 -0
  36. package/dist/client/{EodashStacInfo-C_hDy6Pd.js → EodashStacInfo-CSvvF2jI.js} +3 -18
  37. package/dist/client/{EodashTools-BXflvRf8.js → EodashTools-Cv1SXQ5y.js} +13 -13
  38. package/dist/client/{ExportState-C0QRemK1.js → ExportState-D-iuwaad.js} +58 -52
  39. package/dist/client/{Footer-7VGyGUAs.js → Footer-CyF0zRAk.js} +15 -13
  40. package/dist/client/{Header-BQJnXHYq.js → Header-CgD8jDKU.js} +33 -28
  41. package/dist/client/{MobileLayout-b8nQ-Vyl.js → MobileLayout-EKQ_kpSh.js} +69 -60
  42. package/dist/client/{PopUp-DgNrh9Df.js → PopUp-BsYLvWch.js} +19 -10
  43. package/dist/client/ProcessList-C2xsLU2_.js +191 -0
  44. package/dist/client/{VImg-D4eT3IQ1.js → VImg-OHe8YTs2.js} +24 -24
  45. package/dist/client/{VMain-C3hN2-H3.js → VMain-PryTLU4a.js} +7 -7
  46. package/dist/client/{VOverlay-tAeNygaA.js → VOverlay-yUn7p-Uf.js} +64 -27
  47. package/dist/client/{VTooltip-B0Q3iHMZ.js → VTooltip-DZ0fjpB3.js} +13 -10
  48. package/dist/client/{WidgetsContainer-CtDHfCYf.js → WidgetsContainer-B9LBadcC.js} +1 -1
  49. package/dist/client/asWebComponent-By_7_JjS.js +19193 -0
  50. package/dist/client/async-DkSu_u2K.js +740 -0
  51. package/dist/client/eo-dash.js +1 -1
  52. package/dist/client/{forwardRefs-CIFAqXaZ.js → forwardRefs-BXxrv98s.js} +31 -4
  53. package/dist/client/handling-CgmFXkW6.js +1212 -0
  54. package/dist/client/helpers-Dy0Q13tP.js +4534 -0
  55. package/dist/client/{index-DvcUndod.js → index-BuhOHXKv.js} +2 -4
  56. package/dist/client/{index-BQ16n4Sk.js → index-Ch_HchK3.js} +39 -32
  57. package/dist/client/{index-Cv7HBz49.js → index-Dqj4tbx2.js} +2 -2
  58. package/dist/client/index-skjhlH8u.js +376 -0
  59. package/dist/client/{ssrBoot-BP7SYRyC.js → ssrBoot-Zgc_Ttvi.js} +2 -2
  60. package/dist/client/templates.js +850 -0
  61. package/dist/client/transition-C98Yn4Vo.js +40 -0
  62. package/dist/node/cli.js +16 -6
  63. package/dist/node/types.d.ts +1 -1
  64. package/dist/types/core/client/App.vue.d.ts +2 -2
  65. package/dist/types/core/client/asWebComponent.d.ts +1 -1
  66. package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +1 -3
  67. package/dist/types/core/client/components/Footer.vue.d.ts +1 -105
  68. package/dist/types/core/client/components/IframeWrapper.vue.d.ts +1 -1
  69. package/dist/types/core/client/components/MobileLayout.vue.d.ts +1 -324
  70. package/dist/types/core/client/composables/DefineEodash.d.ts +2 -2
  71. package/dist/types/core/client/composables/DefineTemplate.d.ts +1 -1
  72. package/dist/types/core/client/composables/DefineWidgets.d.ts +4 -4
  73. package/dist/types/core/client/composables/index.d.ts +24 -2
  74. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +9 -6
  75. package/dist/types/core/client/eodashSTAC/helpers.d.ts +20 -5
  76. package/dist/types/core/client/eodashSTAC/parquet.d.ts +2 -0
  77. package/dist/types/core/client/plugins/vuetify.d.ts +7 -4
  78. package/dist/types/core/client/store/actions.d.ts +3 -2
  79. package/dist/types/core/client/store/stac.d.ts +16 -13
  80. package/dist/types/core/client/store/states.d.ts +14 -4
  81. package/dist/types/core/client/types.d.ts +45 -30
  82. package/dist/types/core/client/utils/index.d.ts +2 -0
  83. package/dist/types/core/client/utils/keys.d.ts +4 -4
  84. package/dist/types/core/client/utils/states.d.ts +59 -47
  85. package/dist/types/core/client/views/Dashboard.vue.d.ts +2 -2
  86. package/dist/types/templates/baseConfig.d.ts +4 -0
  87. package/dist/types/templates/compare.d.ts +210 -0
  88. package/dist/types/templates/expert.d.ts +151 -0
  89. package/dist/types/templates/index.d.ts +6 -0
  90. package/dist/types/templates/light.d.ts +145 -0
  91. package/dist/types/widgets/EodashDatePicker.vue.d.ts +1 -458
  92. package/dist/types/widgets/EodashItemFilter.vue.d.ts +3 -3
  93. package/dist/types/widgets/EodashLayerControl.vue.d.ts +14 -7
  94. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +1 -3
  95. package/dist/types/widgets/EodashMap/index.vue.d.ts +1 -4
  96. package/dist/types/widgets/EodashMapBtns.vue.d.ts +8 -8
  97. package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +8 -1
  98. package/dist/types/widgets/EodashProcess/index.vue.d.ts +8 -4
  99. package/dist/types/widgets/EodashProcess/methods/async.d.ts +18 -18
  100. package/dist/types/widgets/EodashProcess/methods/composables.d.ts +3 -2
  101. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/index.d.ts +1 -0
  102. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.d.ts +6 -0
  103. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.d.ts +4 -0
  104. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +5 -0
  105. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/index.d.ts +1 -0
  106. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +12 -5
  107. package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +72 -41
  108. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +41 -21
  109. package/dist/types/widgets/EodashProcess/states.d.ts +11 -0
  110. package/dist/types/widgets/EodashProcess/types.d.ts +41 -0
  111. package/dist/types/widgets/EodashStacInfo.vue.d.ts +14 -14
  112. package/dist/types/widgets/EodashTools.vue.d.ts +3 -3
  113. package/dist/types/widgets/ExportState.vue.d.ts +1 -1
  114. package/dist/types/widgets/PopUp.vue.d.ts +11 -16
  115. package/dist/types/widgets/WidgetsContainer.vue.d.ts +3 -6
  116. package/package.json +53 -45
  117. package/templates/baseConfig.js +68 -0
  118. package/templates/compare.js +162 -0
  119. package/templates/expert.js +123 -0
  120. package/templates/index.js +8 -0
  121. package/templates/light.js +130 -0
  122. package/widgets/EodashDatePicker.vue +80 -31
  123. package/widgets/EodashItemFilter.vue +26 -11
  124. package/widgets/EodashLayerControl.vue +20 -11
  125. package/widgets/EodashLayoutSwitcher.vue +6 -3
  126. package/widgets/EodashMap/index.vue +3 -8
  127. package/widgets/EodashMap/methods/create-layers-config.js +4 -3
  128. package/widgets/EodashMap/methods/index.js +33 -23
  129. package/widgets/EodashMapBtns.vue +83 -41
  130. package/widgets/EodashProcess/ProcessList.vue +34 -10
  131. package/widgets/EodashProcess/index.vue +55 -20
  132. package/widgets/EodashProcess/methods/async.js +77 -59
  133. package/widgets/EodashProcess/methods/composables.js +21 -14
  134. package/widgets/EodashProcess/methods/custom-endpoints/chart/index.js +35 -0
  135. package/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.js +275 -0
  136. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +116 -0
  137. package/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.js +94 -0
  138. package/widgets/EodashProcess/methods/custom-endpoints/layers/index.js +33 -0
  139. package/widgets/EodashProcess/methods/handling.js +127 -80
  140. package/widgets/EodashProcess/methods/outputs.js +376 -125
  141. package/widgets/EodashProcess/methods/utils.js +398 -10
  142. package/widgets/EodashProcess/states.js +13 -0
  143. package/widgets/EodashProcess/types.ts +46 -0
  144. package/widgets/EodashStacInfo.vue +2 -17
  145. package/widgets/EodashTools.vue +13 -13
  146. package/widgets/WidgetsContainer.vue +1 -1
  147. package/core/client/eodash.js +0 -454
  148. package/dist/client/EodashLayoutSwitcher-DqeFO3RN.js +0 -52
  149. package/dist/client/EodashMapBtns-5BF27qJB.js +0 -131
  150. package/dist/client/ProcessList-C62SOVO6.js +0 -484
  151. package/dist/client/asWebComponent-BJ2NWunV.js +0 -12479
  152. package/dist/client/eo-dash.css +0 -5
  153. package/dist/client/index-Da5xXX6Q.js +0 -780
  154. package/dist/client/transition-Cdb4K27U.js +0 -37
  155. package/dist/types/core/client/eodash.d.ts +0 -8
@@ -1,20 +1,28 @@
1
1
  import { defineStore } from "pinia";
2
- import { inject, ref } from "vue";
2
+ import { ref } from "vue";
3
3
  import axios from "@/plugins/axios";
4
- import { useAbsoluteUrl, useCompareAbsoluteUrl } from "@/composables/index";
5
- import { eodashKey } from "@/utils/keys";
6
- import { indicator } from "@/store/states";
7
- import { extractCollectionUrls } from "@/eodashSTAC/helpers";
4
+ import {
5
+ useAbsoluteUrl,
6
+ useCompareAbsoluteUrl,
7
+ useGetSubCodeId,
8
+ } from "@/composables/index";
9
+ import { compareIndicator, comparePoi, indicator, poi } from "@/store/states";
8
10
  import {
9
11
  eodashCollections,
10
12
  eodashCompareCollections,
11
13
  collectionsPalette,
12
- switchToCompare,
13
14
  } from "@/utils/states";
14
- import { EodashCollection } from "@/eodashSTAC/EodashCollection";
15
15
  import log from "loglevel";
16
+ import { toAbsolute } from "stac-js/src/http.js";
17
+ import { updateEodashCollections } from "@/utils";
16
18
 
17
19
  export const useSTAcStore = defineStore("stac", () => {
20
+ /**
21
+ * STAC catalog endpoint URL
22
+ * @type {import("vue").Ref<import("@/types").StacEndpoint | null>}
23
+ */
24
+ const stacEndpoint = ref(null);
25
+
18
26
  /**
19
27
  * Links of the root STAC catalog
20
28
  *
@@ -26,9 +34,7 @@ export const useSTAcStore = defineStore("stac", () => {
26
34
  * Selected STAC object.
27
35
  *
28
36
  * @type {import("vue").Ref<
29
- * | import("stac-ts").StacCatalog
30
37
  * | import("stac-ts").StacCollection
31
- * | import("stac-ts").StacItem
32
38
  * | null
33
39
  * >}
34
40
  */
@@ -38,15 +44,19 @@ export const useSTAcStore = defineStore("stac", () => {
38
44
  * Selected STAC object.
39
45
  *
40
46
  * @type {import("vue").Ref<
41
- * | import("stac-ts").StacCatalog
42
47
  * | import("stac-ts").StacCollection
43
- * | import("stac-ts").StacItem
44
48
  * | null
45
49
  * >}
46
50
  */
47
51
  const selectedCompareStac = ref(null);
48
52
 
49
- const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
53
+ /**
54
+ * Initializes the store by assigning the STAC endpoint.
55
+ * @param {import("@/types").StacEndpoint} endpoint
56
+ */
57
+ function init(endpoint) {
58
+ stacEndpoint.value = endpoint;
59
+ }
50
60
 
51
61
  /**
52
62
  * Fetches root stac catalog and assign it to `stac`
@@ -56,7 +66,19 @@ export const useSTAcStore = defineStore("stac", () => {
56
66
  * @returns {Promise<void>}
57
67
  * @see {@link stac}
58
68
  */
59
- async function loadSTAC(url = eodash.stacEndpoint) {
69
+ async function loadSTAC(url) {
70
+ if (!url) {
71
+ if (!stacEndpoint.value) {
72
+ throw new Error("STAC endpoint is not defined in eodash configuration");
73
+ }
74
+ url = stacEndpoint.value;
75
+ }
76
+
77
+ if (!url) {
78
+ stac.value = null;
79
+ return;
80
+ }
81
+
60
82
  log.debug("Loading STAC endpoint", url);
61
83
  await axios
62
84
  .get(url)
@@ -81,44 +103,40 @@ export const useSTAcStore = defineStore("stac", () => {
81
103
  * Fetches selected stac object and assign it to `selectedStac`
82
104
  *
83
105
  * @param {string} relativePath - Stac link href
106
+ * @param {boolean} [isPoi=false] - If true, the STAC is loaded for a point of interest
84
107
  * @returns {Promise<void>}
85
108
  * @see {@link selectedStac}
86
109
  */
87
- async function loadSelectedSTAC(relativePath = "") {
88
- const absoluteUrl = useAbsoluteUrl(relativePath);
110
+ async function loadSelectedSTAC(relativePath = "", isPoi = false) {
111
+ if (!stacEndpoint.value) {
112
+ return Promise.reject(new Error("STAC endpoint is not defined"));
113
+ }
114
+ const absoluteUrl = useAbsoluteUrl(relativePath, stacEndpoint.value);
115
+ if (isPoi) {
116
+ // construct absolute URL of a poi
117
+ absoluteUrl.value = constructPoiUrl(relativePath, indicator.value);
118
+ }
89
119
 
90
120
  await axios
91
121
  .get(absoluteUrl.value)
92
122
  .then(async (resp) => {
93
- // init eodash collections
94
- const collectionUrls = extractCollectionUrls(
123
+ await updateEodashCollections(
124
+ eodashCollections,
95
125
  resp.data,
96
126
  absoluteUrl.value,
127
+ collectionsPalette,
97
128
  );
98
-
99
- await Promise.all(
100
- collectionUrls.map((cu, idx) => {
101
- const ec = new EodashCollection(cu);
102
- ec.fetchCollection();
103
- ec.color = collectionsPalette[idx % collectionsPalette.length];
104
- return ec;
105
- }),
106
- ).then((collections) => {
107
- // empty array from old collections
108
- eodashCollections.splice(0, eodashCollections.length);
109
- // update eodashCollections
110
- eodashCollections.push(...collections);
111
-
112
- selectedStac.value = resp.data;
113
- indicator.value = selectedStac.value?.id ?? "";
114
- switchToCompare.value = true;
115
- });
129
+ selectedStac.value = resp.data;
130
+ // set indicator and poi
131
+ indicator.value = isPoi
132
+ ? indicator.value
133
+ : useGetSubCodeId(selectedStac.value);
134
+ poi.value = isPoi ? (selectedStac.value?.id ?? "") : "";
116
135
  })
117
136
  .catch((err) => {
118
137
  throw new Error("error loading the selected STAC", err);
119
138
  });
120
139
  }
121
-
122
140
  /**
123
141
  * Fetches selected stac object and assign it to `selectedCompareStac`
124
142
  *
@@ -126,32 +144,31 @@ export const useSTAcStore = defineStore("stac", () => {
126
144
  * @returns {Promise<void>}
127
145
  * @see {@link selectedCompareStac}
128
146
  */
129
- async function loadSelectedCompareSTAC(relativePath = "") {
130
- const absoluteUrl = useCompareAbsoluteUrl(relativePath);
147
+ async function loadSelectedCompareSTAC(relativePath = "", isPOI = false) {
148
+ if (!stacEndpoint.value) {
149
+ return Promise.reject(
150
+ new Error("STAC endpoint is not defined in eodash configuration"),
151
+ );
152
+ }
153
+ const absoluteUrl = useCompareAbsoluteUrl(relativePath, stacEndpoint.value);
154
+ if (isPOI) {
155
+ // construct absolute URL of a poi
156
+ absoluteUrl.value = constructPoiUrl(relativePath, compareIndicator.value);
157
+ }
131
158
  await axios
132
159
  .get(absoluteUrl.value)
133
160
  .then(async (resp) => {
134
- // init eodash collections
135
- const collectionUrls = await extractCollectionUrls(
161
+ await updateEodashCollections(
162
+ eodashCompareCollections,
136
163
  resp.data,
137
164
  absoluteUrl.value,
165
+ [...collectionsPalette].reverse(),
138
166
  );
139
-
140
- await Promise.all(
141
- collectionUrls.map((cu) => {
142
- const ec = new EodashCollection(cu);
143
- ec.fetchCollection();
144
- return ec;
145
- }),
146
- ).then((collections) => {
147
- // empty array from old collections
148
- eodashCompareCollections.splice(0, eodashCompareCollections.length);
149
- // update eodashCompareCollections
150
- eodashCompareCollections.push(...collections);
151
-
152
- selectedCompareStac.value = resp.data;
153
- switchToCompare.value = false;
154
- });
167
+ selectedCompareStac.value = resp.data;
168
+ compareIndicator.value = isPOI
169
+ ? compareIndicator.value
170
+ : useGetSubCodeId(selectedCompareStac.value);
171
+ comparePoi.value = isPOI ? (selectedCompareStac.value?.id ?? "") : "";
155
172
  })
156
173
  .catch((err) => {
157
174
  throw new Error("error loading the selected comparison STAC", err);
@@ -163,11 +180,31 @@ export const useSTAcStore = defineStore("stac", () => {
163
180
  *
164
181
  */
165
182
  async function resetSelectedCompareSTAC() {
183
+ eodashCompareCollections.splice(0, eodashCompareCollections.length);
166
184
  selectedCompareStac.value = null;
167
185
  }
168
186
 
187
+ /**
188
+ * Construct absolute URL of a point of interest (POI)
189
+ *
190
+ * @param {string} relativePath - The relative path to the POI
191
+ * @param {string} indicatorStr - selected indicator id or subcode
192
+ */
193
+ function constructPoiUrl(relativePath, indicatorStr) {
194
+ if (!stacEndpoint.value) {
195
+ throw new Error("STAC endpoint is not defined in eodash configuration");
196
+ }
197
+ // construct absolute URL of a poi
198
+ const indicatorUrl =
199
+ stac.value?.find((link) => useGetSubCodeId(link) === indicatorStr)
200
+ ?.href ?? "";
201
+ const absoluteIndicatorUrl = toAbsolute(indicatorUrl, stacEndpoint.value);
202
+ return toAbsolute(relativePath, absoluteIndicatorUrl);
203
+ }
204
+
169
205
  return {
170
206
  stac,
207
+ init,
171
208
  loadSTAC,
172
209
  loadSelectedSTAC,
173
210
  loadSelectedCompareSTAC,
@@ -2,7 +2,7 @@
2
2
  import log from "loglevel";
3
3
  log.setLevel(log.levels.WARN, true);
4
4
 
5
- import { ref } from "vue";
5
+ import { ref, shallowRef } from "vue";
6
6
 
7
7
  /** Currently selected STAC endpoint */
8
8
  export const currentUrl = ref("");
@@ -15,6 +15,8 @@ export const datetime = ref(new Date().toISOString());
15
15
 
16
16
  /** Currently selected indicator */
17
17
  export const indicator = ref("");
18
+ /** Currently selected compare indicator */
19
+ export const compareIndicator = ref("");
18
20
 
19
21
  /**
20
22
  * Current map position
@@ -28,10 +30,18 @@ export const registeredProjections = ["EPSG:4326", "EPSG:3857"];
28
30
  /** available projection to be rendered by `EodashMap` */
29
31
  export const availableMapProjection = ref("EPSG:3857");
30
32
 
31
- /** @type {import("vue").Ref<HTMLElement & Record<string,any> | null>} */
32
- export const mapEl = ref(null);
33
+ /** @type {import("vue").Ref<import("@eox/map").EOxMap | null>} */
34
+ export const mapEl = shallowRef(null);
33
35
 
34
- /** @type {import("vue").Ref<HTMLElement & Record<string,any> | null>} */
35
- export const mapCompareEl = ref(null);
36
+ /** @type {import("vue").Ref<import("@eox/map").EOxMap | null>} */
37
+ export const mapCompareEl = shallowRef(null);
36
38
 
37
39
  export const activeTemplate = ref("");
40
+ /**
41
+ * Selected point of interest, used for location collections
42
+ */
43
+ export const poi = ref("");
44
+ /**
45
+ * Selected point of interest for comparison, used for location collections
46
+ */
47
+ export const comparePoi = ref("");
@@ -1,5 +1,5 @@
1
1
  /** @group Eodash */
2
- export interface WebComponentProps<T extends ExecutionTime = "compiletime"> {
2
+ export interface WebComponentProps {
3
3
  /**
4
4
  * Imports web component file, either using a URL or an import function.
5
5
  *
@@ -14,7 +14,7 @@ export interface WebComponentProps<T extends ExecutionTime = "compiletime"> {
14
14
  * import maps are not available in runtime config
15
15
  * :::
16
16
  */
17
- link?: T extends "runtime" ? string : string | (() => Promise<unknown>);
17
+ link?: string | (() => Promise<unknown>);
18
18
  /**
19
19
  * Exported Constructor, needs to be provided if the web component is not
20
20
  * registered in by the [link](#link) provided
@@ -58,33 +58,47 @@ export interface WidgetsContainerProps {
58
58
  * @group Eodash
59
59
  * */
60
60
  export interface Layout {
61
- /** Horizontal start position. Integer between 1 and 12 */
62
- x: number;
63
- /** Vertical start position. Integer between 1 and 12 */
64
- y: number;
65
- /** Width. Integer between 1 and 12 */
66
- w: number;
67
- /** Height. Integer between 1 and 12 */
68
- h: number;
61
+ /**
62
+ * Horizontal start position. Integer between 1 and 12 or numbers seperated by "/" for different breakpoints
63
+ * @example "3/2/1"
64
+ */
65
+ x: number | string;
66
+ /**
67
+ * Vertical start position. Integer between 1 and 12 or numbers seperated by "/" for different breakpoints
68
+ * @example "3/2/1"
69
+ */
70
+ y: number | string;
71
+ /**
72
+ * Width. Integer between 1 and 12 or numbers seperated by "/" for different breakpoints
73
+ * @example "3/2/1"
74
+ */
75
+ w: number | string;
76
+ /**
77
+ * Height. Integer between 1 and 12 or numbers seperated by "/" for different breakpoints
78
+ * @example "3/2/1"
79
+ */
80
+ h: number | string;
69
81
  }
70
82
  /**
71
83
  * Widget type: `web-component` API
72
84
  *
73
85
  * @group Eodash
74
86
  */
75
- export interface WebComponentWidget<T extends ExecutionTime = "compiletime"> {
87
+ export interface WebComponentWidget {
76
88
  id: number | string | symbol;
77
89
  title: string;
78
90
  /** Widget position and size. */
79
91
  layout: Layout;
80
- widget: WebComponentProps<T>;
92
+ widget: WebComponentProps;
81
93
  type: "web-component";
82
94
  }
83
95
  // Internal Widget Interfaces
84
96
  /** @group Widgets */
85
97
  export interface TEodashMap {
86
98
  name: "EodashMap";
87
- properties?: InstanceType<typeof import("^/EodashMap.vue").default>["$props"];
99
+ properties?: InstanceType<
100
+ typeof import("^/EodashMap/index.vue").default
101
+ >["$props"];
88
102
  }
89
103
 
90
104
  /** @group Widgets */
@@ -123,7 +137,7 @@ export interface TEodashStacInfo {
123
137
  export interface TEodashProcess {
124
138
  name: "EodashProcess";
125
139
  properties?: InstanceType<
126
- typeof import("^/EodashProcess.vue").default
140
+ typeof import("^/EodashProcess/index.vue").default
127
141
  >["$props"];
128
142
  }
129
143
 
@@ -219,7 +233,7 @@ export interface IFrameWidget {
219
233
  type: "iframe";
220
234
  }
221
235
  /** @group Eodash */
222
- export interface FunctionalWidget<T extends ExecutionTime = "compiletime"> {
236
+ export interface FunctionalWidget {
223
237
  /**
224
238
  * Provides a functional definition of widgets, gets triggered whenever a STAC
225
239
  * object is selected, and only renders the returned configuration if the `id`
@@ -228,20 +242,17 @@ export interface FunctionalWidget<T extends ExecutionTime = "compiletime"> {
228
242
  * @param selectedSTAC - Currently selected STAC object
229
243
  */
230
244
  defineWidget: (
231
- selectedSTAC:
232
- | import("stac-ts").StacCatalog
233
- | import("stac-ts").StacCollection
234
- | import("stac-ts").StacItem
235
- | null,
236
- ) => StaticWidget<T> | undefined | null;
245
+ selectedSTAC: import("stac-ts").StacCollection | null,
246
+ selectedCompareSTAC?: import("stac-ts").StacCollection | null,
247
+ ) => StaticWidget | undefined | null | false;
237
248
  }
238
249
  /**
239
250
  * There are 3 types of Widgets:
240
251
  *
241
252
  * @group Eodash
242
253
  */
243
- export type StaticWidget<T extends ExecutionTime = "compiletime"> =
244
- | WebComponentWidget<T>
254
+ export type StaticWidget =
255
+ | WebComponentWidget
245
256
  | InternalComponentWidget
246
257
  | IFrameWidget;
247
258
  /**
@@ -256,16 +267,14 @@ export type StaticWidget<T extends ExecutionTime = "compiletime"> =
256
267
  *
257
268
  * @group Eodash
258
269
  */
259
- export type Widget<T extends ExecutionTime = "compiletime"> =
260
- | StaticWidget<T>
261
- | FunctionalWidget<T>;
270
+ export type Widget = StaticWidget | FunctionalWidget;
262
271
 
263
272
  /** @group Eodash */
264
- export type BackgroundWidget<T extends ExecutionTime = "compiletime"> =
265
- | Omit<WebComponentWidget<T>, "layout" | "title" | "slidable">
273
+ export type BackgroundWidget =
274
+ | Omit<WebComponentWidget, "layout" | "title" | "slidable">
266
275
  | Omit<InternalComponentWidget, "layout" | "title" | "slidable">
267
276
  | Omit<IFrameWidget, "layout" | "title" | "slidable">
268
- | Omit<FunctionalWidget<T>, "layout" | "slidable">;
277
+ | Omit<FunctionalWidget, "layout" | "slidable">;
269
278
  /**
270
279
  * Dashboard rendered widgets specification. 3 types of widgets are supported:
271
280
  * `"iframe"`, `"internal"`, and `"web-component"`. A specific object should be
@@ -273,30 +282,25 @@ export type BackgroundWidget<T extends ExecutionTime = "compiletime"> =
273
282
  *
274
283
  * @group Eodash
275
284
  */
276
- export interface Template<T extends ExecutionTime = "compiletime"> {
285
+ export interface Template {
277
286
  /** Gap between widgets */
278
287
  gap?: number;
279
288
  /** Loading widget */
280
- loading?: BackgroundWidget<T>;
289
+ loading?: BackgroundWidget;
281
290
  /**
282
291
  * Widget rendered as the dashboard background. Has the same specifications of
283
292
  * {@link Widget} without the `title` and `layout` properties
284
293
  */
285
- background?: BackgroundWidget<T>;
294
+ background?: BackgroundWidget;
286
295
  /** Array of widgets that will be rendered as dashboard panels. */
287
- widgets: Widget<T>[];
296
+ widgets: Widget[];
288
297
  }
289
298
  /** @group Eodash */
290
- export type MultiTemplates<T extends ExecutionTime = "compiletime"> = Record<
291
- string,
292
- Template<T>
293
- >;
299
+ export type MultiTemplates = Record<string, Template>;
294
300
 
295
301
  /** @ignore */
296
302
  export type StacEndpoint = `${string}/catalog.json`;
297
303
 
298
- /** @group Eodash */
299
- type ExecutionTime = "runtime" | "compiletime";
300
304
  /** @group Eodash */
301
305
  export interface EodashFont {
302
306
  /**
@@ -312,9 +316,13 @@ export interface EodashFont {
312
316
  *
313
317
  * @group Eodash
314
318
  */
315
- export type Eodash<T extends ExecutionTime = "compiletime"> = {
319
+ export type Eodash = {
316
320
  /** Instance ID. */
317
321
  id?: string;
322
+ /** Object containing potential special configuration options */
323
+ options?: {
324
+ useSubCode?: boolean;
325
+ };
318
326
  /** Root STAC catalog endpoint */
319
327
  stacEndpoint: StacEndpoint;
320
328
  /** Brand specifications. */
@@ -338,7 +346,7 @@ export type Eodash<T extends ExecutionTime = "compiletime"> = {
338
346
  * Dashboard theme as a custom [vuetifyJs
339
347
  * theme](https://vuetifyjs.com/en/features/theme/).
340
348
  */
341
- theme?: import("vuetify/lib/index.mjs").ThemeDefinition & {
349
+ theme?: import("vuetify").ThemeDefinition & {
342
350
  collectionsPalette?: string[];
343
351
  };
344
352
  /** Text applied to the footer. */
@@ -347,11 +355,11 @@ export type Eodash<T extends ExecutionTime = "compiletime"> = {
347
355
  } & (
348
356
  | {
349
357
  /** Template configuration */
350
- template: Template<T>;
358
+ template: Template;
351
359
  }
352
360
  | {
353
361
  /** Multiple templates configuration */
354
- templates: MultiTemplates<T>;
362
+ templates: MultiTemplates;
355
363
  }
356
364
  );
357
365
  /////////
@@ -436,3 +444,11 @@ export type EodashStyleJson = import("ol/style/flat").FlatStyleLike & {
436
444
  jsonform?: import("json-schema").JSONSchema7;
437
445
  tooltip?: { id: string; title?: string; appendix?: string }[];
438
446
  };
447
+
448
+ export type LayersEventBusKeys =
449
+ | "layers:updated"
450
+ | "time:updated"
451
+ | "process:updated"
452
+ | "compareLayers:updated"
453
+ | "compareTime:updated"
454
+ | "compareProcess:updated";
@@ -1,5 +1,13 @@
1
1
  import log from "loglevel";
2
2
  import { collectionsPalette } from "./states";
3
+ import {
4
+ extractCollectionUrls,
5
+ generateLinksFromItems,
6
+ revokeCollectionBlobUrls,
7
+ } from "@/eodashSTAC/helpers";
8
+ import { EodashCollection } from "@/eodashSTAC/EodashCollection";
9
+ import { toAbsolute } from "stac-js/src/http.js";
10
+ import { readParquetItems } from "@/eodashSTAC/parquet";
3
11
  import WebFontLoader from "webfontloader";
4
12
 
5
13
  /**
@@ -141,3 +149,74 @@ export const setCollectionsPalette = (colors) => {
141
149
  collectionsPalette.splice(0, collectionsPalette.length);
142
150
  collectionsPalette.push(...colors);
143
151
  };
152
+
153
+ /**
154
+ * Updates the eodash collections by fetching and processing collection data from specified URLs
155
+ * @param {import("stac-ts").StacCollection} selectedStac - The indicator object
156
+ * @param {string} absoluteUrl - The absolute indicator URL
157
+ * @param {import('@/eodashSTAC/EodashCollection').EodashCollection[]} eodashCollections - The array of existing eodash collections to be updated
158
+ * @param {string[]} colorPalette - The color palette to assign to each collection
159
+ * @async
160
+ * @description This function extracts collection URLs from the indicator, fetches collection data,
161
+ * processes parquet items if available, and updates the eodashCollections array with new collection data.
162
+ * Each collection is assigned a color from a predefined palette.
163
+ */
164
+ export const updateEodashCollections = async (
165
+ eodashCollections,
166
+ selectedStac,
167
+ absoluteUrl,
168
+ colorPalette,
169
+ ) => {
170
+ // init eodash collections
171
+ const collectionUrls = extractCollectionUrls(selectedStac, absoluteUrl);
172
+
173
+ await Promise.all(
174
+ collectionUrls.map((cu, idx) => {
175
+ return new Promise((resolve, _reject) => {
176
+ const ec = new EodashCollection(cu);
177
+ ec.fetchCollection().then((col) => {
178
+ // assign color from the palette
179
+ ec.color = colorPalette[idx % colorPalette.length];
180
+
181
+ const parquetAsset = Object.values(col.assets ?? {}).find(
182
+ (asset) =>
183
+ asset.type === "application/vnd.apache.parquet" &&
184
+ asset.roles?.includes("collection-mirror"),
185
+ );
186
+
187
+ if (!parquetAsset) {
188
+ resolve(ec);
189
+ return;
190
+ }
191
+
192
+ readParquetItems(toAbsolute(parquetAsset.href, cu)).then((items) => {
193
+ col.links.push(...generateLinksFromItems(items));
194
+ resolve(ec);
195
+ });
196
+ });
197
+ });
198
+ }),
199
+ ).then(async (collections) => {
200
+ // revoke old blob urls in the previous collections. see generateLinksFromItems in "../eodashSTAC/helpers.js"
201
+ eodashCollections.forEach((ec) => {
202
+ revokeCollectionBlobUrls(ec);
203
+ });
204
+ // empty array from old collections
205
+ eodashCollections.splice(0, eodashCollections.length);
206
+ // update eodashCollections
207
+ eodashCollections.push(...collections);
208
+ });
209
+ };
210
+ /**
211
+ *
212
+ * @param {Element | string} selector
213
+ */
214
+ export const getElement = (selector) => {
215
+ const eoDash = document.querySelector("eo-dash");
216
+ if (!eoDash) {
217
+ //@ts-expect-error selectior can be a string or an Element
218
+ return document.querySelector(selector);
219
+ }
220
+ //@ts-expect-error selectior can be a string or an Element
221
+ return eoDash.shadowRoot?.querySelector(selector);
222
+ };
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * `eodash` injection key.
3
- *
3
+ * @type {import("vue").InjectionKey<import("@/types").Eodash>}
4
4
  * @see {@link "@/plugins/index.js"}
5
5
  */
6
6
  export const eodashKey = Symbol("eodash");
7
- /** @type {import("@vueuse/core").EventBusKey<"layers:updated"|"time:updated">} */
7
+ /** @type {import("@vueuse/core").EventBusKey<import("@/types").LayersEventBusKeys>} */
8
8
  export const eoxLayersKey = Symbol("eoxMapLayers");
@@ -3,7 +3,10 @@ import {
3
3
  mdiCurrencyEur,
4
4
  mdiHospitalBoxOutline,
5
5
  mdiImageFilterHdr,
6
+ mdiLeaf,
7
+ mdiLightningBolt,
6
8
  mdiSetCenter,
9
+ mdiSnowflake,
7
10
  mdiWater,
8
11
  mdiWeatherWindy,
9
12
  } from "@mdi/js";
@@ -27,8 +30,8 @@ export const eodashCollections = shallowReactive([]);
27
30
  */
28
31
  export const eodashCompareCollections = shallowReactive([]);
29
32
 
30
- /** whether the map postion was set in URL params on first load */
31
- export const posIsSetFromUrl = ref(false);
33
+ /** whether it's the first load of the app, used to track if there are params in the url */
34
+ export const isFirstLoad = ref(false);
32
35
 
33
36
  /**
34
37
  * Current value of the layer control JSON form for the latest layer the user interacted with.
@@ -66,13 +69,21 @@ export const dataThemesBrands = {
66
69
  icon: mdiWater,
67
70
  color: "#73A6C7",
68
71
  },
72
+ oceans: {
73
+ icon: mdiWater,
74
+ color: "#6DA2C5",
75
+ },
69
76
  land: {
70
77
  icon: mdiImageFilterHdr,
71
78
  color: "#019E73",
72
79
  },
73
80
  health: {
74
81
  icon: mdiHospitalBoxOutline,
75
- color: "#497FA9",
82
+ color: "#32322C",
83
+ },
84
+ "covid-19": {
85
+ icon: mdiHospitalBoxOutline,
86
+ color: "#32322C",
76
87
  },
77
88
  combined: {
78
89
  icon: mdiSetCenter,
@@ -82,10 +93,24 @@ export const dataThemesBrands = {
82
93
  icon: mdiWeatherWindy,
83
94
  color: "#475faf",
84
95
  },
96
+ atmosphere: {
97
+ icon: mdiWeatherWindy,
98
+ color: "#475faf",
99
+ },
85
100
  economy: {
86
101
  icon: mdiCurrencyEur,
87
102
  color: "#8E81AF",
88
103
  },
104
+ biomass: {
105
+ icon: mdiLeaf,
106
+ color: "#009E73",
107
+ },
108
+ extremes: {
109
+ icon: mdiLightningBolt,
110
+ color: "#a1280a",
111
+ },
112
+ cryosphere: {
113
+ icon: mdiSnowflake,
114
+ color: "#42C7B8",
115
+ },
89
116
  };
90
- /** used for switching in and out of compare mode @see {@link widgets/EodashMapBtns.vue} */
91
- export const switchToCompare = ref(true);