@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
@@ -6,6 +6,7 @@
6
6
  .for="mapEl"
7
7
  @select="onSelect"
8
8
  titleKey="title"
9
+ class="pa-4"
9
10
  .externalMapRendering="true"
10
11
  .animate="animate"
11
12
  .initDate="initDate"
@@ -21,9 +22,11 @@
21
22
 
22
23
  <eox-itemfilter
23
24
  v-if="filters.length"
25
+ class="mx-4"
24
26
  .inlineMode="true"
25
27
  :showResults="false"
26
28
  .filterProperties="filters"
29
+ @filter="onFilter"
27
30
  ></eox-itemfilter>
28
31
  <eox-timecontrol-timelapse @export="onExport"></eox-timecontrol-timelapse>
29
32
  </div>
@@ -41,8 +44,13 @@ import { computed, onMounted, ref, unref, useTemplateRef } from "vue";
41
44
  import { storeToRefs } from "pinia";
42
45
  import { useSTAcStore } from "@/store/stac";
43
46
  import { createAnimationLayers } from "./methods";
47
+ import {
48
+ useInitMosaic,
49
+ useScheduleMosaicUpdate,
50
+ useMosaicState,
51
+ } from "@/eodashSTAC/mosaic";
44
52
 
45
- const { animate } = defineProps({
53
+ const { animate, useMosaic, mosaicIndicators } = defineProps({
46
54
  filters: {
47
55
  /** @type {import("vue").PropType<import("@eox/itemfilter").EOxItemFilter["filterProperties"]>} */
48
56
  type: Array,
@@ -52,6 +60,15 @@ const { animate } = defineProps({
52
60
  type: Boolean,
53
61
  default: true,
54
62
  },
63
+ useMosaic: {
64
+ type: Boolean,
65
+ default: false,
66
+ },
67
+ mosaicIndicators: {
68
+ /** @type {import("vue").PropType<string[]>} */
69
+ type: Array,
70
+ default: () => [],
71
+ },
55
72
  });
56
73
 
57
74
  /** @type {import("vue").ShallowRef<HTMLElement>} */
@@ -65,6 +82,9 @@ const selectedRange = /** @type {import("vue").Ref<[string, string]>} */ (
65
82
  );
66
83
  const initDate = [startDate.toISOString().split("T")[0]];
67
84
 
85
+ /** @type {import("vue").Ref<import("@/types").ItemFilterFilters>} */
86
+ const currentFilters = ref({});
87
+
68
88
  const hasMultipleItems = computed(() => {
69
89
  return eodashCollections.some((ec) => {
70
90
  const itemLinks = ec.collectionStac?.links.filter((l) => l.rel === "item");
@@ -73,6 +93,20 @@ const hasMultipleItems = computed(() => {
73
93
  });
74
94
  });
75
95
 
96
+ const store = useSTAcStore();
97
+ const { selectedStac, stacEndpoint } = storeToRefs(store);
98
+ const { mosaicEndpoint } = useMosaicState();
99
+
100
+ const isMosaicEnabled = computed(() => useMosaic && !!mosaicEndpoint.value);
101
+
102
+ const scheduleMosaicUpdate = useScheduleMosaicUpdate();
103
+
104
+ useInitMosaic(
105
+ useMosaic ? mosaicEndpoint.value : null,
106
+ selectedRange,
107
+ mosaicIndicators,
108
+ );
109
+
76
110
  /**
77
111
  * Handles the selection event from the time control component.
78
112
  * It finds the closest item to the "from" selected date
@@ -85,6 +119,17 @@ const onSelect = (e) => {
85
119
  // Update the selected range with the new dates
86
120
  selectedRange.value = date;
87
121
 
122
+ // if mosaic is enabled, we don't need to find the closest item,
123
+ // we just update the mosaic layer with the new time range and filters
124
+ if (isMosaicEnabled.value) {
125
+ scheduleMosaicUpdate(
126
+ mosaicEndpoint.value,
127
+ selectedRange.value,
128
+ currentFilters.value,
129
+ );
130
+ return;
131
+ }
132
+
88
133
  const allItems = Object.keys(selectedItems ?? {}).flatMap(
89
134
  (id) => selectedItems[id],
90
135
  );
@@ -105,7 +150,18 @@ const onSelect = (e) => {
105
150
  }
106
151
  };
107
152
 
108
- const { selectedStac, stacEndpoint } = storeToRefs(useSTAcStore());
153
+ /**
154
+ * Handles filter changes from eox-itemfilter (e.g. cloud cover slider).
155
+ * Updates the mosaic layer with the new filter state.
156
+ *
157
+ * @param {CustomEvent<import("./types").ItemFilterEventDetail>} e
158
+ */
159
+ const onFilter = (e) => {
160
+ if (!isMosaicEnabled.value) return;
161
+ const { filters } = e.detail;
162
+ currentFilters.value = filters;
163
+ scheduleMosaicUpdate(mosaicEndpoint.value, selectedRange.value, filters);
164
+ };
109
165
 
110
166
  /**
111
167
  *
@@ -4,13 +4,14 @@ import axios from "@/plugins/axios";
4
4
  import { mapEl } from "@/store/states";
5
5
  import { removeLayers, sanitizeBbox } from "@/eodashSTAC/helpers";
6
6
  import { getLayers } from "@/store/actions";
7
+ import { buildCqlFilter } from "@/eodashSTAC/cql";
7
8
 
8
9
  /**
9
10
  * @param {string} stacEndpoint
10
11
  * @param {[string, string]} selectedRange
11
12
  * @param {import("../types").TimelineExportEventDetail["selectedRangeItems"]} selectedRangeItems
12
13
  * @param {import("vue").Ref<import("stac-ts").StacCollection|null>} selectedStac
13
- * @param {Record<string, import("../types").Filter>} filters
14
+ * @param {import("@/types").ItemFilterFilters} filters
14
15
  */
15
16
  export async function createAnimationLayers(
16
17
  stacEndpoint,
@@ -65,7 +66,7 @@ export async function createAnimationLayers(
65
66
  * @param {{min: string, max: string}} date
66
67
  * @param {number[] | undefined} bbox
67
68
  * @param {import("vue").Ref<import("stac-ts").StacCollection|null>} selectedStac
68
- * @param {Record<string, import("../types").Filter>} filters
69
+ * @param {import("@/types").ItemFilterFilters} filters
69
70
  * @return {Promise<Array<{ layers: Record<string, any>[]; date: string }>>}
70
71
  */
71
72
  async function createAPILayers(
@@ -87,7 +88,7 @@ async function createAPILayers(
87
88
  );
88
89
  url.searchParams.set("bbox", sanitizeBbox(bbox).join(","));
89
90
 
90
- const stacFilter = buildStacFilters(filters);
91
+ const stacFilter = buildCqlFilter(filters);
91
92
  if (stacFilter) {
92
93
  url.searchParams.set("filter", stacFilter);
93
94
  }
@@ -232,48 +233,4 @@ export function restoreLayersVisibility(layers) {
232
233
  return layers;
233
234
  }
234
235
 
235
- /**
236
- * Build STAC API filter string from TimeSlider filters
237
- * @param {Record<string, import("../types").Filter>} filters
238
- * @returns {string}
239
- */
240
- export function buildStacFilters(filters) {
241
- if (!filters) return "";
242
-
243
- /** @type {string[]} */
244
- const stacFilters = [];
245
-
246
- Object.values(filters).forEach((filter) => {
247
- if (!filter || !filter.key) return;
248
-
249
- // strip 'properties.' from key if present
250
- const propName = filter.key.startsWith("properties.")
251
- ? filter.key.replace("properties.", "")
252
- : filter.key;
253
-
254
- if (filter.type === "range" && filter.state) {
255
- if (
256
- filter.state.min !== undefined &&
257
- filter.state.min > (filter.min ?? -Infinity)
258
- ) {
259
- stacFilters.push(`${propName}>=${filter.state.min}`);
260
- }
261
- if (
262
- filter.state.max !== undefined &&
263
- filter.state.max < (filter.max ?? Infinity)
264
- ) {
265
- stacFilters.push(`${propName}<=${filter.state.max}`);
266
- }
267
- } else if (filter.type === "multiselect" && filter.stringifiedState) {
268
- if (filter.stringifiedState.length > 0) {
269
- stacFilters.push(`${propName} IN (${filter.stringifiedState})`);
270
- }
271
- } else if (filter.type === "select" && filter.stringifiedState) {
272
- if (filter.stringifiedState) {
273
- stacFilters.push(`${propName}='${filter.stringifiedState}'`);
274
- }
275
- }
276
- });
277
-
278
- return stacFilters.join(" AND ");
279
- }
236
+ export { useScheduleMosaicUpdate } from "@/eodashSTAC/mosaic";
@@ -1,3 +1,5 @@
1
+ import type { ItemFilterFilters } from "@/types";
2
+
1
3
  export interface TimelineSelectionEventDetail {
2
4
  date: [string, string];
3
5
  instances: {
@@ -5,7 +7,7 @@ export interface TimelineSelectionEventDetail {
5
7
  layer: import("ol/layer/Layer").default;
6
8
  source: import("ol/source/Source").default;
7
9
  };
8
- filters: Record<string, Filter>;
10
+ filters: ItemFilterFilters;
9
11
  selectedItems: {
10
12
  [layerId: string]: SelectedItem[];
11
13
  };
@@ -31,7 +33,7 @@ export interface TimelineExportEventDetail {
31
33
  zoom: number;
32
34
  center: [number, number];
33
35
  };
34
- filters: Record<string, Filter>;
36
+ filters: ItemFilterFilters;
35
37
  instances: {
36
38
  layer: import("ol/layer/Layer").default;
37
39
  source: import("ol/source/Source").default;
@@ -46,19 +48,7 @@ export interface TimelineExportEventDetail {
46
48
  }) => Promise<void>;
47
49
  }
48
50
 
49
- export interface Filter {
50
- key: string;
51
- title: string;
52
- type: "range" | "multiselect" | "select";
53
- expanded: boolean;
54
- min: number;
55
- max: number;
56
- step: number;
57
- // this state is mainly for range filters, select and multiselect to be added.
58
- state: {
59
- min: number;
60
- max: number;
61
- };
62
- dirty: boolean;
63
- stringifiedState: string;
51
+ export interface ItemFilterEventDetail {
52
+ result: Record<string, any>;
53
+ filters: ItemFilterFilters;
64
54
  }
@@ -34,7 +34,7 @@
34
34
  <strong>Map Layers Configuration</strong>
35
35
  </p>
36
36
  <div class="pa-3 code-block mb-4">
37
- {{ removeUnneededProperties(getLayers()) }}
37
+ {{ removeUnneededProperties(getLayers(), layerControlFormValue) }}
38
38
  </div>
39
39
 
40
40
  <div v-if="chartSpec" class="mb-4">
@@ -63,6 +63,7 @@ import { copyToClipBoard } from "@/utils";
63
63
  import { ref } from "vue";
64
64
  import { getLayers as getLayerAction } from "@/store/actions";
65
65
  import { mapPosition, availableMapProjection, chartSpec } from "@/store/states";
66
+ import { layerControlFormValue } from "@/utils/states";
66
67
  import { removeUnneededProperties } from "@/eodashSTAC/helpers";
67
68
  import { base64EncodeSpec } from "@eox/chart";
68
69
 
@@ -86,7 +87,15 @@ const copyBtns = [
86
87
  {
87
88
  id: Symbol(),
88
89
  copyFn: async () =>
89
- await copyToClipBoard(JSON.stringify(props.getLayers()), copySuccess),
90
+ await copyToClipBoard(
91
+ JSON.stringify(
92
+ removeUnneededProperties(
93
+ props.getLayers(),
94
+ layerControlFormValue.value,
95
+ ),
96
+ ),
97
+ copySuccess,
98
+ ),
90
99
  copyAs: "layers configuration",
91
100
  },
92
101
  {
@@ -110,7 +119,7 @@ const getMapStepCode = () => {
110
119
  #### Tour step title
111
120
  Text describing the current step of the tour and why it is interesting what the map shows currently
112
121
  `;
113
- return `${preTag}'${JSON.stringify(removeUnneededProperties(props.getLayers()))}' ${endTag}`;
122
+ return `${preTag}'${JSON.stringify(removeUnneededProperties(props.getLayers(), layerControlFormValue.value))}' ${endTag}`;
114
123
  };
115
124
  const getMapEntryCode = () => {
116
125
  const [x, y, z] = mapPosition.value;
@@ -118,7 +127,7 @@ const getMapEntryCode = () => {
118
127
  "## Map Example <!" +
119
128
  '--{as="eox-map" style="width: 100%; height: 500px;" layers=';
120
129
  const endTag = `zoom="${z}" center=[${[x, y]}] projection="${availableMapProjection.value}" }-->`;
121
- return `${preTag}'${JSON.stringify(removeUnneededProperties(props.getLayers()))}' ${endTag}`;
130
+ return `${preTag}'${JSON.stringify(removeUnneededProperties(props.getLayers(), layerControlFormValue.value))}' ${endTag}`;
122
131
  };
123
132
 
124
133
  const getChartExportCode = () => {
@@ -1,144 +0,0 @@
1
- import { computed, ref, useTemplateRef, onMounted, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createCommentVNode, normalizeStyle, toRaw } from 'vue';
2
- import '@eox/chart';
3
- import { o as onChartClick } from './handling-BrcDDlgS.js';
4
- import { Z as compareChartData, _ as chartData, N as compareChartSpec, M as chartSpec, L as areChartsSeparateLayout } from './helpers-DjZVl_WF.js';
5
- import { _ as _export_sfc, U as getOverlayParent } from './asWebComponent-BHWpMuE3.js';
6
- import { mdiArrowCollapse, mdiArrowExpand } from '@mdi/js';
7
- import { T as Tooltip } from './index-CUjl-ZsI.js';
8
-
9
- const _style_0 = ".chart-frame[data-v-c9dee45e]{position:relative}.chart-toggle[data-v-c9dee45e]{position:absolute;top:18px;right:46px;z-index:2;cursor:pointer}";
10
-
11
- const _hoisted_1 = { ref: "container" };
12
- const _hoisted_2 = { class: "chart-frame" };
13
- const _hoisted_3 = {
14
- viewBox: "0 0 20 20",
15
- width: "20",
16
- height: "20",
17
- "aria-hidden": "true"
18
- };
19
- const _hoisted_4 = ["d"];
20
- const _hoisted_5 = [".spec", ".dataValues", ".opt"];
21
-
22
-
23
- const _sfc_main = {
24
- __name: 'EodashChart',
25
- props: {
26
- enableCompare: {
27
- type: Boolean,
28
- default: false,
29
- },
30
- vegaEmbedOptions: {
31
- type: Object,
32
- default() {
33
- return { actions: true };
34
- },
35
- },
36
- },
37
- setup(__props) {
38
-
39
-
40
-
41
- const usedChartData = computed(() => {
42
- return __props.enableCompare ? compareChartData.value : chartData.value;
43
- });
44
-
45
- const usedChartSpec = computed(() => {
46
- return __props.enableCompare ? compareChartSpec.value : chartSpec.value;
47
- });
48
-
49
- const chartRenderKey = ref(0);
50
- const frameHeight = ref(225);
51
- const containerEl = useTemplateRef("container");
52
-
53
- /**
54
- @type { MutationObserver | null}
55
- */
56
- let observer = null;
57
-
58
- onMounted(() => {
59
- const el = containerEl.value;
60
- if (!el) return;
61
-
62
- const parent = el.parentElement?.parentElement;
63
- if (parent) {
64
- const parentHeight = parent.getBoundingClientRect().height;
65
- frameHeight.value = Math.max(225, Math.floor(parentHeight));
66
- }
67
-
68
- // for mobile view, the overlay panel containing chart is initially hidden
69
- // we create an observer when display of overlay is not none anymore
70
- const overlay = getOverlayParent(el);
71
- if (!overlay) return;
72
-
73
- observer = new MutationObserver(async () => {
74
- const style = getComputedStyle(overlay);
75
- const visible = style.display !== "none";
76
- if (visible) {
77
- // forcibly rerender chart, otherwise size of canvas is 0
78
- chartRenderKey.value = Math.random();
79
- }
80
- });
81
-
82
- observer.observe(overlay, {
83
- attributes: true,
84
- attributeFilter: ["style", "class"],
85
- });
86
- });
87
-
88
- onBeforeUnmount(() => {
89
- observer?.disconnect();
90
- });
91
-
92
- const chartStyles = computed(() => {
93
- const styles = {
94
- height: `${frameHeight.value}px`,
95
- };
96
- return styles;
97
- });
98
-
99
- const toggleIcon = computed(() =>
100
- areChartsSeparateLayout.value ? mdiArrowCollapse : mdiArrowExpand,
101
- );
102
-
103
- function toggleLayout() {
104
- areChartsSeparateLayout.value = !areChartsSeparateLayout.value;
105
- }
106
-
107
- return (_ctx, _cache) => {
108
-
109
-
110
- return (openBlock(), createElementBlock("div", _hoisted_1, [
111
- createElementVNode("div", _hoisted_2, [
112
- (usedChartData.value && usedChartSpec.value)
113
- ? withDirectives((openBlock(), createElementBlock("button", {
114
- key: 0,
115
- class: "chart-toggle",
116
- onClick: toggleLayout
117
- }, [
118
- (openBlock(), createElementBlock("svg", _hoisted_3, [
119
- createElementVNode("path", { d: toggleIcon.value }, null, 8 /* PROPS */, _hoisted_4)
120
- ]))
121
- ])), [
122
- [Tooltip, unref(areChartsSeparateLayout) ? 'Minimize' : 'Maximize']
123
- ])
124
- : createCommentVNode("v-if", true),
125
- (usedChartData.value && usedChartSpec.value)
126
- ? (openBlock(), createElementBlock("eox-chart", {
127
- class: "pa-2",
128
- ".spec": toRaw(usedChartSpec.value),
129
- key: chartRenderKey.value,
130
- ".dataValues": toRaw(usedChartData.value),
131
- "onClick:item": _cache[0] || (_cache[0] = (...args) => (unref(onChartClick) && unref(onChartClick)(...args))),
132
- style: normalizeStyle(chartStyles.value),
133
- ".opt": __props.vegaEmbedOptions
134
- }, null, 44 /* STYLE, PROPS, NEED_HYDRATION */, _hoisted_5))
135
- : createCommentVNode("v-if", true)
136
- ])
137
- ], 512 /* NEED_PATCH */))
138
- }
139
- }
140
-
141
- };
142
- const EodashChart = /*#__PURE__*/_export_sfc(_sfc_main, [['styles',[_style_0]],['__scopeId',"data-v-c9dee45e"]]);
143
-
144
- export { EodashChart as default };
@@ -1,107 +0,0 @@
1
- import { openBlock, createElementBlock, createElementVNode, unref } from 'vue';
2
- import '@eox/stacinfo';
3
- import { F as currentUrl } from './helpers-DjZVl_WF.js';
4
-
5
- const _hoisted_1 = { class: "flex-grow-1" };
6
- const _hoisted_2 = [".for", ".allowHtml", ".body", ".featured", ".footer", ".header", ".tags"];
7
-
8
-
9
- const _sfc_main = {
10
- __name: 'EodashStacInfo',
11
- props: {
12
- allowHtml: {
13
- type: Boolean,
14
- default: true,
15
- },
16
-
17
- header: {
18
- /**
19
- * @type {import("vue").PropType<
20
- * (string | {
21
- * key: string,
22
- * filter?: (item: any) => boolean
23
- * })[]
24
- * >}
25
- */
26
- type: Array,
27
- default: () => ["title"],
28
- },
29
- tags: {
30
- /**
31
- * @type {import("vue").PropType<
32
- * (string | {
33
- * key: string,
34
- * filter?: (item: any) => boolean
35
- * })[]
36
- * >}
37
- */
38
- type: Array,
39
- default: () => ["themes"],
40
- },
41
- body: {
42
- /**
43
- * @type {import("vue").PropType<
44
- * (string | {
45
- * key: string,
46
- * filter?: (item: any) => boolean
47
- * })[]
48
- * >}
49
- */
50
- type: Array,
51
- default: () => [
52
- "satellite",
53
- "sensor",
54
- "insituSources",
55
- "otherSources",
56
- "agency",
57
- "extent",
58
- ],
59
- },
60
- featured: {
61
- /**
62
- * @type {import("vue").PropType<
63
- * (string | {
64
- * key: string,
65
- * filter?: (item: any) => boolean
66
- * })[]
67
- * >}
68
- */
69
- type: Array,
70
- default: () => ["description", "providers", "assets", "links"],
71
- },
72
- footer: {
73
- /**
74
- * @type {import("vue").PropType<
75
- * (string | {
76
- * key: string,
77
- * filter?: (item: any) => boolean
78
- * })[]
79
- * >}
80
- */
81
- type: Array,
82
- default: () => ["sci:citation", "sci:doi", "sci:publication"],
83
- },
84
- },
85
- setup(__props) {
86
-
87
-
88
-
89
- return (_ctx, _cache) => {
90
- return (openBlock(), createElementBlock("div", _hoisted_1, [
91
- createElementVNode("eox-stacinfo", {
92
- ".for": unref(currentUrl),
93
- ".allowHtml": __props.allowHtml,
94
- ".body": __props.body,
95
- ".featured": __props.featured,
96
- ".footer": __props.footer,
97
- ".header": __props.header,
98
- ".tags": __props.tags,
99
- style: {"--color-primary-lighter":"none"}
100
- }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2)
101
- ]))
102
- }
103
- }
104
-
105
- };
106
-
107
- export { _sfc_main as default };