@eodash/eodash 5.0.0-rc.1 → 5.0.0-rc.1.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 (89) hide show
  1. package/README.md +1 -1
  2. package/core/client/composables/EodashMap.js +19 -5
  3. package/core/client/composables/EodashProcess.js +51 -5
  4. package/core/client/eodash.js +8 -7
  5. package/core/client/eodashSTAC/EodashCollection.js +16 -0
  6. package/core/client/eodashSTAC/createLayers.js +61 -4
  7. package/core/client/eodashSTAC/helpers.js +39 -4
  8. package/core/client/types.ts +7 -0
  9. package/core/client/utils/states.js +3 -0
  10. package/dist/client/{DashboardLayout-FS5inBIm.js → DashboardLayout-SZfMDUoR.js} +2 -2
  11. package/dist/client/{DynamicWebComponent-CBSgT677.js → DynamicWebComponent-I9gzMY0L.js} +1 -1
  12. package/dist/client/EodashDatePicker-B9_u6TTm.js +405 -0
  13. package/dist/client/{EodashItemFilter-CFNKjm_Z.js → EodashItemFilter-G7YsYO3B.js} +1 -1
  14. package/dist/client/{EodashLayerControl-CzffoPUs.js → EodashLayerControl-CJ94ul63.js} +10 -2
  15. package/dist/client/{EodashLayoutSwitcher-DM0zDhvI.js → EodashLayoutSwitcher-DRKm8A8U.js} +2 -2
  16. package/dist/client/{EodashMap-BdFZ657e.js → EodashMap-Dp44Ajbi.js} +60 -10
  17. package/dist/client/{EodashMapBtns-rC_IPD-Z.js → EodashMapBtns-BlPFwhPc.js} +4 -4
  18. package/dist/client/{EodashProcess-SLsTISKV.js → EodashProcess-BLmIgUGT.js} +158 -25
  19. package/dist/client/{EodashStacInfo-DFD0gtWm.js → EodashStacInfo-BIRcfcMo.js} +1 -1
  20. package/dist/client/{EodashTools-ImohD2ys.js → EodashTools-PNfJ-Cw3.js} +4 -4
  21. package/dist/client/{ExportState-LNZAovzM.js → ExportState-5JyTshJH.js} +4 -4
  22. package/dist/client/{Footer-c19dV1ZR.js → Footer-CM9hgdQP.js} +1 -1
  23. package/dist/client/{Header-CcvXFqqt.js → Header-BTq4DW1x.js} +3 -3
  24. package/dist/client/{MobileLayout-OM6Wc-vj.js → MobileLayout-Atfoxf8d.js} +5 -5
  25. package/dist/client/{PopUp-B0_c0207.js → PopUp-Bmfn3N_4.js} +3 -3
  26. package/dist/client/{VImg-BpDhCbL0.js → VImg-CUF4S39i.js} +2 -2
  27. package/dist/client/{VMain-DC05bDwX.js → VMain-CQpXnzDR.js} +1 -1
  28. package/dist/client/{VOverlay-C7EUyVe_.js → VOverlay-DUnITwM1.js} +3 -3
  29. package/dist/client/{VTooltip-C78suika.js → VTooltip-BYTlbKer.js} +3 -3
  30. package/dist/client/{WidgetsContainer-sD1vDnhF.js → WidgetsContainer-BPbgxdb0.js} +1 -1
  31. package/dist/client/{asWebComponent-D8bMMCEr.js → asWebComponent-DW1XzZkL.js} +138 -27
  32. package/dist/client/eo-dash.css +1 -1
  33. package/dist/client/eo-dash.js +1 -1
  34. package/dist/client/{forwardRefs-yw6tFXER.js → forwardRefs-gx1Fzngc.js} +1 -1
  35. package/dist/client/{index-CpK_Yaom.js → index-DvFppNyk.js} +1 -1
  36. package/dist/client/{transition-B2YwqAYJ.js → transition-j2eWJYMg.js} +1 -1
  37. package/dist/types/core/client/App.vue.d.ts +7 -0
  38. package/dist/types/core/client/asWebComponent.d.ts +9 -0
  39. package/dist/types/core/client/components/DashboardLayout.vue.d.ts +2 -0
  40. package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +20 -0
  41. package/dist/types/core/client/components/ErrorAlert.vue.d.ts +2 -0
  42. package/dist/types/core/client/components/Footer.vue.d.ts +106 -0
  43. package/dist/types/core/client/components/Header.vue.d.ts +2 -0
  44. package/dist/types/core/client/components/IframeWrapper.vue.d.ts +7 -0
  45. package/dist/types/core/client/components/Loading.vue.d.ts +2 -0
  46. package/dist/types/core/client/components/MobileLayout.vue.d.ts +312 -0
  47. package/dist/types/core/client/composables/DefineEodash.d.ts +2 -0
  48. package/dist/types/core/client/composables/DefineTemplate.d.ts +15 -0
  49. package/dist/types/core/client/composables/DefineWidgets.d.ts +14 -0
  50. package/dist/types/core/client/composables/EodashMap.d.ts +6 -0
  51. package/dist/types/core/client/composables/EodashProcess.d.ts +162 -0
  52. package/dist/types/core/client/composables/index.d.ts +9 -0
  53. package/dist/types/core/client/eodash.d.ts +8 -0
  54. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +113 -0
  55. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +45 -0
  56. package/dist/types/core/client/eodashSTAC/helpers.d.ts +135 -0
  57. package/dist/types/core/client/eodashSTAC/triggers.d.ts +1 -0
  58. package/dist/types/core/client/main.d.ts +2 -0
  59. package/dist/types/core/client/plugins/axios.d.ts +2 -0
  60. package/dist/types/core/client/plugins/index.d.ts +3 -0
  61. package/dist/types/core/client/plugins/vuetify.d.ts +82 -0
  62. package/dist/types/core/client/render.d.ts +1 -0
  63. package/dist/types/core/client/store/actions.d.ts +12 -0
  64. package/dist/types/core/client/store/index.d.ts +11 -0
  65. package/dist/types/core/client/store/stac.d.ts +25 -0
  66. package/dist/types/core/client/store/states.d.ts +22 -0
  67. package/dist/types/core/client/types.d.ts +279 -0
  68. package/dist/types/core/client/utils/index.d.ts +2 -0
  69. package/dist/types/core/client/utils/keys.d.ts +8 -0
  70. package/dist/types/core/client/utils/states.d.ts +20 -0
  71. package/dist/types/core/client/views/Dashboard.vue.d.ts +9 -0
  72. package/dist/types/widgets/EodashDatePicker.vue.d.ts +15 -0
  73. package/dist/types/widgets/EodashItemFilter.vue.d.ts +44 -0
  74. package/dist/types/widgets/EodashLayerControl.vue.d.ts +13 -0
  75. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +11 -0
  76. package/dist/types/widgets/EodashMap.vue.d.ts +14 -0
  77. package/dist/types/widgets/EodashMapBtns.vue.d.ts +13 -0
  78. package/dist/types/widgets/EodashProcess.vue.d.ts +4 -0
  79. package/dist/types/widgets/EodashStacInfo.vue.d.ts +21 -0
  80. package/dist/types/widgets/EodashTools.vue.d.ts +19 -0
  81. package/dist/types/widgets/ExportState.vue.d.ts +7 -0
  82. package/dist/types/widgets/PopUp.vue.d.ts +27 -0
  83. package/dist/types/widgets/WidgetsContainer.vue.d.ts +10 -0
  84. package/package.json +11 -11
  85. package/widgets/EodashDatePicker.vue +89 -6
  86. package/widgets/EodashLayerControl.vue +13 -1
  87. package/widgets/EodashMap.vue +51 -5
  88. package/widgets/EodashProcess.vue +57 -11
  89. package/dist/client/EodashDatePicker-BGSS2ZYK.js +0 -306
