@eodash/eodash 5.7.0 → 5.8.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 (119) hide show
  1. package/core/client/components/EodashOverlay.vue +27 -4
  2. package/core/client/composables/DefineEodash.js +0 -1
  3. package/core/client/composables/DefineWidgets.js +3 -1
  4. package/core/client/eodashSTAC/EodashCollection.js +87 -24
  5. package/core/client/eodashSTAC/cql.js +64 -0
  6. package/core/client/eodashSTAC/createLayers.js +353 -187
  7. package/core/client/eodashSTAC/helpers.js +694 -110
  8. package/core/client/eodashSTAC/mosaic.js +422 -0
  9. package/core/client/plugins/axios.js +31 -1
  10. package/core/client/store/actions.js +1 -1
  11. package/core/client/store/stac.js +54 -4
  12. package/core/client/store/states.js +20 -2
  13. package/core/client/types.ts +152 -28
  14. package/core/client/utils/bands-editor/exampleSchema.json +50 -50
  15. package/core/client/utils/states.js +10 -0
  16. package/dist/client/{DashboardLayout-kRsmsNW5.js → DashboardLayout-DEs4f_Vy.js} +2 -2
  17. package/dist/client/{DynamicWebComponent-CnKhYo0K.js → DynamicWebComponent-PvnV88BA.js} +1 -1
  18. package/dist/client/EodashChart-D-3AGKZY.js +260 -0
  19. package/dist/client/{EodashDatePicker-CMPDT-ce.js → EodashDatePicker-Dm_goZzs.js} +3 -3
  20. package/dist/client/{EodashItemFilter-BpdA8QQa.js → EodashItemFilter-CJy3zYzD.js} +2 -1
  21. package/dist/client/{EodashLayerControl-BHpDA4_0.js → EodashLayerControl-rL8UnpkA.js} +55 -33
  22. package/dist/client/{EodashLayoutSwitcher-B1fRUt7G.js → EodashLayoutSwitcher-ZRlESI9O.js} +3 -3
  23. package/dist/client/{EodashMapBtns-Cpned0tc.js → EodashMapBtns-CG7u2Aq8.js} +227 -112
  24. package/dist/client/EodashStacInfo-CJhhxthD.js +169 -0
  25. package/dist/client/{EodashTools-1zHz26gv.js → EodashTools-CWyK8QJT.js} +4 -4
  26. package/dist/client/{ExportState-DbOm8hBI.js → ExportState-BXhy5TOU.js} +20 -174
  27. package/dist/client/{Footer-BKg-VVkj.js → Footer-DZPvnhcT.js} +1 -1
  28. package/dist/client/{Header-DCrwCvmY.js → Header-CiGsDE_a.js} +2 -2
  29. package/dist/client/{MobileLayout-vWSHpluo.js → MobileLayout-BJHW7x5V.js} +2 -2
  30. package/dist/client/{PopUp-9uimfK49.js → PopUp-7_XnhvCc.js} +4 -168
  31. package/dist/client/{ProcessList-CTTIZa06.js → ProcessList-LL_UCbvc.js} +5 -5
  32. package/dist/client/VDivider-DWYM0WUr.js +168 -0
  33. package/dist/client/{VImg-CrmB76ZY.js → VImg-B75dgw2K.js} +2 -2
  34. package/dist/client/{VMain-OKZNpcEG.js → VMain-DvMmOL4f.js} +1 -1
  35. package/dist/client/{VTooltip-CJw2FyWk.js → VTooltip-ClWHUmWL.js} +2 -2
  36. package/dist/client/{WidgetsContainer-BaWOnE5R.js → WidgetsContainer-BqaWs4ch.js} +1 -1
  37. package/dist/client/{asWebComponent-BHWpMuE3.js → asWebComponent-IZanwL-A.js} +677 -379
  38. package/dist/client/{async-DSKj6g1f.js → async-CiNIOBVz.js} +31 -29
  39. package/dist/client/{create-layers-config-CBoYedqB.js → create-layers-config-3S3y_kZg.js} +17 -17
  40. package/dist/client/dialog-transition-c4ZSnzac.js +170 -0
  41. package/dist/client/eo-dash.js +1 -1
  42. package/dist/client/{forwardRefs-DH51zPUr.js → forwardRefs-B-c1_6yo.js} +8 -87
  43. package/dist/client/{handling-BrcDDlgS.js → handling-NvY8Csry.js} +3 -4
  44. package/dist/client/{helpers-DjZVl_WF.js → helpers-BFuh19CP.js} +1094 -194
  45. package/dist/client/{index-1JKE68n3.js → index-1wMAyuNL.js} +219 -67
  46. package/dist/client/{index-CSG_JoOA.js → index-B8jGJSTA.js} +62 -56
  47. package/dist/client/{index-Cu3-13Xg.js → index-BKQQJkhy.js} +167 -61
  48. package/dist/client/index-D0jUyol8.js +3167 -0
  49. package/dist/client/{index-CUjl-ZsI.js → index-KGxz5Egv.js} +2 -2
  50. package/dist/client/mosaic-vHvSuih6.js +459 -0
  51. package/dist/client/templates.js +251 -121
  52. package/dist/client/{transition-OHcz5Qq1.js → transition-BkyUsZh_.js} +1 -1
  53. package/dist/node/cli.js +5 -5
  54. package/dist/node/types.d.ts +4 -0
  55. package/dist/types/core/client/composables/DefineEodash.d.ts +1 -1
  56. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +57 -25
  57. package/dist/types/core/client/eodashSTAC/cql.d.ts +15 -0
  58. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +42 -23
  59. package/dist/types/core/client/eodashSTAC/helpers.d.ts +118 -19
  60. package/dist/types/core/client/eodashSTAC/mosaic.d.ts +56 -0
  61. package/dist/types/core/client/store/stac.d.ts +38 -8
  62. package/dist/types/core/client/store/states.d.ts +24 -2
  63. package/dist/types/core/client/types.d.ts +128 -24
  64. package/dist/types/core/client/utils/states.d.ts +12 -0
  65. package/dist/types/templates/baseConfig.d.ts +1 -100
  66. package/dist/types/templates/compare.d.ts +32 -3
  67. package/dist/types/templates/expert.d.ts +18 -0
  68. package/dist/types/templates/explore.d.ts +10 -1
  69. package/dist/types/templates/lite.d.ts +11 -0
  70. package/dist/types/widgets/EodashChart.vue.d.ts +5 -3
  71. package/dist/types/widgets/EodashItemCatalog/index.vue.d.ts +129 -2
  72. package/dist/types/widgets/EodashItemCatalog/methods/filters.d.ts +28 -6
  73. package/dist/types/widgets/EodashItemCatalog/methods/handlers.d.ts +17 -4
  74. package/dist/types/widgets/EodashItemCatalog/methods/map.d.ts +16 -4
  75. package/dist/types/widgets/EodashLayerControl.vue.d.ts +35 -16
  76. package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +14 -10
  77. package/dist/types/widgets/EodashMap/index.vue.d.ts +86 -37
  78. package/dist/types/widgets/EodashMap/methods/create-layers-config.d.ts +1 -1
  79. package/dist/types/widgets/EodashMap/methods/index.d.ts +5 -1
  80. package/dist/types/widgets/EodashMap/methods/use-map-loading.d.ts +1 -0
  81. package/dist/types/widgets/EodashProcess/index.vue.d.ts +5 -3
  82. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +1 -1
  83. package/dist/types/widgets/EodashProcess/states.d.ts +1 -1
  84. package/dist/types/widgets/EodashStacInfo.vue.d.ts +20 -0
  85. package/dist/types/widgets/EodashTimeSlider/index.vue.d.ts +20 -0
  86. package/dist/types/widgets/EodashTimeSlider/methods/index.d.ts +3 -8
  87. package/dist/types/widgets/EodashTimeSlider/types.d.ts +6 -16
  88. package/dist/types/widgets/EodashTools.vue.d.ts +5 -5
  89. package/package.json +34 -34
  90. package/templates/baseConfig.js +37 -6
  91. package/templates/compare.js +61 -7
  92. package/templates/expert.js +24 -2
  93. package/templates/explore.js +12 -5
  94. package/templates/lite.js +13 -0
  95. package/widgets/EodashChart.vue +162 -21
  96. package/widgets/EodashItemCatalog/index.vue +363 -35
  97. package/widgets/EodashItemCatalog/methods/filters.js +134 -70
  98. package/widgets/EodashItemCatalog/methods/handlers.js +113 -19
  99. package/widgets/EodashItemCatalog/methods/map.js +141 -28
  100. package/widgets/EodashLayerControl.vue +51 -25
  101. package/widgets/EodashMap/EodashMapBtns.vue +109 -48
  102. package/widgets/EodashMap/index.vue +91 -105
  103. package/widgets/EodashMap/methods/btns.js +64 -31
  104. package/widgets/EodashMap/methods/create-layers-config.js +16 -16
  105. package/widgets/EodashMap/methods/index.js +71 -8
  106. package/widgets/EodashMap/methods/use-map-loading.js +58 -0
  107. package/widgets/EodashProcess/index.vue +136 -16
  108. package/widgets/EodashProcess/methods/composables.js +13 -0
  109. package/widgets/EodashProcess/methods/outputs.js +0 -1
  110. package/widgets/EodashProcess/methods/utils.js +29 -27
  111. package/widgets/EodashProcess/states.js +1 -1
  112. package/widgets/EodashStacInfo.vue +64 -2
  113. package/widgets/EodashTimeSlider/index.vue +58 -2
  114. package/widgets/EodashTimeSlider/methods/index.js +5 -48
  115. package/widgets/EodashTimeSlider/types.ts +7 -17
  116. package/widgets/ExportState.vue +13 -4
  117. package/dist/client/EodashChart-CLDqE93C.js +0 -144
  118. package/dist/client/EodashStacInfo-BQspAHKH.js +0 -107
  119. package/dist/client/index-5Jhsa8Xe.js +0 -570
