@eodash/eodash 5.0.0-alpha.2.1 → 5.0.0-alpha.2.11

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 (138) hide show
  1. package/README.md +36 -3
  2. package/core/client/App.vue +26 -0
  3. package/core/client/SuspensedDashboard.ce.vue +105 -0
  4. package/core/client/asWebComponent.d.ts +23 -0
  5. package/core/client/asWebComponent.js +12 -0
  6. package/core/client/components/DashboardLayout.vue +77 -0
  7. package/core/client/components/DynamicWebComponent.vue +68 -0
  8. package/core/client/components/ErrorAlert.vue +36 -0
  9. package/core/{components → client/components}/Footer.vue +34 -15
  10. package/core/client/components/Header.vue +19 -0
  11. package/core/client/components/IframeWrapper.vue +11 -0
  12. package/core/client/components/Loading.vue +37 -0
  13. package/core/client/components/MobileLayout.vue +109 -0
  14. package/core/client/composables/DefineEodash.js +67 -0
  15. package/core/client/composables/DefineWidgets.js +161 -0
  16. package/core/client/composables/index.js +155 -0
  17. package/core/client/eodash.js +129 -0
  18. package/core/client/main.js +2 -0
  19. package/core/client/plugins/index.js +20 -0
  20. package/core/client/plugins/vuetify.js +35 -0
  21. package/core/client/render.js +12 -0
  22. package/core/client/store/Actions.js +38 -0
  23. package/core/client/store/States.js +24 -0
  24. package/core/client/store/index.js +20 -0
  25. package/core/client/store/stac.js +81 -0
  26. package/core/client/types.d.ts +287 -0
  27. package/core/client/utils/createLayers.js +131 -0
  28. package/core/client/utils/eodashSTAC.js +259 -0
  29. package/core/client/utils/helpers.js +152 -0
  30. package/core/client/utils/index.js +51 -0
  31. package/core/{utils → client/utils}/keys.js +2 -2
  32. package/core/client/views/Dashboard.vue +116 -0
  33. package/core/client/vite-env.d.ts +39 -0
  34. package/dist/client/DashboardLayout-D5c2wAGC.js +156 -0
  35. package/dist/{DynamicWebComponent-BrHVTesn.js → client/DynamicWebComponent-CBuMCUIj.js} +11 -11
  36. package/dist/client/EodashDatePicker-D0qdMMTE.js +252 -0
  37. package/dist/client/EodashItemFilter-CTRnGRRS.js +10067 -0
  38. package/dist/client/EodashLayerControl-Bpm0BwcW.js +31499 -0
  39. package/dist/client/EodashMap-DaMtQefq.js +114367 -0
  40. package/dist/client/EodashMapBtns-B5z8h8mr.js +50 -0
  41. package/dist/client/ExportState-Bp3n6gba.js +558 -0
  42. package/dist/client/Footer-BROOTKhV.js +115 -0
  43. package/dist/client/Header-C_fKVTsg.js +350 -0
  44. package/dist/{IframeWrapper-Dd9zrX9s.js → client/IframeWrapper-32Q3DBYr.js} +4 -4
  45. package/dist/client/MobileLayout-TVGrYpNT.js +945 -0
  46. package/dist/client/PopUp-BJzmeeKG.js +300 -0
  47. package/dist/client/VImg-BT4Vb0UT.js +291 -0
  48. package/dist/client/VMain-BDVUXNEk.js +39 -0
  49. package/dist/client/VOverlay-Ck_4Lxcb.js +972 -0
  50. package/dist/{WidgetsContainer-DxfCu0I3.js → client/WidgetsContainer-DjjX_n1U.js} +25 -18
  51. package/dist/client/asWebComponent-wn9bbgx9.js +20404 -0
  52. package/dist/{basedecoder-Qm25PwVp-CHo5Pomv.js → client/basedecoder-DHcBySSe-BmCFNFnw.js} +5 -6
  53. package/dist/{decoder-kAoyGIq9-BBR5CgzS.js → client/decoder-Cth6J7EK-CLlwAswr.js} +1 -1
  54. package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +10 -0
  55. package/dist/client/eo-dash.js +6 -0
  56. package/dist/client/eox-stacinfo-l7ALSV90.js +13969 -0
  57. package/dist/client/forwardRefs--PLRH8zp.js +185 -0
  58. package/dist/client/helpers-CoqJPYdE.js +1391 -0
  59. package/dist/{index-DTkOfh2g.js → client/index-Dt0NRXIq.js} +21 -20
  60. package/dist/{jpeg-DNfUpLwy-Fjan-04T.js → client/jpeg-BAgeD1d3-oeHbFPUL.js} +5 -6
  61. package/dist/{lerc-C9VL9kri-cIdbW0sg.js → client/lerc-BgbQqdFI-CCpDWUne.js} +37 -39
  62. package/dist/{lzw-BOMhmEDy-Dboc93VO.js → client/lzw-LAGDNbSC-DkP96qO9.js} +1 -1
  63. package/dist/{packbits-DaUD6MLm-Bu1PoTGa.js → client/packbits-BlDR4Kj5-C66n1-zr.js} +1 -1
  64. package/dist/{pako.esm-C3kYPGGQ-BMki8cQY.js → client/pako.esm-CB1uQYY0-DB0PYm1P.js} +6 -12
  65. package/dist/{raw-CcGKjn8q-DFOt-i8n.js → client/raw-CMGvRjfu-BRi6E4i1.js} +1 -1
  66. package/dist/{ssrBoot-D-b4-M19.js → client/ssrBoot-DjZDIkG_.js} +1 -1
  67. package/dist/client/style.css +5 -0
  68. package/dist/client/transition-C8OQt_kp.js +34 -0
  69. package/dist/{webfontloader-CyOFAuFB.js → client/webfontloader-qotgY98I.js} +56 -92
  70. package/dist/{webimage-D2c098k3-DLj1LQxB.js → client/webimage-BM_pbLN3-L2cGWK5l.js} +1 -1
  71. package/dist/node/cli.js +20 -0
  72. package/dist/node/main.js +2 -0
  73. package/dist/node/types.d.ts +47 -0
  74. package/package.json +57 -51
  75. package/widgets/EodashDatePicker.vue +146 -40
  76. package/widgets/EodashItemFilter.vue +81 -41
  77. package/widgets/EodashLayerControl.vue +16 -0
  78. package/widgets/EodashMap.vue +186 -42
  79. package/widgets/EodashMapBtns.vue +50 -0
  80. package/widgets/ExportState.vue +112 -0
  81. package/widgets/PopUp.vue +40 -0
  82. package/widgets/WidgetsContainer.vue +47 -27
  83. package/bin/app.js +0 -22
  84. package/bin/cli.js +0 -62
  85. package/bin/main.js +0 -9
  86. package/bin/serverConfig.js +0 -165
  87. package/bin/types.d.ts +0 -52
  88. package/bin/utils.js +0 -103
  89. package/core/App.vue +0 -19
  90. package/core/SuspensedDashboard.ce.vue +0 -65
  91. package/core/asWebComponent.d.ts +0 -18
  92. package/core/asWebComponent.js +0 -12
  93. package/core/components/DashboardLayout.vue +0 -44
  94. package/core/components/DynamicWebComponent.vue +0 -68
  95. package/core/components/Header.vue +0 -14
  96. package/core/components/IframeWrapper.vue +0 -11
  97. package/core/components/Loading.vue +0 -27
  98. package/core/components/MobileLayout.vue +0 -49
  99. package/core/composables/DefineEodash.js +0 -57
  100. package/core/composables/DefineWidgets.js +0 -129
  101. package/core/composables/index.js +0 -219
  102. package/core/eodash.js +0 -100
  103. package/core/main.js +0 -2
  104. package/core/plugins/index.js +0 -18
  105. package/core/plugins/vuetify.js +0 -30
  106. package/core/render.js +0 -13
  107. package/core/store/Actions.js +0 -0
  108. package/core/store/States.js +0 -21
  109. package/core/store/index.js +0 -17
  110. package/core/store/stac.js +0 -63
  111. package/core/types.d.ts +0 -356
  112. package/core/utils/eodashSTAC.js +0 -164
  113. package/core/utils/helpers.js +0 -40
  114. package/core/utils/index.js +0 -28
  115. package/core/views/Dashboard.vue +0 -59
  116. package/core/vite-env.d.ts +0 -31
  117. package/dist/DashboardLayout-Dp8AnYD9.js +0 -141
  118. package/dist/EodashDatePicker-D_udZ26j.js +0 -1645
  119. package/dist/EodashItemFilter-BLAGx2UD.js +0 -51
  120. package/dist/EodashMap-Bxl_aqY2.js +0 -53405
  121. package/dist/Footer-AohCH8U7.js +0 -118
  122. package/dist/Header-DC50S6GR.js +0 -609
  123. package/dist/MobileLayout-CgToA7Gp.js +0 -523
  124. package/dist/VBtn-Bz7ruRUg.js +0 -1106
  125. package/dist/VMain-BHfWJU2j.js +0 -35
  126. package/dist/asWebComponent-C8rb3b1D.js +0 -11323
  127. package/dist/color-DpYEub1f.js +0 -115
  128. package/dist/deflate-Be2Arps5-hDqMz3RA.js +0 -10
  129. package/dist/dimensions-CJaGeSrj.js +0 -53
  130. package/dist/eo-dash.js +0 -6
  131. package/dist/eox-itemfilter-DcQkRD2l.js +0 -7537
  132. package/dist/eox-map-BJ9SIixs.js +0 -36205
  133. package/dist/eox-stacinfo-B-YrT7Ug.js +0 -13698
  134. package/dist/forwardRefs-Bxeu9Obx.js +0 -142
  135. package/dist/index-Sa2Vg_gx.js +0 -65
  136. package/dist/style.css +0 -5
  137. /package/dist/{.gitkeep → client/.gitkeep} +0 -0
  138. /package/dist/{_commonjsHelpers-DaMA6jEr.js → client/_commonjsHelpers-DaMA6jEr.js} +0 -0