@@ -8,34 +8,98 @@
8
8
  class="bg-surface overflow-auto"
9
9
  style="background-color: transparent; max-width: 100%"
10
10
  >
11
- <template #footer>
12
- <div class="d-flex flex-row align-center justify-center pb-1">
11
+ <template v-if="toggleCalendar" #default="{ inputValue, inputEvents }">
12
+ <div
13
+ class="bg-surface d-flex flex-row align-center justify-center pb-1"
14
+ style="overflow: hidden; width: 100%"
15
+ >
13
16
  <v-btn
14
17
  v-if="!hideArrows"
15
18
  density="compact"
19
+ :size="lgAndDown ? 'x-small' : 'large'"
16
20
  v-tooltip:bottom="'Set date to oldest available dataset'"
17
21
  variant="text"
18
22
  @click="jumpDate(true)"
23
+ class="py-2"
24
+ style="flex-shrink: 1"
19
25
  >
20
26
  <v-icon :icon="[mdiRayEndArrow]" />
21
27
  </v-btn>
22
28
  <div
23
29
  class="flex rounded-lg border border-gray-300 dark:border-gray-600"
24
- style="margin: 2px"
30
+ style="margin: 2px; min-width: 0"
31
+ >
32
+ <input
33
+ v-if="!hideInputField"
34
+ :value="inputValue"
35
+ v-on="inputEvents"
36
+ class="flex-grow px-1 py-1 dark:bg-gray-700"
37
+ style="
38
+ margin: 1px;
39
+ width: 100%;
40
+ white-space: nowrap;
41
+ overflow: hidden;
42
+ text-overflow: ellipsis;
43
+ "
44
+ />
45
+ </div>
46
+ <v-btn
47
+ v-if="!hideArrows"
48
+ density="compact"
49
+ :size="lgAndDown ? 'x-small' : 'large'"
50
+ variant="text"
51
+ v-tooltip:bottom="'Set date to latest available dataset'"
52
+ @click="jumpDate(false)"
53
+ class="py-2"
54
+ style="flex-shrink: 1"
55
+ >
56
+ <v-icon :icon="[mdiRayStartArrow]" />
57
+ </v-btn>
58
+ </div>
59
+ </template>
60
+ <template v-else #footer>
61
+ <div
62
+ class="d-flex flex-row align-center justify-center pb-1"
63
+ style="overflow: hidden; width: 100%"
64
+ >
65
+ <v-btn
66
+ v-if="!hideArrows"
67
+ density="compact"
68
+ :size="lgAndDown ? 'x-small' : 'large'"
69
+ v-tooltip:bottom="'Set date to oldest available dataset'"
70
+ variant="text"
71
+ @click="jumpDate(true)"
72
+ class="py-2"
73
+ style="flex-shrink: 1"
74
+ >
75
+ <v-icon :icon="[mdiRayEndArrow]" />
76
+ </v-btn>
77
+ <div
78
+ class="flex rounded-lg border border-gray-300 dark:border-gray-600"
79
+ style="margin: 2px; min-width: 0"
25
80
  >