@@ -1,6 +1,9 @@
1
1
  <template>
2
- <div ref="container">
3
- <div class="chart-frame">
2
+ <div ref="container" class="eodash-chart-wrapper">
3
+ <div
4
+ class="chart-frame"
5
+ :style="{ paddingBottom: hasBindings ? '25px' : '0px' }"
6
+ >
4
7
  <button
5
8
  v-if="usedChartData && usedChartSpec"
6
9
  class="chart-toggle"
@@ -12,9 +15,8 @@
12
15
  </svg>
13
16
  </button>
14
17
  <eox-chart
15
- class="pa-2"
16
- v-if="usedChartData && usedChartSpec"
17
- .spec="toRaw(usedChartSpec)"
18
+ v-if="usedChartData && renderedChartSpec"
19
+ .spec="toRaw(renderedChartSpec)"
18
20
  :key="chartRenderKey"
19
21
  .dataValues="toRaw(usedChartData)"
20
22
  @click:item="onChartClick"
@@ -33,6 +35,8 @@ import {
33
35
  ref,
34
36
  onMounted,
35
37
  onBeforeUnmount,
38
+ watch,
39
+ nextTick,
36
40
  } from "vue";
37
41
  import { onChartClick } from "./EodashProcess/methods/handling";
38
42
  import {
@@ -51,6 +55,7 @@ const { enableCompare, vegaEmbedOptions } = defineProps({
51
55
  default: false,
52
56
  },
53
57
  vegaEmbedOptions: {
58
+ /** @type {import("vue").PropType<import("vega-embed").EmbedOptions>} */
54
59
  type: Object,
55
60
  default() {
56
61
  return { actions: true };
@@ -66,27 +71,136 @@ const usedChartSpec = computed(() => {
66
71
  return enableCompare ? compareChartSpec.value : chartSpec.value;
67
72
  });
68
73
 
74
+ const hasBindings = computed(() => {
75
+ const spec = usedChartSpec.value;
76
+ if (!spec) return false;
77
+
78
+ // Recursively search for any object with a 'bind' key that represents a physical UI input
79
+ let found = false;
80
+ /** @param {any} obj */
81
+ const searchBindings = (obj) => {
82
+ if (found || !obj || typeof obj !== "object") return;
83
+
84
+ // UI bindings that take up physical DOM space are objects with an 'input' property.
85
+ if (
86
+ "bind" in obj &&
87
+ typeof obj.bind === "object" &&
88
+ obj.bind !== null &&
89
+ "input" in obj.bind
90
+ ) {
91
+ found = true;
92
+ return;
93
+ }
94
+ Object.values(obj).forEach(searchBindings);
95
+ };
96
+ searchBindings(spec);
97
+ return found;
98
+ });
99
+
100
+ const renderedChartSpec = ref(null);
101
+
102
+ watch(
103
+ usedChartSpec,
104
+ (newSpec) => {
105
+ if (!newSpec) {
106
+ renderedChartSpec.value = null;
107
+ return;
108
+ }
109
+
110
+ // Create a deep copy so we can safely mutate it
111
+ const adjustedSpec = JSON.parse(JSON.stringify(newSpec));
112
+
113
+ // Force the chart to be fully responsive to its CSS container
114
+ adjustedSpec.height = "container";
115
+ adjustedSpec.width = "container";
116
+
117
+ // Delay passing the spec to eox-chart until the next DOM update cycle.
118
+ // This ensures the dynamic chartStyles are physically applied
119
+ // to the container BEFORE Vega calculates its canvas size.
120
+ nextTick(() => {
121
+ renderedChartSpec.value = adjustedSpec;
122
+ chartRenderKey.value = Math.random(); // Force eox-chart to completely remount
123
+
124
+ // Force a browser-level resize event after the chart mounts.
125
+ // This tells Vega to re-read the container dimensions once the CSS has finished painting.
126
+ setTimeout(() => {
127
+ window.dispatchEvent(new Event("resize"));
128
+ }, 150);
129
+ });
130
+ },
131
+ { immediate: true },
132
+ );
133
+
69
134
  const chartRenderKey = ref(0);
70
- const frameHeight = ref(225);
71
135
  const containerEl = useTemplateRef("container");
72
136
 
73
- /**
74
- @type { MutationObserver | null}
75
- */
137
+ /** @type {MutationObserver | null} */
76
138
  let observer = null;
139
+ /** @type {number | null} */
140
+ let styleInterval = null;
77
141
 
78
142
  onMounted(() => {
79
143
  const el = containerEl.value;
80
144
  if (!el) return;
81
145
 
82
- const parent = el.parentElement?.parentElement;
83
- if (parent) {
84
- const parentHeight = parent.getBoundingClientRect().height;
85
- frameHeight.value = Math.max(225, Math.floor(parentHeight));
86
- }
146
+ // Continuously inject basic styling for the bindings form to make it look decent
147
+ styleInterval = window.setInterval(() => {
148
+ if (el) {
149
+ const eoxChart = el.querySelector("eox-chart");
150
+ if (eoxChart && eoxChart.shadowRoot) {
151
+ if (!eoxChart.shadowRoot.querySelector("#eodash-chart-styles")) {
152
+ const style = document.createElement("style");
153
+ style.id = "eodash-chart-styles";
154
+ style.innerHTML = `
155
+ * {
156
+ box-sizing: border-box !important;
157
+ }
158
+ #vis {
159
+ min-height: 100px !important;
160
+ flex: 1 1 auto !important;
161
+ }
162
+ :host, .vega-embed {
163
+ display: flex !important;
164
+ flex-direction: column !important;
165
+ height: 100% !important;
166
+ padding: 0 !important;
167
+ margin: 0 !important;
168
+ }
169
+ .vega-bindings {
170
+ flex: 0 0 auto !important;
171
+ display: flex !important;
172
+ flex-wrap: wrap;
173
+ gap: 2px !important;
174
+ background: rgba(255, 255, 255, 0.85);
175
+ padding: 6px 12px !important;
176
+ border-radius: 6px;
177
+ box-shadow: 0 2px 5px rgba(0,0,0,0.15);
178
+ margin: 0 !important;
179
+ margin-top: -10px !important;
180
+ z-index: 10;
181
+ }
182
+ .vega-bindings:empty {
183
+ display: none !important;
184
+ }
185
+ .vega-embed > canvas, .vega-embed > svg {
186
+ height: 100% !important;
187
+ max-width: 100% !important;
188
+ object-fit: contain;
189
+ }
190
+ .vega-bind {
191
+ display: flex;
192
+ align-items: center;
193
+ gap: 6px;
194
+ margin-bottom: 0 !important;
195
+ }
196
+ `;
197
+ eoxChart.shadowRoot.appendChild(style);
198
+ }
199
+ }
200
+ }
201
+ }, 200);
87
202
 
88
- // for mobile view, the overlay panel containing chart is initially hidden
89
- // we create an observer when display of overlay is not none anymore
203
+ // For mobile view, handle overlay display changes
90
204
  const overlay = getOverlayParent(el);
91
205
  if (!overlay) return;
92
206
 
@@ -94,7 +208,6 @@ onMounted(() => {
94
208
  const style = getComputedStyle(overlay);
95
209
  const visible = style.display !== "none";
96
210
  if (visible) {
97
- // forcibly rerender chart, otherwise size of canvas is 0
98
211
  chartRenderKey.value = Math.random();
99
212
  }
100
213
  });
@@ -107,13 +220,14 @@ onMounted(() => {
107
220
 
108
221
  onBeforeUnmount(() => {
109
222
  observer?.disconnect();
223
+ if (styleInterval) window.clearInterval(styleInterval);
110
224
  });
111
225
 
112
226
  const chartStyles = computed(() => {
113
- const styles = {
114
- height: `${frameHeight.value}px`,
227
+ return {
228
+ height: "100%",
229
+ width: "100%",
115
230
  };
116
- return styles;
117
231
  });
118
232
 
119
233
  const toggleIcon = computed(() =>
@@ -124,14 +238,41 @@ function toggleLayout() {
124
238
  areChartsSeparateLayout.value = !areChartsSeparateLayout.value;
125
239
  }
126
240
  </script>
241
+
242
+ <style>
243
+ /* Force the outer dashboard panel wrapping this component to utilize 100% height in fullscreen mode */
244
+ .bg-surface:has(.eodash-chart-wrapper) {
245
+ height: 100%;
246
+ display: flex;
247
+ flex-direction: column;
248
+ }
249
+ </style>
250
+
127
251
  <style scoped>
252
+ .eodash-chart-wrapper {
253
+ height: 100%; /* Force full height in fullscreen layout */
254
+ flex-grow: 1;
255
+ min-height: 180px; /* Prevent chart from becoming unusably small */
256
+ display: flex;
257
+ flex-direction: column;
258
+ }
259
+
128
260
  .chart-frame {
129
261
  position: relative;
262
+ flex-grow: 1;
263
+ min-height: 180px; /* Prevent chart from becoming unusably small */
264
+ display: flex;
265
+ flex-direction: column;
266
+ }
267
+
268
+ eox-chart {
269
+ flex-grow: 1;
270
+ min-height: 0;
130
271
  }
131
272
 
132
273
  .chart-toggle {
133
274
  position: absolute;
134
- top: 18px;
275
+ top: 8px;
135
276
  right: 46px;
136
277
  z-index: 2;
137
278
  cursor: pointer;