package/core/types.d.ts DELETED
@@ -1,356 +0,0 @@
1
- /**
2
- * @group Eodash
3
- */
4
- export interface WebComponentProps<T extends ExecutionTime = "compiletime"> {
5
- /**
6
- * Imports web component file, either using a URL or an import function.
7
- * @example
8
- * importing `eox-itemfilter` web component, after installing `@eox/itemfilter` it can be
9
- * referenced:
10
- * ```js
11
- * link: async() => import("@eox/itemfilter")
12
- * ```
13
- *
14
- * ::: warning
15
- * import maps are not available in runtime config
16
- * :::
17
- **/
18
- link: T extends 'runtime' ? string : (string | (() => Promise<unknown>));
19
- /**
20
- * Exported Constructor, needs to be provided if the web component is not registered in by the
21
- * [link](#link) provided
22
- **/
23
- constructorProp?: string
24
- tagName: `${string}-${string}`
25
- /** Object defining all the properties and attributes of the web component */
26
- properties?: Record<string, any>
27
- /**
28
- * Triggered when the web component is mounted in the DOM.
29
- * @param el - web component
30
- * @param store - return value of the core STAC pinia store in `/core/store/stac.ts`
31
- */
32
- onMounted?: (el: Element | null, store: ReturnType<typeof import("./store/stac").useSTAcStore>) => (Promise<void> | void)
33
- /**
34
- * Triggered when the web component is unmounted from the DOM.
35
- * @param el - web component
36
- * @param store - return value of the core STAC pinia store in `/core/store/stac.ts`
37
- */
38
- onUnmounted?: (el: Element | null, store: ReturnType<typeof import("./store/stac").useSTAcStore>) => (Promise<void> | void)
39
- }
40
-
41
-
42
- /** @ignore */
43
- export interface WidgetsContainerProps {
44
- widgets: Omit<Widget, 'layout' | 'slidable'>[]
45
- }
46
-
47
- // eodash types:
48
- /**
49
- * Widget type: `web-component` API
50
- * @group Eodash
51
- */
52
- export interface WebComponentWidget<T extends ExecutionTime = "compiletime"> {
53
- id: number | string | symbol
54
- title: string
55
- /**
56
- * Widget position and size.
57
- */
58
- layout: {
59
- /**
60
- * Horizontal start position. Integer between 1 and 12
61
- */
62
- x: number
63
- /**
64
- * Vertical start position. Integer between 1 and 12
65
- */
66
- y: number
67
- /**
68
- * Width. Integer between 1 and 12
69
- */
70
- w: number
71
- /**
72
- * Height. Integer between 1 and 12
73
- */
74
- h: number
75
- },
76
- /**
77
- * Enable/Disable widget sliding.
78
- */
79
- slidable?: boolean
80
- widget: WebComponentProps<T>
81
- type: 'web-component'
82
- }
83
-
84
- /**
85
- * Widget type: `internal` API.
86
- * Internal widgets are Vue components provided by eodash.
87
- * @group Eodash
88
- */
89
- export interface InternalComponentWidget {
90
- id: number | string | symbol
91
- title: string
92
- /**
93
- * Widget position and size.
94
- */
95
- layout: {
96
- /**
97
- * Horizontal start position. Integer between 1 and 12
98
- */
99
- x: number
100
- /**
101
- * Vertical start position. Integer between 1 and 12
102
- */
103
- y: number
104
- /**
105
- * Width. Integer between 1 and 12
106
- */
107
- w: number
108
- /**
109
- * Height. Integer between 1 and 12
110
- */
111
- h: number
112
- }
113
- /**
114
- * Enable/Disable widget sliding.
115
- */
116
- slidable?: boolean
117
- widget: {
118
- /**
119
- * Internal Vue Components inside the [widgets](https://github.com/eodash/eodash/tree/main/widgets) folder. Referenced
120
- * using their name without the .vue extention
121
- */
122
- name: string;
123
- /**
124
- * Specified Vue component props
125
- */
126
- properties?: Record<string, unknown>
127
- }
128
- type: 'internal'
129
- }
130
-
131
- /**
132
- * Widget type: `iframe` API
133
- * Renders an external HTML file as a widget.
134
- */
135
- /**
136
- * @group Eodash
137
- */
138
- export interface IFrameWidget {
139
- id: number | string | symbol
140
- title: string
141
- /**
142
- * Widget position and size.
143
- */
144
- layout: {
145
- /**
146
- * Horizontal start position. Integer between 1 and 12
147
- */
148
- x: number
149
- /**
150
- * Vertical start position. Integer between 1 and 12
151
- */
152
- y: number
153
- /**
154
- * Width. Integer between 1 and 12
155
- */
156
- w: number
157
- /**
158
- * Height. Integer between 1 and 12
159
- */
160
- h: number
161
- }
162
- /**
163
- * Enable/Disable widget sliding.
164
- */
165
- slidable?: boolean;
166
- widget: {
167
- /**
168
- * The URL of the page to embed
169
- */
170
- src: string
171
- }
172
- type: 'iframe'
173
- }
174
- /**
175
- * @group Eodash
176
- */
177
- export interface FunctionalWidget<T extends ExecutionTime = "compiletime"> {
178
- /**
179
- * Provides a functional definition of the widget,
180
- * gets triggered whenever a STAC object is selected.
181
- * @param selectedSTAC - Currently selected STAC object
182
- */
183
- defineWidget: (selectedSTAC: import("stac-ts").StacCatalog |
184
- import("stac-ts").StacCollection | import("stac-ts").StacItem
185
- | null) => Omit<StaticWidget<T>, 'layout' | 'slidable'>
186
- layout: {
187
- /**
188
- * Horizontal start position. Integer between 1 and 12
189
- */
190
- x: number
191
- /**
192
- * Vertical start position. Integer between 1 and 12
193
- */
194
- y: number
195
- /**
196
- * Width. Integer between 1 and 12
197
- */
198
- w: number
199
- /**
200
- * Height. Integer between 1 and 12
201
- */
202
- h: number
203
- }
204
- /**
205
- * Enable/Disable widget sliding.
206
- */
207
- slidable?: boolean
208
- }
209
- /**
210
- * @group Eodash
211
- */
212
- export type StaticWidget<T extends ExecutionTime = "compiletime"> = WebComponentWidget<T> | InternalComponentWidget | IFrameWidget
213
- /**
214
- * @group Eodash
215
- */
216
- export type Widget<T extends ExecutionTime = "compiletime"> = StaticWidget<T> | FunctionalWidget<T>
217
-
218
-
219
- /**
220
- * @group Eodash
221
- */
222
- export type BackgroundWidget<T extends ExecutionTime = "compiletime"> = Omit<WebComponentWidget<T>, 'layout' | 'title' | 'slidable'> | Omit<InternalComponentWidget, 'layout' | 'title' | 'slidable'> | Omit<IFrameWidget, 'layout' | 'title' | 'slidable'> | Omit<FunctionalWidget<T>, 'layout' | 'slidable'>
223
- /**
224
- * Dashboard rendered widgets specification.
225
- * 3 types of widgets are supported: `"iframe"`, `"internal"`, and `"web-component"`.
226
- * A specific object should be provided based on the type of the widget.
227
- * @group Eodash
228
- */
229
- export interface Template<T extends ExecutionTime = "compiletime"> {
230
- /**
231
- * Gap between widgets
232
- */
233
- gap?: number;
234
- /**
235
- * loading widget
236
- */
237
- loading?: BackgroundWidget<T>
238
- /**
239
- * Widget rendered as the dashboard background.
240
- * Has the same specifications of `Widget` without the `title` and `layout` properties
241
- * @see {@link Widget}
242
- */
243
- background?: BackgroundWidget<T>
244
- /**
245
- * Array of widgets that will be rendered as dashboard panels.
246
- */
247
- widgets: Widget<T>[]
248
- }
249
-
250
- /** @ignore */
251
- export type StacEndpoint = `${'https://' | 'http://'}${string}/catalog.json`
252
-
253
- /**
254
- * @ignore
255
- * @group Eodash
256
- */
257
- export type ExecutionTime = "runtime" | "compiletime";
258
-
259
- /**
260
- * Eodash instance API
261
- * @group Eodash
262
- */
263
- export interface Eodash<T extends ExecutionTime = "compiletime"> {
264
- /**
265
- * Instance ID.
266
- */
267
- id?: string;
268
- /**
269
- * Root STAC catalog endpoint
270
- **/
271
- stacEndpoint: StacEndpoint
272
- /**
273
- * Brand specifications.
274
- */
275
- brand: {
276
- /** Removes the dashboard layout */
277
- noLayout?: boolean
278
- /**
279
- * Automatically fetches the specified font family from google fonts. if the [link](#font-link) property is specified
280
- * the font family will be fetched from the provided source instead.
281
- */
282
- font?: {
283
- /**
284
- * Link to stylesheet that defines font-face. Could be either a relative or absolute URL.
285
- */
286
- link?: string;
287
- /**
288
- * Font family. Use FVD notation to include families. see https://github.com/typekit/fvd
289
- */
290
- family: string
291
- }
292
- /**
293
- * Title that will be shown in the app header
294
- */
295
- name: string;
296
- /**
297
- * Brand logo
298
- */
299
- logo?: string;
300
- /**
301
- * Dashboard theme as a custom [vuetifyJs theme](https://vuetifyjs.com/en/features/theme/).
302
- */
303
- theme?: import("vuetify/lib/index.mjs").ThemeDefinition
304
- /**
305
- * Text applied to the footer.
306
- */
307
- footerText?: string;
308
- }
309
- /**
310
- * Template configuration
311
- */
312
- template: Template<T>
313
- }
314
- /////////
315
-
316
- /// eodash store types
317
- /**
318
- * @group EodashStore
319
- */
320
- export interface EodashStore {
321
- /**
322
- * Stateful Reactive variables
323
- */
324
- states: {
325
- /**
326
- * Currently selected STAC endpoint
327
- */
328
- currentUrl: import("vue").Ref<string>
329
- /**
330
- * currently selected datetime
331
- */
332
- datetime: import("vue").Ref<string>
333
- /**
334
- * Currently selected indicator
335
- */
336
- indicator: import("vue").Ref<string>
337
- }
338
- actions: {};
339
- /**
340
- * Pinia store definition used to navigate the root STAC catalog.
341
- */
342
- stac: {
343
- useSTAcStore: typeof import("./store/stac").useSTAcStore
344
- }
345
- }
346
- ///////
347
- /**
348
- * the project's entry point should export this function as a default
349
- * to instantiate eodash
350
- * @group Eodash
351
- * @param configCallback
352
- */
353
- export declare const createEodash: (config: ((store: EodashStore) => Eodash | Promise<Eodash>) | Eodash) => Eodash | Promise<Eodash>
354
-
355
- /** @group EodashStore */
356
- export declare const store: EodashStore
@@ -1,164 +0,0 @@
1
- import { Collection, Item } from 'stac-js';
2
- import { toAbsolute } from 'stac-js/src/http.js';
3
- import { generateFeatures } from './helpers'
4
-
5
- export class EodashCollection {
6
- /** @type {string | undefined} */
7
- #collectionUrl = undefined;
8
- #collectionStac = undefined;
9
- /** @type {*} */
10
- selectedItem = null;
11
-
12
- /**
13
- * @param {string} collectionUrl
14
- */
15
- constructor(collectionUrl) {
16
- this.#collectionUrl = collectionUrl;
17
- }
18
- /**
19
- * @param {*} item
20
- * @returns
21
- * @async
22
- */
23
- createLayersJson = async (item = null) => {
24
- let stacItem, stac;
25
- // TODO get auxiliary layers from collection
26
- let layersJson = [
27
- {
28
- type: 'Tile',
29
- properties: {
30
- id: 'OSM',
31
- },
32
- source: {
33
- type: 'OSM',
34
- },
35
- },
36
- ];
37
- // Load collectionstac if not yet initialized
38
- if (!this.#collectionStac) {
39
- //@ts-expect-error
40
- const response = await fetch(this.#collectionUrl);
41
- stac = await response.json();
42
- this.#collectionStac = new Collection(stac);
43
- }
44
-
45
- if(stac && stac.endpointtype === "GeoDB") {
46
- // Special handling of point based data
47
- const allFeatures = generateFeatures(stac.links);
48
- layersJson.unshift({
49
- type: "Vector",
50
- properties: {
51
- id: stac.id,
52
- },
53
- source: {
54
- type: "Vector",
55
- // @ts-ignore
56
- url: "data:," + encodeURIComponent(JSON.stringify(allFeatures)),
57
- format: "GeoJSON",
58
- },
59
- style: {
60
- "circle-radius": 5,
61
- "circle-fill-color": "#00417077",
62
- "circle-stroke-color": "#004170",
63
- "fill-color": "#00417077",
64
- "stroke-color": "#004170",
65
- }
66
- });
67
- return layersJson;
68
- } else {
69
- if (item instanceof Date) {
70
- // if collectionStac not yet initialized we do it here
71
- stacItem = this.getItems().sort((a, b) => {
72
- //@ts-expect-error
73
- const distanceA = Math.abs(new Date(a.datetime) - item);
74
- //@ts-expect-error
75
- const distanceB = Math.abs(new Date(b.datetime) - item);
76
- return distanceA - distanceB;
77
- })[0];
78
- this.selectedItem = stacItem;
79
- } else {
80
- stacItem = item;
81
- }
82
- const response = await fetch(
83
- stacItem
84
- ? toAbsolute(stacItem.href, this.#collectionUrl)
85
- : this.#collectionUrl
86
- );
87
- stac = await response.json();
88
-
89
- if (!stacItem) {
90
- // no specific item was requested; render last item
91
- this.#collectionStac = new Collection(stac);
92
- const items = this.getItems();
93
- this.selectedItem = items[items.length - 1];
94
- layersJson = await this.createLayersJson(this.selectedItem);
95
- return layersJson;
96
- } else {
97
- // specific item was requested
98
- const item = new Item(stac);
99
- this.selectedItem = item;
100
- //@ts-expect-error
101
- layersJson.unshift(this.buildJson(item));
102
- return layersJson;
103
- }
104
- }
105
- }
106
-
107
- /**
108
- * @param {*} item
109
- */
110
- buildJson(item) {
111
- let json;
112
- // TODO implement other types, such as COG
113
- if (/** @type {import('stac-ts').StacLink[]} */(item.links)
114
- .find((l) => l.rel === 'wms' || l.rel === 'wmts' || l.rel === 'xyz')) {
115
- json = {
116
- type: 'STAC',
117
- displayWebMapLink: true,
118
- displayFootprint: false,
119
- data: item,
120
- properties: {
121
- id: item.id,
122
- },
123
- };
124
- } else {
125
- // fall back to rendering the feature
126
- json = {
127
- type: 'Vector',
128
- source: {
129
- type: 'Vector',
130
- url: 'data:,' + encodeURIComponent(JSON.stringify(item.geometry)),
131
- format: 'GeoJSON',
132
- },
133
- properties: {
134
- id: item.id,
135
- },
136
- };
137
- }
138
-
139
- return json;
140
- }
141
-
142
- getItems() {
143
- return (
144
- //@ts-expect-error
145
- // eslint-disable-next-line
146
- /** @type {import('stac-ts').StacLink[]}*/(this.#collectionStac?.links)
147
- .filter((i) => i.rel === 'item')
148
- // sort by `datetime`, where oldest is first in array
149
- .sort((a, b) => ( /** @type {number} */(a.datetime) < /** @type {number} */(b.datetime) ? -1 : 1))
150
- );
151
- }
152
-
153
- getDates() {
154
- return (
155
- //@ts-expect-error
156
- // eslint-disable-next-line
157
- /** @type {import('stac-ts').StacLink[]}*/ (this.#collectionStac?.links)
158
- .filter((i) => i.rel === 'item')
159
- // sort by `datetime`, where oldest is first in array
160
- .sort((a, b) => ( /** @type {number} */(a.datetime) < /** @type {number} */(b.datetime) ? -1 : 1))
161
- .map((i) => new Date( /** @type {number} */(i.datetime)))
162
- );
163
- }
164
- }
@@ -1,40 +0,0 @@
1
-
2
- /**
3
- * @param {import("stac-ts").StacLink[]} links
4
- */
5
- export function generateFeatures(links) {
6
- /**
7
- * @type {{
8
- * type:string;
9
- * geometry:{
10
- * type: string;
11
- * coordinates: [number, number],
12
- * }
13
- * }[]}
14
- */
15
- const features = [];
16
- links.forEach(element => {
17
- if (element.rel === "item" && "latlng" in element) {
18
- //@ts-expect-error
19
- const [lat, lon] = element.latlng.split(",").map((/** @type {string} */it) => Number(it))
20
- features.push({
21
- type: 'Feature',
22
- geometry: {
23
- type: 'Point',
24
- coordinates: [lon, lat],
25
- },
26
- })
27
- }
28
- });
29
- const geojsonObject = {
30
- 'type': 'FeatureCollection',
31
- 'crs': {
32
- 'type': 'name',
33
- 'properties': {
34
- 'name': 'EPSG:4326',
35
- },
36
- },
37
- features,
38
- };
39
- return geojsonObject;
40
- }
@@ -1,28 +0,0 @@
1
- /**
2
- * loads font in the app using `webfontloader`
3
- * @param {string} [family="Roboto"]
4
- * @param {string} [link]
5
- * @returns {Promise<string>} - font family name
6
- * @see {@link "https://github.com/typekit/webfontloader "}
7
- */
8
- export const loadFont = async (family = "Roboto", link) => {
9
- const WebFontLoader = (await import('webfontloader')).default;
10
- if (link) {
11
- WebFontLoader.load({
12
- custom: {
13
- // Use FVD notation to include families https://github.com/typekit/fvd
14
- families: [family],
15
- // Path to stylesheet that defines font-face
16
- urls: [link],
17
- },
18
- });
19
- }
20
- else {
21
- WebFontLoader.load({
22
- google: {
23
- families: [family]
24
- }
25
- });
26
- }
27
- return family;
28
- };
@@ -1,59 +0,0 @@
1
- <template>
2
- <HeaderComponent v-if="!eodash.brand.noLayout" />
3
- <Suspense>
4
- <TemplateComponent @vue:mounted="onTemplateMount?.()"
5
- :style="`height: ${eodash.brand.noLayout ? (onTemplateMount ? '100%' : '90dvh') : 'calc(100dvh - ' + mainRect['top'] + mainRect['bottom'] + 'px)'}`" />
6
- <template #fallback>
7
- <div v-if="onTemplateMount" style="height: 100dvh; display: flex; align-items: center; justify-content: center;">
8
- <Loading />
9
- </div>
10
- </template>
11
- </Suspense>
12
- <FooterComponent v-if="!eodash.brand.noLayout" />
13
- </template>
14
-
15
- <script setup>
16
- import { useEodashRuntime } from "@/composables/DefineEodash";
17
- import { useURLSearchParametersSync, useUpdateTheme } from "@/composables";
18
- import { useSTAcStore } from '@/store/stac';
19
- import { defineAsyncComponent, onMounted } from "vue";
20
- import { useDisplay, useLayout } from "vuetify/lib/framework.mjs";
21
- import { loadFont } from '@/utils'
22
- import Loading from "@/components/Loading.vue";
23
-
24
- const props = defineProps({
25
- config: {
26
- type: String
27
- },
28
- onTemplateMount: {
29
- type: Function
30
- }
31
- })
32
-
33
- const eodash = await useEodashRuntime(props.config)
34
-
35
- useURLSearchParametersSync();
36
-
37
- const theme = useUpdateTheme('dashboardTheme', eodash.brand?.theme)
38
- theme.global.name.value = 'dashboardTheme'
39
-
40
- await loadFont(eodash.brand?.font?.family, eodash.brand?.font?.link)
41
-
42
- const { loadSTAC } = useSTAcStore()
43
- await loadSTAC()
44
-
45
- const { smAndDown } = useDisplay()
46
- const TemplateComponent = smAndDown.value ?
47
- defineAsyncComponent(() => import(`@/components/MobileLayout.vue`)) :
48
- defineAsyncComponent(() => import(`@/components/DashboardLayout.vue`))
49
-
50
- const HeaderComponent = defineAsyncComponent(() => import(`@/components/Header.vue`))
51
- const FooterComponent = defineAsyncComponent(() => import(`@/components/Footer.vue`))
52
- const { mainRect } = useLayout()
53
-
54
- onMounted(() => {
55
- const htmlTag = /** @type {HTMLElement} */(document.querySelector('html'))
56
- htmlTag.style.overflow = 'hidden';
57
- })
58
-
59
- </script>
@@ -1,31 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- declare module '*.vue' {
4
- import type { DefineComponent } from 'vue'
5
- const component: DefineComponent<{}, {}, any>
6
- export default component
7
- }
8
- declare interface Window {
9
- eodashStore: import("@/types").EodashStore
10
- }
11
- declare module '@eox/stacinfo' {
12
- export const EOxStacInfo: CustomElementConstructor
13
- }
14
- declare module '@eox/map' {
15
- export const EOxMap: CustomElementConstructor
16
- }
17
- declare module '@eox/itemfilter' {
18
- export const EOxItemFilter: CustomElementConstructor
19
- }
20
- declare module 'user:config' {
21
- const eodash: import("@/types").Eodash | Promise<import("@/types").Eodash>;
22
- export default eodash
23
- }
24
- declare module "stac-js" {
25
- const STAC: any, Collection: any, Item: any
26
- export { STAC, Collection, Item }
27
- }
28
- declare module "stac-js/src/http.js" {
29
- const toAbsolute: any
30
- export { toAbsolute }
31
- }