@eodash/eodash 5.0.0-alpha.2.5 → 5.0.0-alpha.2.6

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 (73) hide show
  1. package/README.md +19 -5
  2. package/core/client/App.vue +6 -7
  3. package/core/client/SuspensedDashboard.ce.vue +58 -40
  4. package/core/client/asWebComponent.d.ts +10 -5
  5. package/core/client/asWebComponent.js +6 -6
  6. package/core/client/components/DashboardLayout.vue +35 -16
  7. package/core/client/components/DynamicWebComponent.vue +44 -44
  8. package/core/client/components/ErrorAlert.vue +19 -7
  9. package/core/client/components/Footer.vue +28 -14
  10. package/core/client/components/Header.vue +4 -4
  11. package/core/client/components/IframeWrapper.vue +3 -3
  12. package/core/client/components/Loading.vue +17 -18
  13. package/core/client/components/MobileLayout.vue +48 -26
  14. package/core/client/composables/DefineEodash.js +38 -29
  15. package/core/client/composables/DefineWidgets.js +101 -81
  16. package/core/client/composables/index.js +32 -29
  17. package/core/client/eodash.js +44 -39
  18. package/core/client/main.js +2 -2
  19. package/core/client/plugins/index.js +9 -10
  20. package/core/client/plugins/vuetify.js +9 -10
  21. package/core/client/render.js +4 -5
  22. package/core/client/store/States.js +8 -13
  23. package/core/client/store/index.js +14 -11
  24. package/core/client/store/stac.js +51 -37
  25. package/core/client/types.d.ts +169 -201
  26. package/core/client/utils/eodashSTAC.js +130 -49
  27. package/core/client/utils/helpers.js +18 -20
  28. package/core/client/utils/index.js +17 -10
  29. package/core/client/utils/keys.js +2 -2
  30. package/core/client/views/Dashboard.vue +53 -36
  31. package/core/client/vite-env.d.ts +19 -17
  32. package/dist/client/{DashboardLayout-BYROtP-7.js → DashboardLayout-BuDcv6LM.js} +9 -9
  33. package/dist/client/{DynamicWebComponent-BQhxFPM0.js → DynamicWebComponent-BEP4rVce.js} +2 -2
  34. package/dist/client/EodashDatePicker-oFb1zt5E.js +1211 -0
  35. package/dist/client/{EodashItemFilter-DIBDAHcc.js → EodashItemFilter-BElmgrST.js} +4 -6
  36. package/dist/client/{EodashMap-C6jJ2Lb_.js → EodashMap-DXyOgcEd.js} +13131 -14490
  37. package/dist/client/{Footer-BVIZms1S.js → Footer-CoPx6UXQ.js} +3 -3
  38. package/dist/client/{Header-TsTL1d2R.js → Header-C-zX31Ys.js} +169 -167
  39. package/dist/client/{IframeWrapper-XKChM78a.js → IframeWrapper-2w2ye0zM.js} +1 -1
  40. package/dist/client/{MobileLayout-BlGcMQra.js → MobileLayout-C9OVcP12.js} +45 -57
  41. package/dist/client/{VMain-C9XV5Lyg.js → VMain-Dm43jd43.js} +2 -2
  42. package/dist/client/{WidgetsContainer-BQXHnZpa.js → WidgetsContainer-BS87sLqk.js} +10 -3
  43. package/dist/client/{asWebComponent-CbdGxelK.js → asWebComponent-CpQUVi2N.js} +5508 -5561
  44. package/dist/client/{basedecoder-Qm25PwVp-CHo5Pomv.js → basedecoder-DHcBySSe-BmCFNFnw.js} +5 -6
  45. package/dist/client/{decoder-HRvnjnEI-CHAYOWhz.js → decoder-CP4lv0Kb-BHrv68IA.js} +1 -1
  46. package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +10 -0
  47. package/dist/client/eo-dash.js +3 -3
  48. package/dist/client/eodashSTAC-Q7kbX1Gy.js +2788 -0
  49. package/dist/client/{eox-itemfilter-DcQkRD2l.js → eox-itemfilter-TaBxgqq_.js} +1002 -974
  50. package/dist/client/{eox-map-C3DL31fp.js → eox-map-L7abwKTR.js} +5677 -5695
  51. package/dist/client/{forwardRefs-CyCJOFsz.js → forwardRefs-BVFQ82G4.js} +12 -21
  52. package/dist/client/{index-CabQjjQg.js → index-dOzyv_xR.js} +1 -1
  53. package/dist/client/{jpeg-DNfUpLwy-Fjan-04T.js → jpeg-BAgeD1d3-oeHbFPUL.js} +5 -6
  54. package/dist/client/{lerc-_E46UbWQ-TxBH4OeK.js → lerc-DzVumYtB-rm1Xco54.js} +5 -7
  55. package/dist/client/{lzw-BOMhmEDy-Dboc93VO.js → lzw-LAGDNbSC-DkP96qO9.js} +1 -1
  56. package/dist/client/{packbits-DaUD6MLm-Bu1PoTGa.js → packbits-BlDR4Kj5-C66n1-zr.js} +1 -1
  57. package/dist/client/{pako.esm-C3kYPGGQ-BMki8cQY.js → pako.esm-CB1uQYY0-DB0PYm1P.js} +6 -12
  58. package/dist/client/{raw-CcGKjn8q-DFOt-i8n.js → raw-CMGvRjfu-BRi6E4i1.js} +1 -1
  59. package/dist/client/{ssrBoot-DWJ-z4I-.js → ssrBoot-L9KejErM.js} +1 -1
  60. package/dist/client/style.css +2 -2
  61. package/dist/client/{transition-BlLt41wg.js → transition-DCePIwYR.js} +1 -1
  62. package/dist/client/{webfontloader-CyOFAuFB.js → webfontloader-qotgY98I.js} +56 -92
  63. package/dist/client/{webimage-D2c098k3-DLj1LQxB.js → webimage-BM_pbLN3-L2cGWK5l.js} +1 -1
  64. package/dist/node/cli.js +1 -1
  65. package/dist/node/types.d.ts +32 -38
  66. package/package.json +11 -11
  67. package/widgets/EodashDatePicker.vue +94 -43
  68. package/widgets/EodashItemFilter.vue +13 -10
  69. package/widgets/EodashMap.vue +87 -20
  70. package/widgets/WidgetsContainer.vue +45 -27
  71. package/dist/client/EodashDatePicker-CFltnt5d.js +0 -1194
  72. package/dist/client/deflate-Be2Arps5-hDqMz3RA.js +0 -10
  73. package/dist/client/http-ZWiLaAeR.js +0 -1337
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <DynamicWebComponent :link="link" tag-name="eox-itemfilter" :properties="properties" :on-mounted="onMounted" />
2
+ <DynamicWebComponent
3
+ :link="link"
4
+ tag-name="eox-itemfilter"
5
+ :properties="properties"
6
+ :on-mounted="onMounted"
7
+ />
3
8
  </template>
