@eodash/eodash 5.1.0 → 5.2.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 (65) hide show
  1. package/core/client/components/DashboardLayout.vue +1 -1
  2. package/core/client/components/EodashOverlay.vue +4 -5
  3. package/core/client/components/MobileLayout.vue +42 -21
  4. package/core/client/composables/index.js +1 -1
  5. package/core/client/eodashSTAC/EodashCollection.js +4 -15
  6. package/core/client/eodashSTAC/createLayers.js +30 -0
  7. package/core/client/eodashSTAC/helpers.js +23 -1
  8. package/dist/client/{DashboardLayout-ByVs1DrY.js → DashboardLayout-Dq9Kfe6O.js} +5 -5
  9. package/dist/client/{DynamicWebComponent-C3W7HSQm.js → DynamicWebComponent-DCBMXskE.js} +1 -1
  10. package/dist/client/{EodashDatePicker-BIAf1sMT.js → EodashDatePicker-DtngxU6s.js} +3 -3
  11. package/dist/client/{EodashItemFilter-DPznh8UB.js → EodashItemFilter-ClQebJQt.js} +1 -1
  12. package/dist/client/{EodashLayerControl-Bhxjw4V2.js → EodashLayerControl-BLBds28C.js} +2 -2
  13. package/dist/client/{EodashLayoutSwitcher-C5qTEffW.js → EodashLayoutSwitcher-DQ8SfVDd.js} +3 -3
  14. package/dist/client/EodashMapBtns-B89_YBDw.js +326 -0
  15. package/dist/client/{EodashStacInfo-CSvvF2jI.js → EodashStacInfo-Dt1nF06x.js} +1 -1
  16. package/dist/client/{EodashTools-Cv1SXQ5y.js → EodashTools-DV5ykmWc.js} +4 -4
  17. package/dist/client/{ExportState-D-iuwaad.js → ExportState-B6zZQUmE.js} +4 -5
  18. package/dist/client/{Footer-CyF0zRAk.js → Footer-DNhXs8k6.js} +1 -1
  19. package/dist/client/{Header-CgD8jDKU.js → Header-BjhN5JY4.js} +2 -3
  20. package/dist/client/MobileLayout-JelB6w1G.js +118 -0
  21. package/dist/client/{PopUp-BsYLvWch.js → PopUp-CgpvNr3o.js} +2 -3
  22. package/dist/client/{ProcessList-C2xsLU2_.js → ProcessList-vecpxThi.js} +17 -10
  23. package/dist/client/{VImg-OHe8YTs2.js → VImg-CETuikH2.js} +200 -5
  24. package/dist/client/{VMain-PryTLU4a.js → VMain-Ci9DyaGU.js} +1 -1
  25. package/dist/client/{VTooltip-DZ0fjpB3.js → VTooltip-J4ac48X7.js} +2 -3
  26. package/dist/client/{WidgetsContainer-B9LBadcC.js → WidgetsContainer-CCML4TyV.js} +1 -1
  27. package/dist/client/{asWebComponent-By_7_JjS.js → asWebComponent-ZyEzWOOf.js} +59 -160
  28. package/dist/client/{async-DkSu_u2K.js → async-B7jIrM53.js} +69 -5
  29. package/dist/client/eo-dash.js +1 -1
  30. package/dist/client/{VOverlay-yUn7p-Uf.js → forwardRefs-BQclvjMq.js} +272 -5
  31. package/dist/client/{handling-CgmFXkW6.js → handling-BS24aG1q.js} +20 -5
  32. package/dist/client/{helpers-Dy0Q13tP.js → helpers-wXK7Ywio.js} +24 -2
  33. package/dist/client/{index-skjhlH8u.js → index-4UCzZi8B.js} +5 -5
  34. package/dist/client/{index-Dqj4tbx2.js → index-9KR-G20t.js} +2 -2
  35. package/dist/client/{index-Ch_HchK3.js → index-B2XpdgR6.js} +191 -57
  36. package/dist/client/material-symbols-outlined.woff2 +0 -0
  37. package/dist/client/material-symbols-rounded.woff2 +0 -0
  38. package/dist/client/material-symbols-sharp.woff2 +0 -0
  39. package/dist/client/material-symbols-subset.woff2 +0 -0
  40. package/dist/client/templates.js +27 -37
  41. package/dist/client/{transition-C98Yn4Vo.js → transition-yBii4fu6.js} +1 -1
  42. package/dist/node/cli.js +1 -1
  43. package/dist/types/core/client/eodashSTAC/helpers.d.ts +5 -0
  44. package/dist/types/core/client/types.d.ts +1 -1
  45. package/dist/types/templates/compare.d.ts +0 -25
  46. package/dist/types/templates/expert.d.ts +16 -20
  47. package/dist/types/templates/light.d.ts +9 -0
  48. package/dist/types/widgets/{EodashMapBtns.vue.d.ts → EodashMap/EodashMapBtns.vue.d.ts} +4 -0
  49. package/dist/types/widgets/EodashMap/index.vue.d.ts +8 -0
  50. package/dist/types/widgets/EodashProcess/methods/async.d.ts +1 -0
  51. package/package.json +4 -2
  52. package/templates/compare.js +0 -20
  53. package/templates/expert.js +16 -15
  54. package/templates/light.js +10 -1
  55. package/widgets/EodashMap/EodashMapBtns.vue +269 -0
  56. package/widgets/EodashMap/index.vue +252 -37
  57. package/widgets/EodashProcess/ProcessList.vue +13 -1
  58. package/widgets/EodashProcess/methods/async.js +22 -1
  59. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +19 -3
  60. package/widgets/EodashProcess/methods/utils.js +45 -1
  61. package/dist/client/EodashMapBtns-WoGq8MuV.js +0 -173
  62. package/dist/client/MobileLayout-EKQ_kpSh.js +0 -1226
  63. package/dist/client/forwardRefs-BXxrv98s.js +0 -272
  64. package/dist/client/index-BuhOHXKv.js +0 -199
  65. package/widgets/EodashMapBtns.vue +0 -155
