@eodash/eodash 5.0.0-alpha.2 → 5.0.0-alpha.2.10
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.
- package/LICENSE +21 -0
- package/README.md +36 -3
- package/core/client/App.vue +26 -0
- package/core/client/SuspensedDashboard.ce.vue +105 -0
- package/core/client/asWebComponent.d.ts +23 -0
- package/core/client/asWebComponent.js +12 -0
- package/core/client/components/DashboardLayout.vue +77 -0
- package/core/client/components/DynamicWebComponent.vue +68 -0
- package/core/client/components/ErrorAlert.vue +36 -0
- package/core/{components → client/components}/Footer.vue +34 -15
- package/core/client/components/Header.vue +19 -0
- package/core/client/components/IframeWrapper.vue +11 -0
- package/core/client/components/Loading.vue +37 -0
- package/core/client/components/MobileLayout.vue +109 -0
- package/core/client/composables/DefineEodash.js +67 -0
- package/core/client/composables/DefineWidgets.js +161 -0
- package/core/client/composables/index.js +136 -0
- package/core/client/eodash.js +136 -0
- package/core/client/main.js +2 -0
- package/core/client/plugins/index.js +20 -0
- package/core/client/plugins/vuetify.js +35 -0
- package/core/client/render.js +12 -0
- package/core/client/store/Actions.js +62 -0
- package/core/client/store/States.js +21 -0
- package/core/client/store/index.js +20 -0
- package/core/client/store/stac.js +81 -0
- package/core/client/types.d.ts +287 -0
- package/core/client/utils/eodashSTAC.js +337 -0
- package/core/client/utils/helpers.js +172 -0
- package/core/client/utils/index.js +51 -0
- package/core/{utils → client/utils}/keys.js +2 -2
- package/core/client/views/Dashboard.vue +116 -0
- package/core/client/vite-env.d.ts +39 -0
- package/dist/client/DashboardLayout-C_3q8Y10.js +156 -0
- package/dist/{DynamicWebComponent-BDOQsEcj.js → client/DynamicWebComponent-IiTTLBt-.js} +11 -11
- package/dist/client/EodashDatePicker-DgC1lccp.js +252 -0
- package/dist/{eox-itemfilter-DcQkRD2l.js → client/EodashItemFilter-DoWZGe6r.js} +1515 -1381
- package/dist/client/EodashMap-C96D3LLv.js +114352 -0
- package/dist/client/EodashMapBtns-DDtzV94u.js +50 -0
- package/dist/client/ExportState-CduS2mFs.js +558 -0
- package/dist/client/Footer-DHQcutCv.js +115 -0
- package/dist/client/Header-DC0y7rLK.js +350 -0
- package/dist/{IframeWrapper-DYHQQRUh.js → client/IframeWrapper-BK-10FbS.js} +4 -4
- package/dist/client/MobileLayout-BpLoMY4i.js +945 -0
- package/dist/client/PopUp-CNMCWL0z.js +300 -0
- package/dist/client/VImg-DT7eb8V-.js +291 -0
- package/dist/client/VMain-OenWyy46.js +39 -0
- package/dist/client/VOverlay-x3UXpKhr.js +972 -0
- package/dist/{WidgetsContainer-D_PLP1qf.js → client/WidgetsContainer-qMUwtN0W.js} +26 -19
- package/dist/client/asWebComponent-DQrnLsI2.js +20404 -0
- package/dist/{basedecoder-Qm25PwVp-CHo5Pomv.js → client/basedecoder-DHcBySSe-BmCFNFnw.js} +5 -6
- package/dist/{decoder-kAoyGIq9-HAkjSTCt.js → client/decoder-Cth6J7EK-CtUoHA6r.js} +1 -1
- package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +10 -0
- package/dist/client/eo-dash.js +6 -0
- package/dist/client/eox-jsonform-DCErgjhw.js +17515 -0
- package/dist/client/eox-layercontrol-D0Ht7Mag.js +21298 -0
- package/dist/client/eox-stacinfo-l7ALSV90.js +13969 -0
- package/dist/client/forwardRefs-CpNjL95t.js +185 -0
- package/dist/client/helpers-KCSgmfim.js +1417 -0
- package/dist/{index-8ch8xKfa.js → client/index-DopVrUzM.js} +21 -20
- package/dist/{jpeg-DNfUpLwy-Fjan-04T.js → client/jpeg-BAgeD1d3-oeHbFPUL.js} +5 -6
- package/dist/{lerc-C9VL9kri-DyVxBvsf.js → client/lerc-BgbQqdFI-D986ErVw.js} +37 -39
- package/dist/{lzw-BOMhmEDy-Dboc93VO.js → client/lzw-LAGDNbSC-DkP96qO9.js} +1 -1
- package/dist/{packbits-DaUD6MLm-Bu1PoTGa.js → client/packbits-BlDR4Kj5-C66n1-zr.js} +1 -1
- package/dist/{pako.esm-C3kYPGGQ-BMki8cQY.js → client/pako.esm-CB1uQYY0-DB0PYm1P.js} +6 -12
- package/dist/{raw-CcGKjn8q-DFOt-i8n.js → client/raw-CMGvRjfu-BRi6E4i1.js} +1 -1
- package/dist/{ssrBoot-Cm5pWM14.js → client/ssrBoot-DkjdOWvj.js} +1 -1
- package/dist/client/style.css +5 -0
- package/dist/client/transition-BtJHh7JK.js +34 -0
- package/dist/{webfontloader-CyOFAuFB.js → client/webfontloader-qotgY98I.js} +56 -92
- package/dist/{webimage-D2c098k3-DLj1LQxB.js → client/webimage-BM_pbLN3-L2cGWK5l.js} +1 -1
- package/dist/node/cli.js +20 -0
- package/dist/node/main.js +2 -0
- package/dist/node/types.d.ts +47 -0
- package/package.json +54 -51
- package/widgets/EodashDatePicker.vue +145 -40
- package/widgets/EodashItemFilter.vue +73 -38
- package/widgets/EodashMap.vue +210 -37
- package/widgets/EodashMapBtns.vue +50 -0
- package/widgets/ExportState.vue +112 -0
- package/widgets/PopUp.vue +40 -0
- package/widgets/WidgetsContainer.vue +47 -27
- package/bin/app.js +0 -22
- package/bin/cli.js +0 -62
- package/bin/main.js +0 -9
- package/bin/serverConfig.js +0 -165
- package/bin/types.d.ts +0 -52
- package/bin/utils.js +0 -103
- package/core/App.vue +0 -19
- package/core/SuspensedDashboard.ce.vue +0 -59
- package/core/asWebComponent.d.ts +0 -18
- package/core/asWebComponent.js +0 -12
- package/core/components/DashboardLayout.vue +0 -54
- package/core/components/DynamicWebComponent.vue +0 -68
- package/core/components/Header.vue +0 -14
- package/core/components/IframeWrapper.vue +0 -11
- package/core/components/Loading.vue +0 -27
- package/core/components/MobileLayout.vue +0 -49
- package/core/composables/DefineEodash.js +0 -57
- package/core/composables/DefineWidgets.js +0 -129
- package/core/composables/index.js +0 -219
- package/core/eodash.js +0 -100
- package/core/main.js +0 -2
- package/core/plugins/index.js +0 -18
- package/core/plugins/vuetify.js +0 -30
- package/core/render.js +0 -13
- package/core/store/Actions.js +0 -0
- package/core/store/States.js +0 -21
- package/core/store/index.js +0 -17
- package/core/store/stac.js +0 -63
- package/core/types.d.ts +0 -355
- package/core/utils/eodashSTAC.js +0 -164
- package/core/utils/helpers.js +0 -40
- package/core/utils/index.js +0 -28
- package/core/views/Dashboard.vue +0 -59
- package/core/vite-env.d.ts +0 -31
- package/dist/DashboardLayout-YLfAa8wH.js +0 -168
- package/dist/EodashDatePicker-DlehqSgz.js +0 -1645
- package/dist/EodashItemFilter-TSp7XRGy.js +0 -51
- package/dist/EodashMap-DInb9cfS.js +0 -53405
- package/dist/Footer-CIzHgJbK.js +0 -118
- package/dist/Header-C5PSB8Uc.js +0 -609
- package/dist/MobileLayout-DZmqrpub.js +0 -523
- package/dist/VBtn-CFPhsIX8.js +0 -1106
- package/dist/VMain-deI9jyIf.js +0 -35
- package/dist/asWebComponent-BKe6Spni.js +0 -11323
- package/dist/color-D72nEBIR.js +0 -115
- package/dist/deflate-Be2Arps5-hDqMz3RA.js +0 -10
- package/dist/dimensions-BZkmIizV.js +0 -53
- package/dist/eo-dash.js +0 -6
- package/dist/eox-map-BJ9SIixs.js +0 -36205
- package/dist/eox-stacinfo-B-YrT7Ug.js +0 -13698
- package/dist/forwardRefs-Bxeu9Obx.js +0 -142
- package/dist/index-DIt8GjSR.js +0 -65
- package/dist/style.css +0 -5
- /package/dist/{.gitkeep → client/.gitkeep} +0 -0
- /package/dist/{_commonjsHelpers-DaMA6jEr.js → client/_commonjsHelpers-DaMA6jEr.js} +0 -0
package/core/types.d.ts
DELETED
|
@@ -1,355 +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: typeof import("./composables/DefineEodash").createEodash
|
|
354
|
-
/** @group EodashStore */
|
|
355
|
-
export declare const store: EodashStore
|
package/core/utils/eodashSTAC.js
DELETED
|
@@ -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
|
-
}
|
package/core/utils/helpers.js
DELETED
|
@@ -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
|
-
}
|
package/core/utils/index.js
DELETED
|
@@ -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
|
-
};
|
package/core/views/Dashboard.vue
DELETED
|
@@ -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 ? '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>
|
package/core/vite-env.d.ts
DELETED
|
@@ -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
|
-
}
|