4
9
  <script setup>
5
10
  import DynamicWebComponent from "@/components/DynamicWebComponent.vue";
@@ -31,10 +36,10 @@ const properties = {
31
36
  },
32
37
  };
33
38
 
34
- /** @type {import("@/types").WebComponentProps["onMounted"]}*/
39
+ /** @type {import("@/types").WebComponentProps["onMounted"]} */
35
40
  const onMounted = (el, store) => {
36
41
  /** @type {any} */ (el).style.height = "100%";
37
-
42
+
38
43
  const style = document.createElement("style");
39
44
  style.innerHTML = `
40
45
  section {
@@ -59,15 +64,13 @@ const onMounted = (el, store) => {
59
64
  /**
60
65
  * @typedef {object} Item
61
66
  * @property {string} href
62
- * */
67
+ */
63
68
  /** @type {any} */ (el).apply(
64
- // Only list child elements in list
65
- store.stac?.filter((item) => item.rel === "child")
66
- );
69
+ // Only list child elements in list
70
+ store.stac?.filter((item) => item.rel === "child"),
71
+ );
67
72
  /** @type {any} */ (el).config.onSelect =
68
- /**
69
- * @param {Item} item
70
- * */
73
+ /** @param {Item} item */
71
74
  async (item) => {
72
75
  console.log(item);
73
76
  await store.loadSelectedSTAC(item.href);
@@ -1,11 +1,16 @@
1
1
  <template>
2
- <DynamicWebComponent :link="link" tag-name="eox-map" :properties="properties" :on-mounted="onMounted"
3
- :on-unmounted="onUnmounted" />
2
+ <DynamicWebComponent
3
+ :link="link"
4
+ tag-name="eox-map"
5
+ :properties="properties"
6
+ :on-mounted="onMounted"
7
+ :on-unmounted="onUnmounted"
8
+ />
4
9
  </template>
5
10
  <script setup>
6
11
  import { inject, watch } from "vue";
7
12
  import { toAbsolute } from "stac-js/src/http.js";
8
- import { EodashCollection } from "@/utils/eodashSTAC";
13
+ import { EodashCollection, extractCollectionUrls } from "@/utils/eodashSTAC";
9
14
  import { eodashKey } from "@/utils/keys";
10
15
  import { datetime, mapPosition } from "@/store/States";
11
16
  import DynamicWebComponent from "@/components/DynamicWebComponent.vue";
@@ -14,26 +19,53 @@ import "@eox/map/dist/eox-map-advanced-layers-and-sources.js";
14
19
 
15
20
  const eodashConfig = /** @type {import("@/types").Eodash} */ inject(eodashKey);
16
21
 
17
- /** @type {Record<string,unknown>} */
22
+ /** @type {Record<string, unknown>} */
18
23
  const properties = {
19
24
  class: "fill-height fill-width overflow-none",
20
25
  center: [15, 48],
21
- layers: [{ type: "Tile", source: { type: "OSM" } }],
26
+ zoom: 4,
27
+ // TODO: we should probably introduce some way of defining
28
+ layers: [
29
+ {
30
+ type: "Vector",
31
+ source: {
32
+ type: "Vector",
33
+ url: "https://openlayers.org/data/vector/ecoregions.json",
34
+ format: "GeoJSON",
35
+ },
36
+ },
37
+ {
38
+ type: "Tile",
39
+ properties: {
40
+ id: "osm",
41
+ title: "Background",
42
+ },
43
+ source: {
44
+ type: "OSM",
45
+ },
46
+ },
47
+ ],
22
48
  };
23
49
  // Check if selected indicator was already set in store
24
50
  if (mapPosition && mapPosition.value && mapPosition.value.length === 3) {
25
51
  // TODO: do further checks for invalid values?
52
+ // TODO: can we expect the values to be in a specific projection
26
53
  properties.center = [mapPosition.value?.[0], mapPosition.value[1]];
27
54
  properties.zoom = mapPosition.value[2];
28
55
  }
29
56
 
30
57
  const link = () => import("@eox/map");
31
58
 
32
- /** @type {import("openlayers").EventsListenerFunctionType}*/
59
+ /** @type {import("openlayers").EventsListenerFunctionType} */
33
60
  const handleMoveEnd = (evt) => {
34
61
  const map = /** @type {import("openlayers").Map | undefined} */ (
35
- /** @type {*} */ (evt).map
62
+ /** @type {any} */ (evt).map
36
63
  );
64
+ /*
65
+ const currentProj = map?.getView().getProjection();
66
+ const transFunc = getTransform(currentProj?.getCode(), 'EPSG:4326');
67
+ const [x, y] = transFunc(map?.getView().getCenter() ?? [0, 0], undefined, undefined);
68
+ */
37
69
  const [x, y] = map?.getView().getCenter() ?? [0, 0];
38
70
  const z = map?.getView().getZoom();
39
71
  if (!Number.isNaN(x) && !Number.isNaN(y) && !Number.isNaN(z)) {
@@ -45,7 +77,6 @@ const handleMoveEnd = (evt) => {
45
77
  const onMounted = (el, store) => {
46
78
  /** @type {any} */
47
79
  (el)?.map?.on("moveend", handleMoveEnd);
48
-
49
80
  const { selectedStac } = storeToRefs(store);
50
81
 
51
82
  watch(
@@ -54,23 +85,59 @@ const onMounted = (el, store) => {
54
85
  if (updatedStac) {
55
86
  const parentCollUrl = toAbsolute(
56
87
  `./${updatedStac.id}/collection.json`,
57
- eodashConfig.stacEndpoint
58
- );
59
- const childCollUrl = toAbsolute(
60
- updatedStac.links[1].href,
61
- parentCollUrl
88
+ eodashConfig.stacEndpoint,
62
89
  );
63
- const eodash = new EodashCollection(childCollUrl);
64
- if (updatedTime) {
65
- /** @type {any} */ (el).layers = await eodash.createLayersJson(
66
- new Date(updatedTime)
90
+ const collectionUrls = extractCollectionUrls(
91
+ selectedStac.value,
92
+ parentCollUrl,
67
93
  );
68
- } else {
69
- /** @type {any} */ (el).layers = await eodash.createLayersJson();
94
+ /** @type {import("@/utils/eodashSTAC").EodashCollection[]} */
95
+ const eodashCollections = [];
96
+ collectionUrls.forEach((cu) => {
97
+ eodashCollections.push(new EodashCollection(cu));
98
+ });
99
+ const layersCollection = [];
100
+ for (let idx = 0; idx < eodashCollections.length; idx++) {
101
+ const ec = eodashCollections[idx];
102
+ let layers;
103
+ if (updatedTime) {
104
+ layers = await ec.createLayersJson(new Date(updatedTime));
105
+ } else {
106
+ layers = await ec.createLayersJson();
107
+ }
108
+ if (layers) {
109
+ layersCollection.push(...layers);
110
+ }
70
111
  }
112
+ // TODO: add base layers and overlays as defined in the top collection / indicator
113
+ // Probably best also to introduce background and overlay groups
114
+ // For now adding OSM as background
115
+ layersCollection.push({
116
+ type: "Tile",
117
+ properties: {
118
+ id: "osm",
119
+ title: "Background",
120
+ },
121
+ source: {
122
+ type: "OSM",
123
+ },
124
+ });
125
+
126
+ // TODO: we can check if the collection / indicator has a specific
127
+ // projection it wants to be displayed in the map we can register
128
+ // and set the attribute here, e.g. like following
129
+ /*
130
+ (el)?.registerProjection(
131
+ 'EPSG:3031','+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +type=crs'
132
+ );
133
+ (el)?.projection = "EPSG:3031";
134
+ */
135
+
136
+ /** @type {any} */
137
+ (el).layers = layersCollection;
71
138
  }
72
139
  },
73
- { immediate: true }
140
+ { immediate: true },
74
141
  );
75
142
  };
76
143
 
@@ -1,6 +1,12 @@
1
1
  <template>
2
- <details is="animated-details" v-for="mod, idx in importedWidgets" ref="detailsEls" :key="idx" class="overflow-auto"
3
- exclusive>
2
+ <details
3
+ is="animated-details"
4
+ v-for="(mod, idx) in importedWidgets"
5
+ ref="detailsEls"
6
+ :key="idx"
7
+ class="overflow-auto"
8
+ exclusive
9
+ >
4
10
  <summary ref="summaryEls">{{ mod.value.title }}</summary>
5
11
  <span :style="{ height: widgetHeight }" class="d-flex flex-column">
6
12
  <component :is="mod.value.component" v-bind="mod.value.props" />
@@ -8,41 +14,53 @@
8
14
  </details>
9
15
  </template>
10
16
  <script setup>
11
- import { useDefineWidgets } from '@/composables/DefineWidgets';
12
- import { nextTick, onMounted } from 'vue';
13
- import { ref } from 'vue';
14
- import { useLayout } from 'vuetify/lib/framework.mjs';
15
- import 'animated-details'
17
+ import { useDefineWidgets } from "@/composables/DefineWidgets";
18
+ import { nextTick, onMounted } from "vue";
19
+ import { ref } from "vue";
20
+ import { useLayout } from "vuetify/lib/framework.mjs";
21
+ import "animated-details";
16
22
 
17
23
  const props = defineProps({
18
24
  widgets: {
19
- /** @type {import('vue').PropType<Omit<import("@/types").Widget,'layout'>[]>} */
25
+ /**
26
+ * @type {import("vue").PropType<
27
+ * Omit<import("@/types").Widget, "layout">[]
28
+ * >}
29
+ */
20
30
  type: Array,
21
31
  required: true,
22
- }
23
- })
32
+ },
33
+ });
24
34
 
25
- const importedWidgets = useDefineWidgets(props.widgets)
35
+ const importedWidgets = useDefineWidgets(props.widgets);
26
36
 
27
37
  /**
28
- * details elements template ref
29
- * @type {import('vue').Ref<HTMLDetailsElement[]>}
30
- **/
31
- const detailsEls = ref([])
38
+ * Details elements template ref
39
+ *
40
+ * @type {import("vue").Ref<HTMLDetailsElement[]>}
41
+ */
42
+ const detailsEls = ref([]);
32
43
  /**
33
- * summary elements template ref
34
- * @type {import('vue').Ref<HTMLDetailsElement[]>}
35
- **/
36
- const summaryEls = ref([])
37
- const widgetHeight = ref('')
38
- const summariesHeights = ref(0)
44
+ * Summary elements template ref
45
+ *
46
+ * @type {import("vue").Ref<HTMLDetailsElement[]>}
47
+ */
48
+ const summaryEls = ref([]);
49
+ const widgetHeight = ref("");
50
+ const summariesHeights = ref(0);
39
51
 
40
-
41
- const { mainRect } = useLayout()
52
+ const { mainRect } = useLayout();
42
53
  onMounted(async () => {
43
54
  await nextTick(() => {
44
- summariesHeights.value = summaryEls.value.reduce((acc, el) => acc += el.clientHeight, 0)
45
- widgetHeight.value = ((detailsEls.value[0].parentElement?.scrollHeight ?? 0) - summariesHeights.value - mainRect.value['top']) + 'px'
46
- })
47
- })
55
+ summariesHeights.value = summaryEls.value.reduce(
56
+ (acc, el) => (acc += el.clientHeight),
57
+ 0,
58
+ );
59
+ widgetHeight.value =
60
+ (detailsEls.value[0].parentElement?.scrollHeight ?? 0) -
61
+ summariesHeights.value -
62
+ mainRect.value["top"] +
63
+ "px";
64
+ });
65
+ });
48
66
  </script>