@eodash/eodash 5.0.0-processing → 5.0.0-rc
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/core/client/asWebComponent.js +2 -3
- package/core/client/components/DashboardLayout.vue +35 -17
- package/core/client/components/Loading.vue +6 -9
- package/core/client/components/MobileLayout.vue +16 -14
- package/core/client/composables/DefineEodash.js +13 -3
- package/core/client/composables/DefineTemplate.js +67 -0
- package/core/client/composables/DefineWidgets.js +3 -2
- package/core/client/composables/EodashMap.js +23 -12
- package/core/client/composables/EodashProcess.js +10 -11
- package/core/client/composables/index.js +35 -10
- package/core/client/eodash.js +381 -139
- package/core/client/{utils/eodashSTAC.js → eodashSTAC/EodashCollection.js} +75 -42
- package/core/client/{utils → eodashSTAC}/createLayers.js +10 -8
- package/core/client/{utils → eodashSTAC}/helpers.js +45 -68
- package/core/client/eodashSTAC/triggers.js +43 -0
- package/core/client/plugins/vuetify.js +2 -1
- package/core/client/store/{Actions.js → actions.js} +16 -2
- package/core/client/store/index.js +4 -18
- package/core/client/store/stac.js +4 -4
- package/core/client/store/{States.js → states.js} +2 -0
- package/{dist/types/core/client/types.d.ts → core/client/types.ts} +47 -8
- package/core/client/utils/states.js +8 -3
- package/core/client/views/Dashboard.vue +6 -4
- package/core/client/vite-env.d.ts +1 -1
- package/dist/client/{DashboardLayout-CVMJ4l8M.js → DashboardLayout-232tRmjz.js} +12 -15
- package/dist/client/{DynamicWebComponent-Cv8n457T.js → DynamicWebComponent-Cl4LqHU6.js} +1 -1
- package/dist/client/{EodashDatePicker-VVkiPmpc.js → EodashDatePicker-Pok6bZwU.js} +75 -163
- package/dist/client/EodashItemFilter-16eMMjTV.js +151 -0
- package/dist/client/{EodashLayerControl-53WghA8G.js → EodashLayerControl-De7IlCm_.js} +17 -7
- package/dist/client/EodashLayoutSwitcher-C-3-jjn5.js +52 -0
- package/dist/client/{EodashMap-CQnOePpy.js → EodashMap-CMvbfI6-.js} +101 -38
- package/dist/client/EodashMapBtns-BeknGDtc.js +107 -0
- package/dist/client/{EodashProcess-cF0unIy8.js → EodashProcess-BwKAa9Ee.js} +9 -10
- package/dist/client/EodashStacInfo-_BfonNUG.js +85 -0
- package/dist/client/EodashTools-PD3XPYuR.js +103 -0
- package/dist/client/{ExportState-BT8MLAW7.js → ExportState-DOrT7M15.js} +5 -5
- package/dist/client/{Footer-C6GUG84G.js → Footer-CCigxYBo.js} +1 -1
- package/dist/client/{Header-D2dtCWp8.js → Header-C2cdx4gb.js} +3 -3
- package/dist/client/{MobileLayout-BAo8Wr8T.js → MobileLayout-BdiFjHg7.js} +28 -31
- package/dist/client/{PopUp-Bm01q7Ko.js → PopUp--_xn1Cms.js} +29 -8
- package/dist/client/{VImg-B8AbetCE.js → VImg-9xu2l99m.js} +2 -2
- package/dist/client/{VMain-DnGlQUyr.js → VMain-BUs3kDTd.js} +1 -1
- package/dist/client/{VOverlay-B8Qj7LRG.js → VOverlay-D89omJis.js} +3 -3
- package/dist/client/VTooltip-CDu3bErh.js +86 -0
- package/dist/client/{WidgetsContainer-CwXRRLS1.js → WidgetsContainer-aFG9yFT6.js} +1 -1
- package/dist/client/{asWebComponent-DUUoR7MZ.js → asWebComponent-BRGyP_j5.js} +1374 -1052
- package/dist/client/{style.css → eo-dash.css} +1 -1
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-CZJhEAKW.js → forwardRefs-CYrR6bMw.js} +1 -1
- package/dist/client/{index-DlIO7sJ3.js → index-BZwk0V42.js} +1 -1
- package/dist/client/{transition-BiR8wMn1.js → transition-DG9nRSW4.js} +1 -1
- package/dist/node/cli.js +2 -2
- package/package.json +47 -33
- package/widgets/EodashDatePicker.vue +68 -54
- package/widgets/EodashItemFilter.vue +60 -105
- package/widgets/EodashLayerControl.vue +17 -4
- package/widgets/EodashLayoutSwitcher.vue +36 -0
- package/widgets/EodashMap.vue +26 -27
- package/widgets/EodashMapBtns.vue +41 -4
- package/widgets/EodashProcess.vue +4 -12
- package/widgets/EodashStacInfo.vue +82 -0
- package/widgets/EodashTools.vue +83 -0
- package/widgets/ExportState.vue +3 -3
- package/widgets/PopUp.vue +24 -2
- package/core/client/asWebComponent.d.ts +0 -23
- package/core/client/types.d.ts +0 -279
- package/dist/client/EodashItemFilter-CugWNQ86.js +0 -194
- package/dist/client/EodashMapBtns-uaRwFtfB.js +0 -66
- package/dist/types/core/client/App.vue.d.ts +0 -7
- package/dist/types/core/client/asWebComponent.d.ts +0 -9
- package/dist/types/core/client/components/DashboardLayout.vue.d.ts +0 -2
- package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +0 -18
- package/dist/types/core/client/components/ErrorAlert.vue.d.ts +0 -2
- package/dist/types/core/client/components/Footer.vue.d.ts +0 -2
- package/dist/types/core/client/components/Header.vue.d.ts +0 -2
- package/dist/types/core/client/components/IframeWrapper.vue.d.ts +0 -7
- package/dist/types/core/client/components/Loading.vue.d.ts +0 -2
- package/dist/types/core/client/components/MobileLayout.vue.d.ts +0 -2
- package/dist/types/core/client/composables/DefineEodash.d.ts +0 -2
- package/dist/types/core/client/composables/DefineTemplate.d.ts +0 -15
- package/dist/types/core/client/composables/DefineWidgets.d.ts +0 -14
- package/dist/types/core/client/composables/EodashMap.d.ts +0 -5
- package/dist/types/core/client/composables/index.d.ts +0 -30
- package/dist/types/core/client/eodash.d.ts +0 -8
- package/dist/types/core/client/main.d.ts +0 -2
- package/dist/types/core/client/plugins/axios.d.ts +0 -2
- package/dist/types/core/client/plugins/index.d.ts +0 -3
- package/dist/types/core/client/plugins/vuetify.d.ts +0 -82
- package/dist/types/core/client/render.d.ts +0 -1
- package/dist/types/core/client/store/Actions.d.ts +0 -12
- package/dist/types/core/client/store/States.d.ts +0 -22
- package/dist/types/core/client/store/index.d.ts +0 -2
- package/dist/types/core/client/store/stac.d.ts +0 -25
- package/dist/types/core/client/utils/createLayers.d.ts +0 -45
- package/dist/types/core/client/utils/eodashSTAC.d.ts +0 -82
- package/dist/types/core/client/utils/helpers.d.ts +0 -84
- package/dist/types/core/client/utils/index.d.ts +0 -2
- package/dist/types/core/client/utils/keys.d.ts +0 -6
- package/dist/types/core/client/utils/states.d.ts +0 -14
- package/dist/types/core/client/views/Dashboard.vue.d.ts +0 -9
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +0 -7
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +0 -42
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +0 -11
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +0 -9
- package/dist/types/widgets/EodashMap.vue.d.ts +0 -7
- package/dist/types/widgets/EodashMapBtns.vue.d.ts +0 -11
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +0 -21
- package/dist/types/widgets/EodashTools.vue.d.ts +0 -15
- package/dist/types/widgets/ExportState.vue.d.ts +0 -7
- package/dist/types/widgets/PopUp.vue.d.ts +0 -22
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +0 -7
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import App from "./App.vue";
|
|
2
2
|
import { defineCustomElement } from "vue";
|
|
3
3
|
import { registerPlugins } from "./plugins";
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* @type {import("vue").VueElementConstructor<
|
|
7
6
|
* import("vue").ExtractPropTypes<{ config: string }>>}
|
|
8
7
|
* */
|
|
9
|
-
export const
|
|
8
|
+
export const EodashConstructor = defineCustomElement(App, {
|
|
10
9
|
shadowRoot: false,
|
|
11
10
|
configureApp(app) {
|
|
12
11
|
registerPlugins(app);
|
|
@@ -14,7 +13,7 @@ export const Eodash = defineCustomElement(App, {
|
|
|
14
13
|
});
|
|
15
14
|
|
|
16
15
|
export function register() {
|
|
17
|
-
customElements.define("eo-dash",
|
|
16
|
+
customElements.define("eo-dash", EodashConstructor);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export { default as store } from "@/store";
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-main>
|
|
3
|
-
<eox-layout
|
|
4
|
-
:gap="eodash.template.gap ?? 16"
|
|
5
|
-
:style="`padding: ${eodash.template.gap || 16}px`"
|
|
6
|
-
>
|
|
3
|
+
<eox-layout :gap="gap" :style="`padding: ${gap}px`">
|
|
7
4
|
<eox-layout-item
|
|
8
|
-
v-if="bgWidget
|
|
5
|
+
v-if="bgWidget?.component"
|
|
9
6
|
class="bg-panel bg-surface"
|
|
10
|
-
:style="`margin: -${
|
|
7
|
+
:style="`margin: -${gap + 1}px;`"
|
|
11
8
|
x="0"
|
|
12
9
|
y="0"
|
|
13
10
|
h="12"
|
|
@@ -16,14 +13,15 @@
|
|
|
16
13
|
<Suspense suspensible>
|
|
17
14
|
<component
|
|
18
15
|
id="bg-widget"
|
|
19
|
-
:is="bgWidget
|
|
20
|
-
v-bind="bgWidget
|
|
16
|
+
:is="bgWidget?.component"
|
|
17
|
+
v-bind="bgWidget?.props"
|
|
21
18
|
/>
|
|
22
19
|
</Suspense>
|
|
23
20
|
</eox-layout-item>
|
|
24
21
|
<template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
|
|
25
22
|
<Transition name="fade">
|
|
26
23
|
<eox-layout-item
|
|
24
|
+
:id="importedWidget.value.id.toString()"
|
|
27
25
|
v-if="importedWidget.value.component"
|
|
28
26
|
:key="importedWidget.value.id"
|
|
29
27
|
class="panel bg-surface"
|
|
@@ -46,27 +44,21 @@
|
|
|
46
44
|
</v-main>
|
|
47
45
|
</template>
|
|
48
46
|
<script setup>
|
|
49
|
-
import { eodashKey } from "@/utils/keys";
|
|
50
|
-
import { inject } from "vue";
|
|
51
|
-
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
52
47
|
import "@eox/layout";
|
|
48
|
+
import { useDefineTemplate } from "@/composables/DefineTemplate";
|
|
53
49
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const [bgWidget] = useDefineWidgets([eodash.template?.background]);
|
|
57
|
-
|
|
58
|
-
const importedWidgets = useDefineWidgets(eodash.template?.widgets);
|
|
50
|
+
const { bgWidget, importedWidgets, gap } = useDefineTemplate();
|
|
59
51
|
</script>
|
|
60
52
|
<style scoped>
|
|
61
53
|
.panel {
|
|
62
54
|
position: relative;
|
|
63
55
|
overflow: visible;
|
|
64
56
|
z-index: 1;
|
|
65
|
-
border-radius: 0px;
|
|
66
57
|
}
|
|
67
58
|
|
|
68
59
|
.bg-panel {
|
|
69
60
|
z-index: 0;
|
|
61
|
+
border-radius: 0px !important;
|
|
70
62
|
}
|
|
71
63
|
|
|
72
64
|
.fade-enter-active,
|
|
@@ -78,4 +70,30 @@ const importedWidgets = useDefineWidgets(eodash.template?.widgets);
|
|
|
78
70
|
.fade-leave-to {
|
|
79
71
|
opacity: 0;
|
|
80
72
|
}
|
|
73
|
+
:deep(.bg-surface) {
|
|
74
|
+
backdrop-filter: blur(9.5px) !important;
|
|
75
|
+
background-color: rgba(
|
|
76
|
+
var(--v-theme-surface),
|
|
77
|
+
var(--v-surface-opacity, 0.8)
|
|
78
|
+
) !important;
|
|
79
|
+
border-radius: 4px;
|
|
80
|
+
border-style: solid;
|
|
81
|
+
border-width: 1px;
|
|
82
|
+
border-color: rgb(var(--v-theme-surface));
|
|
83
|
+
scrollbar-color: rgba(var(--v-theme-on-surface), 0.2) transparent;
|
|
84
|
+
scrollbar-width: thin;
|
|
85
|
+
}
|
|
86
|
+
:deep(.bg-primary) {
|
|
87
|
+
backdrop-filter: blur(9.5px) !important;
|
|
88
|
+
background-color: rgba(
|
|
89
|
+
var(--v-theme-primary),
|
|
90
|
+
var(--v-primary-opacity, 0.8)
|
|
91
|
+
) !important;
|
|
92
|
+
border-radius: 4px;
|
|
93
|
+
border-style: solid;
|
|
94
|
+
border-width: 1px;
|
|
95
|
+
border-color: rgb(var(--v-theme-primary));
|
|
96
|
+
scrollbar-color: rgba(var(--v-theme-on-primary), 0.2) transparent;
|
|
97
|
+
scrollbar-width: thin;
|
|
98
|
+
}
|
|
81
99
|
</style>
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<ErrorAlert v-model="error" />
|
|
5
5
|
<Suspense>
|
|
6
6
|
<component
|
|
7
|
-
v-if="loading
|
|
8
|
-
:is="loading
|
|
9
|
-
v-bind="loading
|
|
7
|
+
v-if="loading?.component"
|
|
8
|
+
:is="loading?.component"
|
|
9
|
+
v-bind="loading?.props"
|
|
10
10
|
></component>
|
|
11
11
|
<div v-else class="text-center">Loading...</div>
|
|
12
12
|
<template #fallback>
|
|
@@ -17,14 +17,11 @@
|
|
|
17
17
|
</v-row>
|
|
18
18
|
</template>
|
|
19
19
|
<script setup>
|
|
20
|
-
import {
|
|
21
|
-
import { eodashKey } from "@/utils/keys";
|
|
22
|
-
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
20
|
+
import { onErrorCaptured, ref } from "vue";
|
|
23
21
|
import ErrorAlert from "./ErrorAlert.vue";
|
|
22
|
+
import { useDefineTemplate } from "@/composables/DefineTemplate";
|
|
24
23
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const [loading] = useDefineWidgets([eodash.template.loading]);
|
|
24
|
+
const { loading } = useDefineTemplate();
|
|
28
25
|
|
|
29
26
|
const error = ref("");
|
|
30
27
|
onErrorCaptured((e, inst, info) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<Suspense suspensible>
|
|
4
4
|
<component
|
|
5
5
|
id="bg-widget"
|
|
6
|
-
v-if="bgWidget
|
|
6
|
+
v-if="bgWidget?.component"
|
|
7
7
|
:is="bgWidget.component"
|
|
8
8
|
v-bind="bgWidget.props"
|
|
9
9
|
></component>
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
id="overlay"
|
|
17
17
|
class="pa-2 panel bg-surface"
|
|
18
18
|
>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
<div class="d-flex py-2 justify-end align-end">
|
|
20
|
+
<v-btn icon variant="text" class="close-btn" @click="activeIdx = -1"
|
|
21
|
+
>✕</v-btn
|
|
22
|
+
>
|
|
23
|
+
</div>
|
|
22
24
|
<Suspense suspensible>
|
|
23
25
|
<div class="component-container" v-show="activeIdx === idx">
|
|
24
26
|
<component
|
|
@@ -48,18 +50,11 @@
|
|
|
48
50
|
</v-main>
|
|
49
51
|
</template>
|
|
50
52
|
<script setup>
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
53
|
+
import { useDefineTemplate } from "@/composables/DefineTemplate";
|
|
54
|
+
import { ref, onMounted } from "vue";
|
|
54
55
|
import { useLayout } from "vuetify";
|
|
55
56
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
//import widgets
|
|
59
|
-
const widgetsConfig = eodash.template.widgets;
|
|
60
|
-
const importedWidgets = useDefineWidgets(widgetsConfig);
|
|
61
|
-
const [bgWidget] = useDefineWidgets([eodash.template?.background]);
|
|
62
|
-
|
|
57
|
+
const { bgWidget, importedWidgets } = useDefineTemplate();
|
|
63
58
|
const { mainRect } = useLayout();
|
|
64
59
|
|
|
65
60
|
const activeIdx = ref(-1);
|
|
@@ -106,4 +101,11 @@ onMounted(() => {
|
|
|
106
101
|
position: relative;
|
|
107
102
|
z-index: 10;
|
|
108
103
|
}
|
|
104
|
+
:deep(.bg-surface) {
|
|
105
|
+
backdrop-filter: blur(9.5px) !important;
|
|
106
|
+
background-color: rgba(
|
|
107
|
+
var(--v-theme-surface),
|
|
108
|
+
var(--v-surface-opacity, 0.8)
|
|
109
|
+
) !important;
|
|
110
|
+
}
|
|
109
111
|
</style>
|
|
@@ -3,8 +3,7 @@ import { eodashKey } from "@/utils/keys";
|
|
|
3
3
|
import { inject } from "vue";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* it to `eodash`
|
|
6
|
+
* Handles importing user defined instance of Eodash
|
|
8
7
|
*
|
|
9
8
|
* @async
|
|
10
9
|
* @param {string | undefined} runtimeConfig
|
|
@@ -15,6 +14,17 @@ export const useEodashRuntime = async (runtimeConfig) => {
|
|
|
15
14
|
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
16
15
|
/** @param {import("@/types").Eodash} config */
|
|
17
16
|
const assignInstance = (config) => {
|
|
17
|
+
if ("template" in config) {
|
|
18
|
+
//@ts-expect-error to do
|
|
19
|
+
delete eodash.templates;
|
|
20
|
+
//@ts-expect-error to do
|
|
21
|
+
eodash.template = config.template;
|
|
22
|
+
} else if ("templates" in config) {
|
|
23
|
+
//@ts-expect-error to do
|
|
24
|
+
delete eodash.template;
|
|
25
|
+
//@ts-expect-error to do
|
|
26
|
+
eodash.templates = config.templates;
|
|
27
|
+
}
|
|
18
28
|
/** @type {(keyof import("@/types").Eodash)[]} */ (
|
|
19
29
|
Object.keys(eodash)
|
|
20
30
|
).forEach((key) => {
|
|
@@ -54,7 +64,7 @@ export const useEodashRuntime = async (runtimeConfig) => {
|
|
|
54
64
|
|
|
55
65
|
/**
|
|
56
66
|
* @param {((
|
|
57
|
-
* store: import("@/
|
|
67
|
+
* store: typeof import("@/store").default,
|
|
58
68
|
* ) => (Promise<import("@/types").Eodash> | import("@/types").Eodash))
|
|
59
69
|
* | import("@/types").Eodash} config
|
|
60
70
|
*/
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { eodashKey } from "@/utils/keys";
|
|
2
|
+
import { inject, ref, shallowReactive, shallowRef, toRefs, watch } from "vue";
|
|
3
|
+
import { useDefineWidgets } from "./DefineWidgets";
|
|
4
|
+
import { activeTemplate } from "@/store/states";
|
|
5
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
6
|
+
import log from "loglevel";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {{
|
|
10
|
+
* bgWidget:ReturnType< typeof import("./DefineWidgets").useDefineWidgets>[number]| import("vue").ShallowRef<null>
|
|
11
|
+
* loading: ReturnType< typeof import("./DefineWidgets").useDefineWidgets>[number]| import("vue").ShallowRef<null>
|
|
12
|
+
* importedWidgets:ReturnType< typeof import("./DefineWidgets").useDefineWidgets>
|
|
13
|
+
* gap: import("vue").Ref<number>
|
|
14
|
+
* }} DefinedTemplate
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
const useTemplate = () => {
|
|
18
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
19
|
+
|
|
20
|
+
/** @type {DefinedTemplate} */
|
|
21
|
+
const definedTemplate = shallowReactive({
|
|
22
|
+
bgWidget: shallowRef(null),
|
|
23
|
+
importedWidgets: [],
|
|
24
|
+
loading: shallowRef(null),
|
|
25
|
+
gap: ref(16),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if ("template" in eodash) {
|
|
29
|
+
[definedTemplate.bgWidget] = useDefineWidgets([eodash.template.background]);
|
|
30
|
+
[definedTemplate.loading] = useDefineWidgets([eodash.template.loading]);
|
|
31
|
+
definedTemplate.importedWidgets = useDefineWidgets(eodash.template.widgets);
|
|
32
|
+
definedTemplate.gap.value = eodash.template.gap ?? 16;
|
|
33
|
+
} else {
|
|
34
|
+
watch(
|
|
35
|
+
activeTemplate,
|
|
36
|
+
(template) => {
|
|
37
|
+
log.debug("Active template watcher triggered, changing to:", template);
|
|
38
|
+
if (!template) {
|
|
39
|
+
template = Object.keys(eodash.templates)[0];
|
|
40
|
+
activeTemplate.value = template ?? "";
|
|
41
|
+
log.debug("No template found, setting to first template", template);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!template || !eodash.templates[template]) {
|
|
45
|
+
console.error(`[eodash] template not found`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const templateConfig = eodash.templates[template];
|
|
50
|
+
[definedTemplate.bgWidget] = useDefineWidgets([
|
|
51
|
+
templateConfig.background,
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
[definedTemplate.loading] = useDefineWidgets([templateConfig.loading]);
|
|
55
|
+
|
|
56
|
+
definedTemplate.importedWidgets = useDefineWidgets(
|
|
57
|
+
templateConfig.widgets,
|
|
58
|
+
);
|
|
59
|
+
definedTemplate.gap.value = templateConfig.gap ?? 16;
|
|
60
|
+
},
|
|
61
|
+
{ immediate: true },
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return toRefs(definedTemplate);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const useDefineTemplate = createSharedComposable(useTemplate);
|
|
@@ -13,7 +13,9 @@ import { storeToRefs } from "pinia";
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
/** @typedef {import("vue").ShallowRef<DefinedWidget>} ReactiveDefinedWidget */
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Widgets import map that is created from eodash internals and user defined widgets
|
|
18
|
+
*/
|
|
17
19
|
const internalWidgets = (() => {
|
|
18
20
|
/** @type {Record<string, () => Promise<import("vue").Component>>} */
|
|
19
21
|
const importMap = {
|
|
@@ -44,7 +46,6 @@ const internalWidgets = (() => {
|
|
|
44
46
|
* | undefined
|
|
45
47
|
* )[]
|
|
46
48
|
* | undefined} widgetConfigs
|
|
47
|
-
* @returns {ReactiveDefinedWidget[]}
|
|
48
49
|
*/
|
|
49
50
|
export const useDefineWidgets = (widgetConfigs) => {
|
|
50
51
|
/** @type {ReactiveDefinedWidget[]} */
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { EodashCollection } from "@/
|
|
2
|
-
import { setMapProjFromCol } from "@/
|
|
1
|
+
import { EodashCollection } from "@/eodashSTAC/EodashCollection";
|
|
2
|
+
import { setMapProjFromCol } from "@/eodashSTAC/triggers";
|
|
3
3
|
import { nextTick, onMounted, onUnmounted, watch } from "vue";
|
|
4
4
|
import log from "loglevel";
|
|
5
5
|
import { useSTAcStore } from "@/store/stac";
|
|
6
6
|
import { storeToRefs } from "pinia";
|
|
7
7
|
import { useEventBus } from "@vueuse/core";
|
|
8
8
|
import { eoxLayersKey } from "@/utils/keys";
|
|
9
|
+
import { posIsSetFromUrl } from "@/utils/states";
|
|
9
10
|
/**
|
|
10
11
|
* Holder for previous compare map view as it is overwritten by sync
|
|
11
12
|
* @type { {map:import("ol").View } | null} mapElement
|
|
@@ -13,7 +14,7 @@ import { eoxLayersKey } from "@/utils/keys";
|
|
|
13
14
|
let viewHolder = null;
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* Handles updating {@link mapPosition} on movement on the map
|
|
17
18
|
*
|
|
18
19
|
* @param {import("vue").Ref<HTMLElement & Record<string,any> & {map:import("ol").Map } | null>} mapElement
|
|
19
20
|
* @param {import("vue").Ref<(number | undefined)[]>} mapPosition
|
|
@@ -33,6 +34,9 @@ export const useHandleMapMoveEnd = (mapElement, mapPosition) => {
|
|
|
33
34
|
!Number.isNaN(z)
|
|
34
35
|
) {
|
|
35
36
|
mapPosition.value = [lonlat[0], lonlat[1], z];
|
|
37
|
+
if (posIsSetFromUrl.value) {
|
|
38
|
+
posIsSetFromUrl.value = false;
|
|
39
|
+
}
|
|
36
40
|
}
|
|
37
41
|
};
|
|
38
42
|
|
|
@@ -74,7 +78,7 @@ const createLayersConfig = async (
|
|
|
74
78
|
type: "Group",
|
|
75
79
|
properties: {
|
|
76
80
|
id: "AnalysisGroup",
|
|
77
|
-
title: "
|
|
81
|
+
title: "Data Layers",
|
|
78
82
|
layerControlExpand: true,
|
|
79
83
|
},
|
|
80
84
|
layers: /** @type {Record<string,any>[]}*/ ([]),
|
|
@@ -99,7 +103,10 @@ const createLayersConfig = async (
|
|
|
99
103
|
const indicatorLayers =
|
|
100
104
|
//@ts-expect-error indicator is collection
|
|
101
105
|
await EodashCollection.getIndicatorLayers(selectedIndicator);
|
|
102
|
-
|
|
106
|
+
const geodbLayer = EodashCollection.getGeoDBLayer(eodashCols);
|
|
107
|
+
if (geodbLayer) {
|
|
108
|
+
dataLayers.layers.push(geodbLayer);
|
|
109
|
+
}
|
|
103
110
|
const baseLayers = {
|
|
104
111
|
type: "Group",
|
|
105
112
|
properties: {
|
|
@@ -194,7 +201,7 @@ const createLayersConfig = async (
|
|
|
194
201
|
};
|
|
195
202
|
|
|
196
203
|
/**
|
|
197
|
-
*
|
|
204
|
+
* Initializes the map and updates it based on changes in the selected indicator and datetime,
|
|
198
205
|
*
|
|
199
206
|
* @param {import("vue").Ref<HTMLElement & Record<string,any> | null>} mapElement
|
|
200
207
|
* @param {import("vue").Ref<import("stac-ts").StacCollection | null>} selectedIndicator
|
|
@@ -306,15 +313,16 @@ export const useInitMap = (
|
|
|
306
313
|
// indicator and map changes
|
|
307
314
|
if (
|
|
308
315
|
mapElement?.value?.id === "main" &&
|
|
309
|
-
updatedStac.extent?.spatial.bbox
|
|
316
|
+
updatedStac.extent?.spatial.bbox &&
|
|
317
|
+
!posIsSetFromUrl.value
|
|
310
318
|
) {
|
|
311
319
|
// Sanitize extent,
|
|
312
320
|
const b = updatedStac.extent?.spatial.bbox[0];
|
|
313
321
|
const sanitizedExtent = [
|
|
314
|
-
b[0] > -180 ? b[0] : -180,
|
|
315
|
-
b[1] > -90 ? b[1] : -90,
|
|
316
|
-
b[2] < 180 ? b[2] : 180,
|
|
317
|
-
b[3] < 90 ? b[3] : 90,
|
|
322
|
+
b?.[0] > -180 ? b?.[0] : -180,
|
|
323
|
+
b?.[1] > -90 ? b?.[1] : -90,
|
|
324
|
+
b?.[2] < 180 ? b?.[2] : 180,
|
|
325
|
+
b?.[3] < 90 ? b?.[3] : 90,
|
|
318
326
|
];
|
|
319
327
|
|
|
320
328
|
const reprojExtent = mapElement.value?.transformExtent(
|
|
@@ -322,9 +330,12 @@ export const useInitMap = (
|
|
|
322
330
|
"EPSG:4326",
|
|
323
331
|
mapElement.value?.map?.getView().getProjection(),
|
|
324
332
|
);
|
|
325
|
-
/** @type {
|
|
333
|
+
/** @type {import("@eox/map").EOxMap} */
|
|
326
334
|
(mapElement.value).zoomExtent = reprojExtent;
|
|
327
335
|
}
|
|
336
|
+
if (posIsSetFromUrl.value) {
|
|
337
|
+
posIsSetFromUrl.value = false;
|
|
338
|
+
}
|
|
328
339
|
|
|
329
340
|
log.debug(
|
|
330
341
|
"Assigned layers",
|
|
@@ -2,10 +2,10 @@ import { isMulti } from "@eox/jsonform/src/custom-inputs/spatial/utils";
|
|
|
2
2
|
import { nextTick, onMounted, watch } from "vue";
|
|
3
3
|
import mustache from "mustache";
|
|
4
4
|
import axios from "axios";
|
|
5
|
-
import { extractLayerConfig } from "@/
|
|
5
|
+
import { extractLayerConfig } from "@/eodashSTAC/helpers";
|
|
6
6
|
import log from "loglevel";
|
|
7
|
-
import { getLayers } from "@/store/
|
|
8
|
-
import { mapEl } from "@/store/
|
|
7
|
+
import { getLayers } from "@/store/actions";
|
|
8
|
+
import { mapEl } from "@/store/states";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Polls the process status and fetches a result item when the process is successful.
|
|
@@ -81,23 +81,19 @@ export async function pollProcessStatus({
|
|
|
81
81
|
* @param {import("vue").Ref<boolean>} autoExec
|
|
82
82
|
* @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} jsonformEl
|
|
83
83
|
* @param {import("vue").Ref<Record<string,any> | null>} jsonformSchema
|
|
84
|
-
* @param {import("vue").Ref<boolean>} isProcessed
|
|
85
84
|
* @param {() => Promise<void>} startProcess
|
|
86
85
|
**/
|
|
87
86
|
export function useAutoExec(
|
|
88
87
|
autoExec,
|
|
89
88
|
jsonformEl,
|
|
90
89
|
jsonformSchema,
|
|
91
|
-
isProcessed,
|
|
92
90
|
startProcess,
|
|
93
91
|
) {
|
|
94
92
|
/**
|
|
95
93
|
* @param {CustomEvent} _e
|
|
96
94
|
**/
|
|
97
95
|
const onJsonFormChange = async (_e) => {
|
|
98
|
-
|
|
99
|
-
await startProcess();
|
|
100
|
-
}
|
|
96
|
+
await startProcess();
|
|
101
97
|
};
|
|
102
98
|
|
|
103
99
|
const addEventListener = async () => {
|
|
@@ -382,10 +378,10 @@ export async function getChartValues(links, jsonformValue, specUrl) {
|
|
|
382
378
|
const spec = await axios.get(specUrl).then((resp) => {
|
|
383
379
|
return resp.data;
|
|
384
380
|
});
|
|
385
|
-
//@ts-expect-error NamedData
|
|
386
|
-
const dataName = spec?.data?.name;
|
|
381
|
+
// //@ts-expect-error NamedData
|
|
382
|
+
// const dataName = spec?.data?.name;
|
|
387
383
|
const dataLinks = links.filter(
|
|
388
|
-
(link) => link.rel === "service" && dataName && link.id === dataName,
|
|
384
|
+
(link) => link.rel === "service", // && dataName && link.id === dataName,
|
|
389
385
|
);
|
|
390
386
|
|
|
391
387
|
/** @type {Record<string,any>} */
|
|
@@ -460,6 +456,9 @@ export async function handleProcesses({
|
|
|
460
456
|
{ ...(jsonformValue ?? {}) },
|
|
461
457
|
specUrl,
|
|
462
458
|
);
|
|
459
|
+
if (chartSpec.value && !("background" in chartSpec.value)) {
|
|
460
|
+
chartSpec.value["background"] = "transparent";
|
|
461
|
+
}
|
|
463
462
|
const geotiffLayer = await processGeoTiff(
|
|
464
463
|
serviceLinks,
|
|
465
464
|
jsonformValue,
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
// functions of this folder can only be consumed inside setup stores,
|
|
2
|
-
// setup functions or vue composition api components
|
|
2
|
+
// setup functions or vue composition api components https://vuejs.org/guide/reusability/composables
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
+
activeTemplate,
|
|
5
6
|
currentCompareUrl,
|
|
6
7
|
currentUrl,
|
|
7
8
|
datetime,
|
|
8
9
|
indicator,
|
|
9
10
|
mapPosition,
|
|
10
|
-
} from "@/store/
|
|
11
|
+
} from "@/store/states";
|
|
11
12
|
import eodash from "@/eodash";
|
|
12
13
|
import { useTheme } from "vuetify/lib/framework.mjs";
|
|
13
|
-
import { onMounted, onUnmounted, watch } from "vue";
|
|
14
|
+
import { inject, onMounted, onUnmounted, watch } from "vue";
|
|
14
15
|
import { useSTAcStore } from "@/store/stac";
|
|
15
16
|
import log from "loglevel";
|
|
17
|
+
import { eodashKey, eoxLayersKey } from "@/utils/keys";
|
|
16
18
|
import { useEventBus } from "@vueuse/core";
|
|
17
|
-
import {
|
|
19
|
+
import { posIsSetFromUrl } from "@/utils/states";
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* Creates an absolute URL from a relative link and assignes it to `currentUrl`
|
|
@@ -23,11 +25,11 @@ import { eoxLayersKey } from "@/utils/keys";
|
|
|
23
25
|
* @param {string} [base=eodash.stacEndpoint] - Base URL, default value is the
|
|
24
26
|
* root stac catalog. Default is `eodash.stacEndpoint`
|
|
25
27
|
* @returns {import("vue").Ref<string>} - Returns `currentUrl`
|
|
26
|
-
* @see {@link '@/store/
|
|
28
|
+
* @see {@link '@/store/states.js'}
|
|
27
29
|
*/
|
|
28
30
|
export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
|
|
29
31
|
if (!rel || rel.includes("http")) {
|
|
30
|
-
currentUrl.value =
|
|
32
|
+
currentUrl.value = rel;
|
|
31
33
|
return currentUrl;
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -52,7 +54,7 @@ export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
|
|
|
52
54
|
* @param {string} [base=eodash.stacEndpoint] - Base URL, default value is the
|
|
53
55
|
* root stac catalog. Default is `eodash.stacEndpoint`
|
|
54
56
|
* @returns {import("vue").Ref<string>} - Returns `currentUrl`
|
|
55
|
-
* @see {@link '@/store/
|
|
57
|
+
* @see {@link '@/store/states.js'}
|
|
56
58
|
*/
|
|
57
59
|
export const useCompareAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
|
|
58
60
|
if (!rel || rel.includes("http")) {
|
|
@@ -119,6 +121,10 @@ export const useURLSearchParametersSync = () => {
|
|
|
119
121
|
z;
|
|
120
122
|
for (const [key, value] of searchParams) {
|
|
121
123
|
switch (key) {
|
|
124
|
+
case "template": {
|
|
125
|
+
activeTemplate.value = value;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
122
128
|
case "indicator": {
|
|
123
129
|
log.debug("Found indicator key in url");
|
|
124
130
|
const { loadSelectedSTAC, stac } = useSTAcStore();
|
|
@@ -160,12 +166,20 @@ export const useURLSearchParametersSync = () => {
|
|
|
160
166
|
if (x && y && z) {
|
|
161
167
|
log.debug("Coordinates found, applying map poisition", x, y, z);
|
|
162
168
|
mapPosition.value = [x, y, z];
|
|
169
|
+
if (!posIsSetFromUrl.value) {
|
|
170
|
+
posIsSetFromUrl.value = true;
|
|
171
|
+
}
|
|
163
172
|
}
|
|
164
173
|
}
|
|
165
174
|
|
|
166
175
|
watch(
|
|
167
|
-
[indicator, mapPosition, datetime],
|
|
168
|
-
([
|
|
176
|
+
[indicator, mapPosition, datetime, activeTemplate],
|
|
177
|
+
([
|
|
178
|
+
updatedIndicator,
|
|
179
|
+
updatedMapPosition,
|
|
180
|
+
updatedDatetime,
|
|
181
|
+
updatedTemplate,
|
|
182
|
+
]) => {
|
|
169
183
|
if ("URLSearchParams" in window) {
|
|
170
184
|
const searchParams = new URLSearchParams(window.location.search);
|
|
171
185
|
if (updatedIndicator !== "") {
|
|
@@ -181,6 +195,9 @@ export const useURLSearchParametersSync = () => {
|
|
|
181
195
|
if (updatedDatetime) {
|
|
182
196
|
searchParams.set("datetime", updatedDatetime.split("T")?.[0] ?? "");
|
|
183
197
|
}
|
|
198
|
+
if (updatedTemplate) {
|
|
199
|
+
searchParams.set("template", updatedTemplate);
|
|
200
|
+
}
|
|
184
201
|
const newRelativePathQuery =
|
|
185
202
|
window.location.pathname + "?" + searchParams.toString();
|
|
186
203
|
history.pushState(null, "", newRelativePathQuery);
|
|
@@ -190,7 +207,10 @@ export const useURLSearchParametersSync = () => {
|
|
|
190
207
|
});
|
|
191
208
|
};
|
|
192
209
|
|
|
193
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* Converts eox-layout-item to transparent
|
|
212
|
+
*
|
|
213
|
+
* @param {import("vue").Ref<HTMLElement|null>} root - components root element ref*/
|
|
194
214
|
export const makePanelTransparent = (root) => {
|
|
195
215
|
onMounted(() => {
|
|
196
216
|
const eoxItem = root.value?.parentElement;
|
|
@@ -200,6 +220,11 @@ export const makePanelTransparent = (root) => {
|
|
|
200
220
|
});
|
|
201
221
|
};
|
|
202
222
|
|
|
223
|
+
export const useGetTemplates = () => {
|
|
224
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
225
|
+
return "template" in eodash ? [] : Object.keys(eodash.templates);
|
|
226
|
+
};
|
|
227
|
+
|
|
203
228
|
/**
|
|
204
229
|
* Listens to the `layers:updated` and `time:updated` events and calls
|
|
205
230
|
*
|