26
81
  <input
27
82
  v-if="!hideInputField"
28
83
  :value="new Date(currentDate).toLocaleDateString()"
29
- style="margin: 1px"
30
84
  class="flex-grow px-1 py-1 dark:bg-gray-700"
85
+ style="
86
+ margin: 1px;
87
+ width: 100%;
88
+ white-space: nowrap;
89
+ overflow: hidden;
90
+ text-overflow: ellipsis;
91
+ "
31
92
  />
32
93
  </div>
33
94
  <v-btn
34
95
  v-if="!hideArrows"
35
96
  density="compact"
97
+ :size="lgAndDown ? 'x-small' : 'large'"
36
98
  variant="text"
37
99
  v-tooltip:bottom="'Set date to latest available dataset'"
38
100
  @click="jumpDate(false)"
101
+ class="py-2"
102
+ style="flex-shrink: 1"
39
103
  >
40
104
  <v-icon :icon="[mdiRayStartArrow]" />
41
105
  </v-btn>
@@ -46,8 +110,9 @@
46
110
  </template>
47
111
  <script setup>
48
112
  import { DatePicker as VCDatePicker } from "v-calendar";
113
+ import { useDisplay } from "vuetify";
49
114
  import "v-calendar/style.css";
50
- import { watch, reactive, ref, customRef, toRef } from "vue";
115
+ import { watch, reactive, ref, customRef, toRef, onMounted } from "vue";
51
116
  import { useSTAcStore } from "@/store/stac";
