@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
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
// functions of this folder can only be consumed inside setup stores,
|
|
2
|
-
// setup functions or vue composition api components
|
|
3
|
-
|
|
4
|
-
import { reactive } from "vue";
|
|
5
|
-
import { currentUrl, indicator, mapPosition } from "@/store/States";
|
|
6
|
-
import eodash from "@/eodash";
|
|
7
|
-
import { useTheme } from "vuetify/lib/framework.mjs";
|
|
8
|
-
import { onMounted, watch } from "vue";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Creates an absolute URL from a relative link and assignes it to `currentUrl`
|
|
12
|
-
* @param {string} [rel = '']
|
|
13
|
-
* @param {string} [base = eodash.stacEndpoint] - base URL, default value is the root stac catalog
|
|
14
|
-
* @returns {import('vue').Ref<string>} - returns `currentUrl`
|
|
15
|
-
* @see {@link '@/store/States.js'}
|
|
16
|
-
*/
|
|
17
|
-
export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
|
|
18
|
-
if (!rel || rel.includes("http")) {
|
|
19
|
-
currentUrl.value = base;
|
|
20
|
-
return currentUrl;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const st = base.split("/");
|
|
24
|
-
const arr = rel.split("/");
|
|
25
|
-
st.pop();
|
|
26
|
-
|
|
27
|
-
for (let i = 0; i < arr.length; i++) {
|
|
28
|
-
if (arr[i] == ".") continue;
|
|
29
|
-
if (arr[i] == "..") st.pop();
|
|
30
|
-
else st.push(arr[i]);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
currentUrl.value = st.join("/");
|
|
34
|
-
return currentUrl;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Adds slide in and out functionality to Elements
|
|
39
|
-
* @param {import('vue').Ref<HTMLElement[]|null>} elements - elements to add the functionality to
|
|
40
|
-
* @param {import("@/types").Widget[]} configs
|
|
41
|
-
*/
|
|
42
|
-
export const useSlidePanels = (elements, configs) => {
|
|
43
|
-
/**
|
|
44
|
-
* Sliding direction
|
|
45
|
-
*/
|
|
46
|
-
const slideDirs = configs.map((m) =>
|
|
47
|
-
m.layout.x == 0
|
|
48
|
-
? "left"
|
|
49
|
-
: m.layout.x == 12 - m.layout.w
|
|
50
|
-
? "right"
|
|
51
|
-
: m.layout.y < 6
|
|
52
|
-
? "up"
|
|
53
|
-
: "down"
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Array of sliding button's style and icons
|
|
58
|
-
*/
|
|
59
|
-
const slideBtns = slideDirs.map((dir, idx) => {
|
|
60
|
-
const btn = reactive({
|
|
61
|
-
style: {},
|
|
62
|
-
icon: { in: "", out: "" },
|
|
63
|
-
active: false,
|
|
64
|
-
enabled: true,
|
|
65
|
-
});
|
|
66
|
-
if (configs[idx].slidable === false) {
|
|
67
|
-
btn.enabled = false;
|
|
68
|
-
return btn;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
switch (dir) {
|
|
72
|
-
case "left":
|
|
73
|
-
btn.style = { top: "50%", right: "-11%" };
|
|
74
|
-
btn.icon.in = "mdi-chevron-double-right";
|
|
75
|
-
btn.icon.out = "mdi-chevron-double-left";
|
|
76
|
-
|
|
77
|
-
break;
|
|
78
|
-
case "right":
|
|
79
|
-
btn.style = { top: "50%", left: "-11%" };
|
|
80
|
-
btn.icon.in = "mdi-chevron-double-left";
|
|
81
|
-
btn.icon.out = "mdi-chevron-double-right";
|
|
82
|
-
|
|
83
|
-
break;
|
|
84
|
-
case "up":
|
|
85
|
-
btn.style = { right: "50%", bottom: "-17%" };
|
|
86
|
-
btn.icon.in = "mdi-chevron-double-down";
|
|
87
|
-
btn.icon.out = "mdi-chevron-double-up";
|
|
88
|
-
|
|
89
|
-
break;
|
|
90
|
-
case "down":
|
|
91
|
-
btn.style = { right: "50%", top: "-17%" };
|
|
92
|
-
btn.icon.in = "mdi-chevron-double-up";
|
|
93
|
-
btn.icon.out = "mdi-chevron-double-down";
|
|
94
|
-
break;
|
|
95
|
-
|
|
96
|
-
default:
|
|
97
|
-
console.error("sliding error");
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
return btn;
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Transforms the element's position based on the direction
|
|
105
|
-
* @param {number} idx - index of the pressed element
|
|
106
|
-
*/
|
|
107
|
-
const slideInOut = (idx) => {
|
|
108
|
-
const parentStyle = /** @type {CSSStyleDeclaration} */ (
|
|
109
|
-
elements.value?.[idx].style
|
|
110
|
-
);
|
|
111
|
-
if (parentStyle?.transform.length) {
|
|
112
|
-
slideBtns[idx].active = false;
|
|
113
|
-
parentStyle.transform = "";
|
|
114
|
-
} else {
|
|
115
|
-
slideBtns[idx].active = true;
|
|
116
|
-
parentStyle.transition = "transform 0.3s ease-in-out";
|
|
117
|
-
switch (slideDirs[idx]) {
|
|
118
|
-
case "left":
|
|
119
|
-
parentStyle.transform = "translateX(-100%)";
|
|
120
|
-
break;
|
|
121
|
-
case "right":
|
|
122
|
-
parentStyle.transform = "translateX(100%)";
|
|
123
|
-
break;
|
|
124
|
-
case "up":
|
|
125
|
-
parentStyle.transform = `translateY(-${(configs[idx].layout.y / configs[idx].layout.h) * 100 + 100
|
|
126
|
-
}%)`;
|
|
127
|
-
break;
|
|
128
|
-
case "down":
|
|
129
|
-
parentStyle.transform = `translateY(${(Math.max(0, 12 - configs[idx].layout.y - configs[idx].layout.h) /
|
|
130
|
-
configs[idx].layout.h) *
|
|
131
|
-
100 +
|
|
132
|
-
100
|
|
133
|
-
}%)`;
|
|
134
|
-
break;
|
|
135
|
-
|
|
136
|
-
default:
|
|
137
|
-
console.error("sliding error");
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
return { slideBtns, slideInOut };
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Updates an existing Vuetify theme.
|
|
147
|
-
* updates only the values provided in the `ThemeDefinition`
|
|
148
|
-
* @param {string} themeName - Name of the theme to be updated
|
|
149
|
-
* @param {import('vuetify').ThemeDefinition} [themeDefinition = {}] - New defintion to be updated to
|
|
150
|
-
* @returns {import('vuetify').ThemeInstance}
|
|
151
|
-
*/
|
|
152
|
-
export const useUpdateTheme = (themeName, themeDefinition = {}) => {
|
|
153
|
-
const theme = useTheme();
|
|
154
|
-
|
|
155
|
-
/** @type {Array<keyof import('vuetify').ThemeDefinition>} */ (
|
|
156
|
-
Object.keys(themeDefinition)
|
|
157
|
-
).forEach((key) => {
|
|
158
|
-
if (key === "dark") {
|
|
159
|
-
theme.themes.value[themeName][key] = /** @type {Boolean} */ (
|
|
160
|
-
themeDefinition[key]
|
|
161
|
-
);
|
|
162
|
-
} else {
|
|
163
|
-
//@ts-expect-error
|
|
164
|
-
theme.themes.value[themeName][key] = {
|
|
165
|
-
...theme.themes.value[themeName][key],
|
|
166
|
-
...themeDefinition[key],
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
return theme;
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Composable that syncs store and URLSearchParameters
|
|
175
|
-
*/
|
|
176
|
-
|
|
177
|
-
export const useURLSearchParametersSync = () => {
|
|
178
|
-
onMounted(() => {
|
|
179
|
-
// Analyze currently set url params when first loaded and set them in the store
|
|
180
|
-
if ('URLSearchParams' in window) {
|
|
181
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
182
|
-
let x, y, z;
|
|
183
|
-
searchParams.forEach((value, key) => {
|
|
184
|
-
if (key === "indicator") {
|
|
185
|
-
indicator.value = value;
|
|
186
|
-
}
|
|
187
|
-
if (key === "x") {
|
|
188
|
-
x = value;
|
|
189
|
-
}
|
|
190
|
-
if (key === "y") {
|
|
191
|
-
y = value;
|
|
192
|
-
}
|
|
193
|
-
if (key === "z") {
|
|
194
|
-
z = value;
|
|
195
|
-
}
|
|
196
|
-
})
|
|
197
|
-
if (x !== undefined && y !== undefined && z !== undefined) {
|
|
198
|
-
mapPosition.value = [x, y, z];
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
watch(
|
|
202
|
-
[indicator, mapPosition],
|
|
203
|
-
([updatedIndicator, updatedMapPosition]) => {
|
|
204
|
-
if ('URLSearchParams' in window) {
|
|
205
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
206
|
-
if (updatedIndicator !== "") {
|
|
207
|
-
searchParams.set("indicator", updatedIndicator);
|
|
208
|
-
}
|
|
209
|
-
if (updatedMapPosition && updatedMapPosition.length === 3) {
|
|
210
|
-
searchParams.set("x", updatedMapPosition[0]?.toFixed(4) ?? '');
|
|
211
|
-
searchParams.set("y", updatedMapPosition[1]?.toFixed(4) ?? '');
|
|
212
|
-
searchParams.set("z", updatedMapPosition[2]?.toFixed(4) ?? '');
|
|
213
|
-
}
|
|
214
|
-
const newRelativePathQuery = window.location.pathname + '?' + searchParams.toString();
|
|
215
|
-
history.pushState(null, '', newRelativePathQuery);
|
|
216
|
-
}
|
|
217
|
-
})
|
|
218
|
-
});
|
|
219
|
-
};
|
package/core/eodash.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { reactive } from "vue";
|
|
2
|
-
import { currentUrl } from "./store/States";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Reactive Edoash Instance Object. provided globally in the app,
|
|
6
|
-
* and used as an intermediate object to make user defined instances config reactive.
|
|
7
|
-
* @type {import("./types").Eodash}
|
|
8
|
-
*/
|
|
9
|
-
export const eodash = reactive({
|
|
10
|
-
id: "demo",
|
|
11
|
-
stacEndpoint: "https://esa-eodash.github.io/RACE-catalog/RACE/catalog.json",
|
|
12
|
-
brand: {
|
|
13
|
-
noLayout: true,
|
|
14
|
-
name: "Demo",
|
|
15
|
-
font: {
|
|
16
|
-
family: "Roboto",
|
|
17
|
-
},
|
|
18
|
-
theme: {
|
|
19
|
-
colors: {
|
|
20
|
-
primary: "#fff",
|
|
21
|
-
secondary: "#fff",
|
|
22
|
-
surface: "#fff",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
footerText: "Demo configuration of eodash client",
|
|
26
|
-
},
|
|
27
|
-
template: {
|
|
28
|
-
loading: {
|
|
29
|
-
id: Symbol(),
|
|
30
|
-
type: "web-component",
|
|
31
|
-
widget: {
|
|
32
|
-
// https://uiball.com/ldrs/
|
|
33
|
-
link: "https://cdn.jsdelivr.net/npm/ldrs/dist/auto/mirage.js",
|
|
34
|
-
tagName: "l-mirage",
|
|
35
|
-
properties: {
|
|
36
|
-
class: "align-self-center justify-self-center",
|
|
37
|
-
size: "120",
|
|
38
|
-
speed: "2.5",
|
|
39
|
-
color: "#004170"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
background: {
|
|
44
|
-
id: Symbol(),
|
|
45
|
-
type: "internal",
|
|
46
|
-
widget: {
|
|
47
|
-
name: "EodashMap",
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
widgets: [
|
|
51
|
-
{
|
|
52
|
-
id: Symbol(),
|
|
53
|
-
type: "internal",
|
|
54
|
-
title: "itemfilter",
|
|
55
|
-
layout: { x: 0, y: 0, w: 3, h: 12 },
|
|
56
|
-
slidable: false,
|
|
57
|
-
widget: {
|
|
58
|
-
name: "EodashItemFilter",
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: Symbol(),
|
|
63
|
-
type: "internal",
|
|
64
|
-
title: "datepicker",
|
|
65
|
-
layout: { x: 5, y: 11, w: 2, h: 1 },
|
|
66
|
-
slidable: false,
|
|
67
|
-
widget: {
|
|
68
|
-
name: "EodashDatePicker",
|
|
69
|
-
properties: {
|
|
70
|
-
inline: true,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
id: Symbol(),
|
|
76
|
-
title: "Information",
|
|
77
|
-
layout: { x: 9, y: 0, w: 3, h: 12 },
|
|
78
|
-
widget: {
|
|
79
|
-
link: async () => await import("@eox/stacinfo"),
|
|
80
|
-
properties: {
|
|
81
|
-
for: currentUrl,
|
|
82
|
-
allowHtml: "true",
|
|
83
|
-
styleOverride:
|
|
84
|
-
"#properties li > .value {font-weight: normal !important;}",
|
|
85
|
-
header: "[]",
|
|
86
|
-
|
|
87
|
-
subheader: "[]",
|
|
88
|
-
properties: '["description"]',
|
|
89
|
-
featured: "[]",
|
|
90
|
-
footer: "[]",
|
|
91
|
-
},
|
|
92
|
-
tagName: "eox-stacinfo",
|
|
93
|
-
},
|
|
94
|
-
type: "web-component",
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
export default eodash;
|
package/core/main.js
DELETED
package/core/plugins/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import vuetify from './vuetify';
|
|
2
|
-
import { createPinia } from 'pinia';
|
|
3
|
-
import eodash from '@/eodash';
|
|
4
|
-
import { eodashKey } from '@/utils/keys';
|
|
5
|
-
import store from '../store';
|
|
6
|
-
|
|
7
|
-
export const pinia = createPinia();
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @param {import('vue').App} app
|
|
11
|
-
*/
|
|
12
|
-
export function registerPlugins(app) {
|
|
13
|
-
window.eodashStore = store;
|
|
14
|
-
|
|
15
|
-
app.use(vuetify)
|
|
16
|
-
.use(pinia)
|
|
17
|
-
.provide(eodashKey, eodash);
|
|
18
|
-
}
|
package/core/plugins/vuetify.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* plugins/vuetify.ts
|
|
3
|
-
*
|
|
4
|
-
* Framework documentation: https://vuetifyjs.com`
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// Styles
|
|
8
|
-
import '@mdi/font/css/materialdesignicons.css';
|
|
9
|
-
import 'vuetify/styles';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { createVuetify } from 'vuetify';
|
|
13
|
-
// import {} from "vuetify"
|
|
14
|
-
|
|
15
|
-
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
|
|
16
|
-
const vuetify = createVuetify({
|
|
17
|
-
theme: {
|
|
18
|
-
themes: {
|
|
19
|
-
dashboardTheme: {},
|
|
20
|
-
light: {
|
|
21
|
-
colors: {
|
|
22
|
-
primary: '#1867C0',
|
|
23
|
-
secondary: '#5CBBF6',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
export default vuetify
|
package/core/render.js
DELETED
package/core/store/Actions.js
DELETED
|
File without changes
|
package/core/store/States.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* currently selected STAC endpoint
|
|
5
|
-
*/
|
|
6
|
-
export const currentUrl = ref('');
|
|
7
|
-
/**
|
|
8
|
-
* currently selected datetime
|
|
9
|
-
*/
|
|
10
|
-
export const datetime = ref(new Date().toISOString());
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Currently selected indicator
|
|
14
|
-
*/
|
|
15
|
-
export const indicator = ref("")
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Current map position
|
|
19
|
-
* @type {import("vue").Ref<(number|undefined)[]>}
|
|
20
|
-
*/
|
|
21
|
-
export const mapPosition = ref([])
|
package/core/store/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//export all actions, states, and pinia stores
|
|
2
|
-
|
|
3
|
-
const storesImport = import.meta.glob('../store/**.js', { eager: true })
|
|
4
|
-
|
|
5
|
-
const store = /** @type {import("@/types").EodashStore} */((() => {
|
|
6
|
-
const stores = {}
|
|
7
|
-
for (const [filePath, importedstore] of Object.entries(storesImport)) {
|
|
8
|
-
const storeType = filePath.split('/').at(-1)?.slice(0, -3).toLowerCase() ?? ''
|
|
9
|
-
if (!['keys'].includes(storeType)) {
|
|
10
|
-
//@ts-expect-error
|
|
11
|
-
stores[storeType] = importedstore;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return stores;
|
|
15
|
-
})());
|
|
16
|
-
|
|
17
|
-
export default store;
|
package/core/store/stac.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia';
|
|
2
|
-
import { inject, ref } from 'vue';
|
|
3
|
-
import axios from 'axios';
|
|
4
|
-
import { useAbsoluteUrl } from '@/composables/index';
|
|
5
|
-
import { eodashKey } from '@/utils/keys';
|
|
6
|
-
import { indicator } from '@/store/States';
|
|
7
|
-
|
|
8
|
-
export const useSTAcStore = defineStore('stac', () => {
|
|
9
|
-
/**
|
|
10
|
-
* links of the root STAC catalog
|
|
11
|
-
* @type {import("vue").Ref<import('stac-ts').StacLink[]|null>}
|
|
12
|
-
*/
|
|
13
|
-
const stac = ref(null);
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* selected STAC object.
|
|
17
|
-
* @type {import('vue').Ref<import('stac-ts').StacCatalog |
|
|
18
|
-
* import('stac-ts').StacCollection |import('stac-ts').StacItem
|
|
19
|
-
* | null>}
|
|
20
|
-
*/
|
|
21
|
-
const selectedStac = ref(null);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const eodash = /** @type {import("@/types").Eodash} */(inject(eodashKey));
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* fetches root stac catalog and assign it to `stac`
|
|
28
|
-
* @async
|
|
29
|
-
* @param {import("@/types").StacEndpoint} [url = eodash.stacEndpoint]
|
|
30
|
-
* @returns {Promise<void>}
|
|
31
|
-
* @see {@link stac}
|
|
32
|
-
*/
|
|
33
|
-
async function loadSTAC(url = eodash.stacEndpoint) {
|
|
34
|
-
await axios.get(url).then(resp => {
|
|
35
|
-
const links = /** @type {import('stac-ts').StacCatalog} */(resp.data).links.map(link => {
|
|
36
|
-
if (!link.title) {
|
|
37
|
-
link.title = `${link.rel} ${link.href}`
|
|
38
|
-
}
|
|
39
|
-
return link
|
|
40
|
-
})
|
|
41
|
-
stac.value = links;
|
|
42
|
-
}).catch(err => console.error(err));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* fetches selected stac object and assign it to `selectedStac`
|
|
47
|
-
* @async
|
|
48
|
-
* @param {string} relativePath - stac link href
|
|
49
|
-
* @returns {Promise<void>}
|
|
50
|
-
* @see {@link selectedStac}
|
|
51
|
-
*/
|
|
52
|
-
async function loadSelectedSTAC(relativePath = '') {
|
|
53
|
-
|
|
54
|
-
const absoluteUrl = useAbsoluteUrl(relativePath);
|
|
55
|
-
|
|
56
|
-
await axios.get(absoluteUrl.value).then(resp => {
|
|
57
|
-
selectedStac.value = resp.data;
|
|
58
|
-
indicator.value = selectedStac.value?.id ?? "";
|
|
59
|
-
}).catch(err => console.error(err));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return { stac, loadSTAC, loadSelectedSTAC, selectedStac };
|
|
63
|
-
});
|