@@ -17,7 +17,14 @@
17
17
  <tbody>
18
18
  <tr v-for="item in currentJobs" :key="item.jobID">
19
19
  <td>
20
- {{ new Date(item.job_start_datetime).toISOString().slice(0, 16) }}
20
+ <a
21
+ class="processUrl"
22
+ target="_blank"
23
+ :href="getJobStatusUrl(item.jobID, currentIndicator)"
24
+ >{{
25
+ new Date(item.job_start_datetime).toISOString().slice(0, 16)
26
+ }}</a
27
+ >
21
28
  </td>
22
29
  <td>{{ item.status }}</td>
23
30
  <td style="padding: 0px">
@@ -73,6 +80,7 @@ import {
73
80
  downloadPreviousResults,
74
81
  loadProcess,
75
82
  updateJobsStatus,
83
+ getJobStatusUrl,
76
84
  } from "./methods/async";
77
85
  import { useOnLayersUpdate } from "@/composables";
78
86
  import { compareJobs, jobs } from "./states";
@@ -103,4 +111,8 @@ div.v-table__wrapper {
103
111
  overflow: hidden !important;
104
112
  height: max-content !important;
105
113
  }
114
+ .processUrl {
115
+ text-decoration: none;
116
+ color: var(--v-theme-primary);
117
+ }
106
118
  </style>