52
117
  import { datetime } from "@/store/states";
53
118
  import { mdiRayStartArrow, mdiRayEndArrow } from "@mdi/js";
@@ -55,6 +120,8 @@ import { eodashCollections } from "@/utils/states";
55
120
  import log from "loglevel";
56
121
  import { makePanelTransparent } from "@/composables";
57
122
 
123
+ const { lgAndDown } = useDisplay();
124
+
58
125
  // holds the number value of the datetime
59
126
  const currentDate = customRef((track, trigger) => ({
60
127
  get() {
@@ -86,6 +153,10 @@ defineProps({
86
153
  type: Boolean,
87
154
  default: false,
88
155
  },
156
+ toggleCalendar: {
157
+ type: Boolean,
158
+ default: false,
159
+ },
89
160
  });
90
161
 
91
162
  /**
@@ -137,7 +208,7 @@ watch(
137
208
  ];
138
209
  attributes.push({
139
210
  key: "id-" + idx.toString() + Math.random().toString(16).slice(2),
140
- bar: {
211
+ dot: {
141
212
  style: {
142
213
  backgroundColor: wongPalette[idx % wongPalette.length],
143
214
  },
@@ -182,6 +253,14 @@ function jumpDate(reverse) {
182
253
  }
183
254
  }
184
255
 
256
+ // fixes calendar dispalcement on lib mode
257
+ const transform = ref("");
258
+ onMounted(() => {
259
+ transform.value = document.querySelector("eo-dash")
260
+ ? "translate3d(50px,-80px,0)"
261
+ : "translate3d(0px,-80px,0)";
262
+ });
263
+
185
264
  makePanelTransparent(rootRef);
186
265
  </script>
187
266
  <style>
@@ -200,4 +279,8 @@ makePanelTransparent(rootRef);
200
279
  .vc-highlight-content-solid {
201
280
  color: white !important;
202
281
  }
282
+
283
+ .vc-popover-content-wrapper {
284
+ transform: v-bind("transform") !important;
285
+ }
203
286
  </style>
@@ -9,6 +9,7 @@
9
9
  toolsAsList="true"
10
10
  style="--eox-background-color: transparent"
11
11
  ref="eoxLayercontrol"
12
+ @layerConfig:change="onLayerConfigChange"
12
13
  />
13
14
  </span>
14
15
  </template>
@@ -22,7 +23,11 @@ import "color-legend-element";
22
23
  import { computed, ref } from "vue";
23
24
  import { mapEl, mapCompareEl } from "@/store/states";
24
25
  import { getColFromLayer } from "@/eodashSTAC/helpers";
25
- import { eodashCollections, eodashCompareCollections } from "@/utils/states";
26
+ import {
27
+ eodashCollections,
28
+ eodashCompareCollections,
29
+ layerControlFormValue,
30
+ } from "@/utils/states";
26
31
  import { storeToRefs } from "pinia";
27
32
  import { useSTAcStore } from "@/store/stac";
28
33
 
@@ -108,4 +113,11 @@ const debouncedHandleDateTime = (evt) => {
108
113
  }, 500);
109
114
  };
110
115
  // ------
116
+ /**
117
+ *
118
+ * @param {Event & {detail:{layer:import("ol/layer").Layer;jsonformValue:Record<string,any>}}} evt
119
+ */
120
+ const onLayerConfigChange = (evt) => {
121
+ layerControlFormValue.value = evt.detail.jsonformValue;
122
+ };
111
123
  </script>
@@ -12,7 +12,12 @@
12
12
  .center="initialCenter"
13
13
  .zoom="initialZoom"
14
14
  .layers="eoxMapLayers"
15
- />
15
+ >
16
+ <eox-map-tooltip
17
+ v-show="tooltipProperties?.length"
18
+ .propertyTransform="tooltipPropertyTransform"
19
+ />
20
+ </eox-map>
16
21
  <eox-map
17
22
  class="fill-height fill-width overflow-none"
18
23
  id="compare"
@@ -29,9 +34,19 @@ import { computed, onMounted, ref, toRaw } from "vue";
29
34
  import { datetime, mapEl, mapPosition, mapCompareEl } from "@/store/states";
30
35
  import { storeToRefs } from "pinia";
31
36
  import { useSTAcStore } from "@/store/stac";
32
- import { eodashCollections, eodashCompareCollections } from "@/utils/states";
33
- import { useHandleMapMoveEnd, useInitMap } from "@/composables/EodashMap";
37
+ import {
38
+ eodashCollections,
39
+ eodashCompareCollections,
40
+ layerControlFormValue,
41
+ } from "@/utils/states";
42
+ import {
43
+ useHandleMapMoveEnd,
44
+ useInitMap,
45
+ useUpdateTooltipProperties,
46
+ } from "@/composables/EodashMap";
34
47
  import { inAndOut } from "ol/easing.js";
48
+ import mustache from "mustache";
49
+
35
50
  const props = defineProps({
36
51
  enableCompare: {
37
52
  type: Boolean,
@@ -48,6 +63,8 @@ const props = defineProps({
48
63
  default: 4,
49
64
  },
50
65
  });
66
+ /** @type {import("vue").Ref<import("@/types").EodashStyleJson["tooltip"]>} */
67
+ const tooltipProperties = ref([]);
51
68
 
52
69
  const initialCenter = toRaw([
53
70
  mapPosition.value?.[0] ?? props.center?.[0],
@@ -83,9 +100,9 @@ const animationOptions = {
83
100
  easing: inAndOut,
84
101
  };
85
102
 
86
- /** @type {import("vue").Ref<(HTMLElement & Record<string,any> & { map:import("ol").Map }) | null>} */
103
+ /** @type {import("vue").Ref<import("@eox/map").EOxMap | null>} */
87
104
  const eoxMap = ref(null);
88
- /** @type {import("vue").Ref<(HTMLElement & Record<string,any> & { map:import("ol").Map }) | null>} */
105
+ /** @type {import("vue").Ref<import("@eox/map").EOxMap | null>} */
89
106
  const compareMap = ref(null);
90
107
  const { selectedCompareStac } = storeToRefs(useSTAcStore());
91
108
  const showCompare = computed(() =>
@@ -125,4 +142,33 @@ onMounted(() => {
125
142
  compareMap,
126
143
  );
127
144
  });
145
+ useUpdateTooltipProperties(eodashCollections, tooltipProperties);
146
+ /**
147
+ * @param {{key:string; value:string}} param
148
+ * @returns {{key:string; value?:string} | undefined}
149
+ */
150
+ const tooltipPropertyTransform = (param) => {
151
+ /** @type {typeof tooltipProperties.value} */
152
+ const updatedProperties = JSON.parse(
153
+ mustache.render(JSON.stringify(tooltipProperties.value), {
154
+ ...(layerControlFormValue.value ?? {}),
155
+ }),
156
+ );
157
+
158
+ const tooltipProp = updatedProperties?.find((prop) => prop.id === param.key);
159
+ if (!tooltipProp) {
160
+ return undefined;
161
+ }
162
+ if (typeof param.value === "object") {
163
+ param.value = JSON.stringify(param.value);
164
+ }
165
+ if (!isNaN(Number(param.value))) {
166
+ param.value = Number(param.value).toFixed(4).toString();
167
+ }
168
+
169
+ return {
170
+ key: tooltipProp.title || tooltipProp.id,
171
+ value: param.value + " " + (tooltipProp.appendix || ""),
172
+ };
173
+ };
128
174
  </script>
@@ -11,17 +11,26 @@
11
11
  .spec="toRaw(chartSpec)"
12
12
  .dataValues="toRaw(chartData)"
13
13
  />
14
- <span>
15
- <v-btn
16
- v-if="!autoExec"
17
- :loading="loading"
18
- style="float: right; margin-right: 20px"
19
- @click="startProcess"
20
- color="primary"
21
- >
22
- Execute
23
- </v-btn>
24
- </span>
14
+ <v-container>
15
+ <span>
16
+ <v-btn
17
+ v-if="!autoExec"
18
+ :loading="loading"
19
+ style="float: right; margin-right: 20px"
20
+ @click="startProcess"
21
+ color="primary"
22
+ >
23
+ Execute
24
+ </v-btn>
25
+ <v-btn
26
+ v-if="processResults.length && isProcessed"
27
+ color="primary"
28
+ @click="downloadResults"
29
+ >
30
+ Download
31
+ </v-btn>
32
+ </span>
33
+ </v-container>
25
34
  </div>
26
35
  </template>
27
36
  <script setup>
@@ -62,7 +71,39 @@ const loading = ref(false);
62
71
  const autoExec = ref(false);
63
72
 
64
73
  const isPolling = ref(false);
74
+ /** @type {import("vue").Ref<any[]>} */
75
+ const processResults = ref([]);
65
76
 
77
+ const downloadResults = () => {
78
+ processResults.value.forEach((result) => {
79
+ if (!result) {
80
+ return;
81
+ }
82
+ let url = "";
83
+ let downloadFile = "";
84
+ if (typeof result === "string") {
85
+ url = result;
86
+ //@ts-expect-error TODO
87
+ downloadFile = url.includes("/") ? url.split("/").pop() : url;
88
+ downloadFile = downloadFile.includes("?")
89
+ ? downloadFile.split("?")[0]
90
+ : downloadFile;
91
+ } else {
92
+ result = JSON.stringify(result);
93
+ const blob = new Blob([result], { type: "text" });
94
+ url = URL.createObjectURL(blob);
95
+ downloadFile = selectedStac.value?.id + "_process_results.json";
96
+ }
97
+ const link = document.createElement("a");
98
+ if (confirm(`Would you like to download ${downloadFile}?`)) {
99
+ link.href = url;
100
+ link.download = downloadFile;
101
+ link.click();
102
+ }
103
+ URL.revokeObjectURL(url);
104
+ link.remove();
105
+ });
106
+ };
66
107
  onMounted(async () => {
67
108
  // wait for the layers to be rendered
68
109
  if (mapEl.value?.layers.length <= 1) {
@@ -75,6 +116,7 @@ onMounted(async () => {
75
116
  chartSpec,
76
117
  isProcessed,
77
118
  loading,
119
+ processResults,
78
120
  isPolling,
79
121
  });
80
122
  });
@@ -86,6 +128,7 @@ onMounted(async () => {
86
128
  jsonformSchema,
87
129
  chartSpec,
88
130
  isProcessed,
131
+ processResults,
89
132
  loading,
90
133
  isPolling,
91
134
  });
@@ -101,6 +144,7 @@ useOnLayersUpdate(
101
144
  jsonformSchema,
102
145
  chartSpec,
103
146
  isProcessed,
147
+ processResults,
104
148
  loading,
105
149
  isPolling,
106
150
  }),
@@ -112,6 +156,7 @@ const startProcess = async () => {
112
156
  console.warn("[eodash] Form validation failed", errors);
113
157
  return;
114
158
  }
159
+ processResults.value = [];
115
160
  await handleProcesses({
116
161
  jsonformEl,
117
162
  jsonformSchema,
@@ -122,6 +167,7 @@ const startProcess = async () => {
122
167
  selectedStac,
123
168
  isProcessed,
124
169
  isPolling,
170
+ processResults,
125
171
  });
126
172
  isProcessed.value = true;
127
173
  };