@@ -150,7 +150,15 @@ export const downloadPreviousResults = async (jobObject, selectedStac) => {
150
150
  .get(link.href)
151
151
  .then((response) => response.data)
152
152
  .then((data) => {
153
- results.push(...data.urls);
153
+ // either urls is an Array
154
+ if (data.urls) {
155
+ results.push(...data.urls);
156
+ } else {
157
+ // or urls need to be aggregated from mapping objects
158
+ for (const outputMappingObject of Object.values(data)) {
159
+ results.push(...outputMappingObject.urls);
160
+ }
161
+ }
154
162
  });
155
163
  results.forEach((result) => {
156
164
  if (!result) {
@@ -225,3 +233,16 @@ export async function loadPreviousProcess({
225
233
  log.debug("rendered layers after loading previous process:", layers);
226
234
  applyProcessLayersToMap(mapElement, layers);
227
235
  }
236
+
237
+ /**
238
+ * extracts job status url from local storage based on identifier
239
+ *
240
+ * @param {string} jobID
241
+ * @param {string} indicator
242
+ */
243
+ export const getJobStatusUrl = (jobID, indicator) => {
244
+ /** @type {string[]} */
245
+ const jobsUrls = JSON.parse(localStorage.getItem(indicator) || "[]");
246
+ const jobUrl = jobsUrls.find((url) => url.includes(jobID));
247
+ return jobUrl;
248
+ };
@@ -2,7 +2,8 @@ import axios from "@/plugins/axios";
2
2
  import { getBboxProperty } from "../../utils";
3
3
  import { toAbsolute } from "stac-js/src/http.js";
4
4
  import { currentCompareUrl, currentUrl } from "@/store/states";
5
- import { getDatetimeProperty } from "@/eodashSTAC/helpers";
5
+ import { getDatetimeProperty, generateLinksFromItems } from "@/eodashSTAC/helpers";
6
+ import { readParquetItems } from "@/eodashSTAC/parquet";
6
7
 
7
8
  /**
8
9
  * @param {import("^/EodashProcess/types").CustomEnpointInput} inputs
@@ -75,7 +76,22 @@ async function fetchVedaCOGsConfig(selectedStac, absoluteUrl) {
75
76
  collectionLinks.map((link) =>
76
77
  axios
77
78
  .get(toAbsolute(link.href, absoluteUrl))
78
- .then((resp) => resp.data),
79
+ .then((resp) => resp.data)
80
+ .then(async (collection) => {
81
+ // items in geoparquet handling specially to get item links
82
+ const parquetAsset = Object.values(collection.assets ?? {}).find(
83
+ (asset) =>
84
+ asset.type === "application/vnd.apache.parquet" &&
85
+ asset.roles?.includes("collection-mirror"),
86
+ );
87
+ if (parquetAsset) {
88
+ const parquetAbsoluteUrl = toAbsolute(parquetAsset.href, toAbsolute(link.href, absoluteUrl));
89
+ await readParquetItems(parquetAbsoluteUrl).then((items) => {
90
+ collection.links.push(...generateLinksFromItems(items));
91
+ });
92
+ }
93
+ return collection;
94
+ }),
79
95
  ),
80
96
  )),
81
97
  );
@@ -86,7 +102,7 @@ async function fetchVedaCOGsConfig(selectedStac, absoluteUrl) {
86
102
  const datetimeProperty = /** @type string **/ (
87
103
  getDatetimeProperty(collection.links)
88
104
  );
89
- let itemLinks = collection.links.filter((link) => link.rel == "item");
105
+ const itemLinks = collection.links.filter((link) => link.rel == "item");
90
106
  configs.push(
91
107
  ...itemLinks.map((link) => ({
92
108
  endpoint: /** @type {string} */ (link["cog_href"]),
@@ -3,6 +3,7 @@ import {
3
3
  extractLayerConfig,
4
4
  mergeGeojsons,
5
5
  replaceLayer,
6
+ extractLayerLegend,
6
7
  } from "@/eodashSTAC/helpers";
7
8
  import axios from "@/plugins/axios";
8
9
  import { getCompareLayers, getLayers } from "@/store/actions";
@@ -290,7 +291,10 @@ export async function creatAsyncProcessLayerDefinitions(
290
291
 
291
292
  for (const resultItem of processResults) {
292
293
  const flatStyleJSON = extractStyleFromResult(resultItem, flatStyles);
293
- let style, layerConfig;
294
+ /** @type {import("@/types").EodashStyleJson | undefined} */
295
+ let style;
296
+ /** @type {Record<string, unknown> | undefined} */
297
+ let layerConfig;
294
298
  if (flatStyleJSON) {
295
299
  const extracted = extractLayerConfig(
296
300
  selectedStac?.id ?? "",
@@ -300,6 +304,9 @@ export async function creatAsyncProcessLayerDefinitions(
300
304
  style = extracted.style;
301
305
  }
302
306
 
307
+ // Check if collection has eox:colorlegend definition, if yes overwrite legend description
308
+ let extraProperties = extractLayerLegend(selectedStac);
309
+
303
310
  switch (resultItem.type) {
304
311
  case "image/tiff": {
305
312
  layers.push({
@@ -313,6 +320,7 @@ export async function creatAsyncProcessLayerDefinitions(
313
320
  (resultItem.id ?? ""),
314
321
  layerControlToolsExpand: true,
315
322
  ...(layerConfig && { layerConfig }),
323
+ ...extraProperties,
316
324
  },
317
325
  source: {
318
326
  type: "GeoTIFF",
@@ -350,12 +358,48 @@ export async function creatAsyncProcessLayerDefinitions(
350
358
  style,
351
359
  },
352
360
  }),
361
+ ...extraProperties,
353
362
  },
354
363
  ...(!style?.variables && { style }),
355
364
  interactions: [],
356
365
  });
357
366
  break;
358
367
  }
368
+ case "application/vnd.flatgeobuf": {
369
+ // TODO after more flatgeobuf urls are possible in EOxMap https://github.com/EOX-A/EOxElements/issues/1789
370
+ // we should change this handler to only create one layer instead of many
371
+ resultItem.urls.forEach((url, i) => {
372
+ layers.push({
373
+ type: "Vector",
374
+ source: {
375
+ type: "FlatGeoBuf",
376
+ url,
377
+ },
378
+ properties: {
379
+ id:
380
+ endpointLink.id +
381
+ "_process_" +
382
+ resultItem.id +
383
+ postfixId +
384
+ `_${i}`,
385
+ title:
386
+ "Results " +
387
+ (selectedStac?.id ?? "") +
388
+ " " +
389
+ (resultItem.id ?? ""),
390
+ layerControlToolsExpand: true,
391
+ ...(layerConfig && {
392
+ layerConfig: {
393
+ ...layerConfig,
394
+ style,
395
+ },
396
+ }),
397
+ ...extraProperties,
398
+ },
399
+ });
400
+ });
401
+ break;
402
+ }
359
403
  default:
360
404
  console.warn(
361
405
  `[eodash] Unsupported result type "${resultItem.type}" for ${resultItem.id} layer creation.`,
@@ -1,173 +0,0 @@
1
- import { computed, ref, createElementBlock, openBlock, withDirectives, createCommentVNode, createBlock, createVNode, unref, withCtx, triggerRef } from 'vue';
2
- import { _ as _export_sfc, Y as useSTAcStore, r as useDisplay, Z as useTransparentPanel, V as VBtn } from './asWebComponent-By_7_JjS.js';
3
- import { z as activeTemplate, K as availableMapProjection, L as changeMapProjection, y as poi, D as comparePoi, M as setActiveTemplate } from './helpers-Dy0Q13tP.js';
4
- import { mdiCompareRemove, mdiCompare, mdiMapPlus, mdiEarthBox, mdiStarFourPointsCircleOutline } from '@mdi/js';
5
- import ExportState from './ExportState-D-iuwaad.js';
6
- import _sfc_main$1 from './PopUp-BsYLvWch.js';
7
- import EodashItemFilter from './EodashItemFilter-DPznh8UB.js';
8
- import { storeToRefs } from 'pinia';
9
- import { l as loadPOiIndicator } from './handling-CgmFXkW6.js';
10
- import { T as Tooltip } from './index-Dqj4tbx2.js';
11
-
12
- const _style_0 = ".map-btn[data-v-771740c6]{width:36px;height:36px;border-radius:25%;margin:4px}";
13
-
14
- const _sfc_main = {
15
- __name: 'EodashMapBtns',
16
- props: {
17
- exportMap: {
18
- type: Boolean,
19
- default: true,
20
- },
21
- changeProjection: {
22
- type: Boolean,
23
- default: true,
24
- },
25
- compareIndicators: {
26
- /** @type {import("vue").PropType<boolean | {compareTemplate?:string;fallbackTemplate?:string}> }*/
27
- type: [Boolean, Object],
28
- default: true,
29
- },
30
- backToPOIs: {
31
- type: Boolean,
32
- default: true,
33
- },
34
- },
35
- setup(__props) {
36
-
37
-
38
- const { selectedStac, selectedCompareStac } = storeToRefs(useSTAcStore());
39
- const { resetSelectedCompareSTAC } = useSTAcStore();
40
- const { smAndDown } = useDisplay();
41
- const popupWidth = computed(() => (smAndDown.value ? "80%" : "70%"));
42
- const popupHeight = computed(() => (smAndDown.value ? "90%" : "70%"));
43
-
44
- const showMapState = ref(false);
45
- const showCompareIndicators = ref(false);
46
- const compareIcon = computed(() =>
47
- activeTemplate.value ===
48
- ((typeof __props.compareIndicators === "object" &&
49
- __props.compareIndicators?.compareTemplate) ||
50
- "compare")
51
- ? mdiCompareRemove
52
- : mdiCompare,
53
- );
54
-
55
- const onCompareClick = () => {
56
- showCompareIndicators.value = !showCompareIndicators.value;
57
-
58
- const fallbackTemplate =
59
- (typeof __props.compareIndicators === "object" &&
60
- __props.compareIndicators.fallbackTemplate) ||
61
- "expert";
62
- selectedCompareStac.value = null;
63
- resetSelectedCompareSTAC();
64
- setActiveTemplate(fallbackTemplate);
65
- triggerRef(selectedStac);
66
- };
67
-
68
- /** @type {import("vue").Ref<HTMLDivElement|null>} */
69
- const rootRef = ref(null);
70
-
71
- const onSelectCompareIndicator = () => {
72
- const compareTemplate =
73
- (typeof __props.compareIndicators === "object" &&
74
- __props.compareIndicators.compareTemplate) ||
75
- "compare";
76
- setActiveTemplate(compareTemplate);
77
- showCompareIndicators.value = !showCompareIndicators.value;
78
- };
79
-
80
- useTransparentPanel(rootRef);
81
-
82
- return (_ctx, _cache) => {
83
-
84
-
85
-
86
- return (openBlock(), createElementBlock("div", {
87
- ref_key: "rootRef",
88
- ref: rootRef,
89
- class: "d-flex flex-column align-end"
90
- }, [
91
- (__props.exportMap)
92
- ? withDirectives((openBlock(), createBlock(VBtn, {
93
- key: 0,
94
- class: "map-btn",
95
- icon: [unref(mdiMapPlus)],
96
- size: "small",
97
- onClick: _cache[0] || (_cache[0] = $event => (showMapState.value = !showMapState.value))
98
- }, null, 8 /* PROPS */, ["icon"])), [
99
- [Tooltip, 'Extract Storytelling configuration', "bottom"]
100
- ])
101
- : createCommentVNode("v-if", true),
102
- (__props.exportMap)
103
- ? (openBlock(), createBlock(ExportState, {
104
- key: 1,
105
- modelValue: showMapState.value,
106
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => ((showMapState).value = $event))
107
- }, null, 8 /* PROPS */, ["modelValue"]))
108
- : createCommentVNode("v-if", true),
109
- (__props.changeProjection && !!unref(availableMapProjection))
110
- ? withDirectives((openBlock(), createBlock(VBtn, {
111
- key: 2,
112
- class: "map-btn",
113
- icon: [unref(mdiEarthBox)],
114
- size: "small",
115
- onClick: _cache[2] || (_cache[2] = $event => (unref(changeMapProjection)(unref(availableMapProjection))))
116
- }, null, 8 /* PROPS */, ["icon"])), [
117
- [Tooltip, 'Change map projection', "bottom"]
118
- ])
119
- : createCommentVNode("v-if", true),
120
- (__props.compareIndicators)
121
- ? withDirectives((openBlock(), createBlock(VBtn, {
122
- key: 3,
123
- class: "map-btn",
124
- icon: [compareIcon.value],
125
- size: "small",
126
- onClick: onCompareClick
127
- }, null, 8 /* PROPS */, ["icon"])), [
128
- [Tooltip, 'Compare mode', "bottom"]
129
- ])
130
- : createCommentVNode("v-if", true),
131
- (__props.backToPOIs && (unref(poi) || unref(comparePoi)))
132
- ? withDirectives((openBlock(), createBlock(VBtn, {
133
- key: 4,
134
- class: "map-btn",
135
- icon: [unref(mdiStarFourPointsCircleOutline)],
136
- size: "small",
137
- onClick: _cache[3] || (_cache[3] = $event => (unref(loadPOiIndicator)()))
138
- }, null, 8 /* PROPS */, ["icon"])), [
139
- [Tooltip, 'back to POIs', "bottom"]
140
- ])
141
- : createCommentVNode("v-if", true),
142
- createVNode(_sfc_main$1, {
143
- modelValue: showCompareIndicators.value,
144
- "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ((showCompareIndicators).value = $event)),
145
- maxWidth: popupWidth.value,
146
- width: popupWidth.value,
147
- "max-height": popupHeight.value,
148
- height: popupHeight.value
149
- }, {
150
- default: withCtx(() => [
151
- createVNode(EodashItemFilter, {
152
- enableCompare: true,
153
- enableHighlighting: false,
154
- resultType: "cards",
155
- style: {"--select-filter-max-items":"8"},
156
- "filters-title": "Select an indicator to compare",
157
- subTitleProperty: "subtitle",
158
- imageProperty: "thumbnail",
159
- aggregateResults: "collection_group",
160
- "results-title": "",
161
- onSelect: onSelectCompareIndicator
162
- })
163
- ]),
164
- _: 1 /* STABLE */
165
- }, 8 /* PROPS */, ["modelValue", "maxWidth", "width", "max-height", "height"])
166
- ], 512 /* NEED_PATCH */))
167
- }
168
- }
169
-
170
- };
171
- const EodashMapBtns = /*#__PURE__*/_export_sfc(_sfc_main, [['styles',[_style_0]],['__scopeId',"data-v-771740c6"]]);
172
-
173
- export { EodashMapBtns as default };