@eodash/eodash 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/client/components/DashboardLayout.vue +0 -1
- package/core/client/composables/index.js +53 -59
- package/core/client/eodashSTAC/EodashCollection.js +196 -94
- package/core/client/eodashSTAC/auth.js +86 -0
- package/core/client/eodashSTAC/createLayers.js +204 -4
- package/core/client/eodashSTAC/helpers.js +258 -58
- package/core/client/eodashSTAC/parquet.js +0 -13
- package/core/client/eodashSTAC/triggers.js +1 -1
- package/core/client/store/actions.js +14 -0
- package/core/client/store/stac.js +46 -8
- package/core/client/store/states.js +6 -0
- package/core/client/types.ts +206 -3
- package/core/client/utils/bands-editor/arithmetic.js +144 -0
- package/core/client/utils/bands-editor/colors.js +36 -0
- package/core/client/utils/bands-editor/dom.js +196 -0
- package/core/client/utils/bands-editor/exampleSchema.json +1320 -0
- package/core/client/utils/bands-editor/index.js +68 -0
- package/core/client/utils/bands-editor/rgb.js +102 -0
- package/core/client/utils/index.js +5 -2
- package/core/client/views/Dashboard.vue +1 -1
- package/core/client/vite-env.d.ts +122 -0
- package/dist/client/{DashboardLayout-Dq9Kfe6O.js → DashboardLayout-Cq15p4TH.js} +4 -5
- package/dist/client/{DynamicWebComponent-DCBMXskE.js → DynamicWebComponent-Cv-fPRG1.js} +1 -1
- package/dist/client/{EodashDatePicker-DtngxU6s.js → EodashDatePicker-CPlJwEIO.js} +20 -22
- package/dist/client/{EodashItemFilter-ClQebJQt.js → EodashItemFilter-Ydebgbjj.js} +46 -31
- package/dist/client/EodashLayerControl-COhrkNEs.js +1517 -0
- package/dist/client/{EodashLayoutSwitcher-DQ8SfVDd.js → EodashLayoutSwitcher-pnKhTRZV.js} +4 -4
- package/dist/client/EodashMapBtns-Cj0Fx119.js +301 -0
- package/dist/client/{EodashStacInfo-Dt1nF06x.js → EodashStacInfo-Dadkg_Nj.js} +1 -1
- package/dist/client/EodashTimeSlider-CpoHX0S7.js +53 -0
- package/dist/client/{EodashTools-DV5ykmWc.js → EodashTools-UGBG7KC9.js} +10 -7
- package/dist/client/{ExportState-B6zZQUmE.js → ExportState-GtJkAqeZ.js} +145 -120
- package/dist/client/{Footer-DNhXs8k6.js → Footer-D3ZPG5c4.js} +1 -1
- package/dist/client/{Header-BjhN5JY4.js → Header-z6AK-wpN.js} +2 -2
- package/dist/client/MobileLayout-BXNsNftb.js +118 -0
- package/dist/client/{PopUp-CgpvNr3o.js → PopUp-BbQdjENV.js} +79 -43
- package/dist/client/{ProcessList-vecpxThi.js → ProcessList-C6VsdsYI.js} +5 -6
- package/dist/client/{VImg-CETuikH2.js → VImg-CxaMSB99.js} +6 -3
- package/dist/client/{VMain-Ci9DyaGU.js → VMain-Ds7yw0wj.js} +1 -1
- package/dist/client/{VTooltip-J4ac48X7.js → VTooltip-Cze6CEVh.js} +2 -2
- package/dist/client/{WidgetsContainer-CCML4TyV.js → WidgetsContainer-D66bj-JJ.js} +1 -1
- package/dist/client/asWebComponent-CWbNRdf9.js +8895 -0
- package/dist/client/{async-B7jIrM53.js → async-BA7oWCMX.js} +2 -2
- package/dist/client/easing-CH0-9wR8.js +35 -0
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-BQclvjMq.js → forwardRefs-BUfxOIo-.js} +58 -45
- package/dist/client/{handling-BS24aG1q.js → handling-DlNTtKB-.js} +12 -6
- package/dist/client/{helpers-wXK7Ywio.js → helpers-CtE0W7iu.js} +572 -277
- package/dist/client/{index-4UCzZi8B.js → index-CeEZIjO6.js} +26 -13
- package/dist/client/{index-B2XpdgR6.js → index-CsKbRDeN.js} +63 -36
- package/dist/client/{index-9KR-G20t.js → index-D4_NRKrf.js} +2 -2
- package/dist/client/index-DeECc3lV.js +571 -0
- package/dist/client/templates.js +82 -15
- package/dist/client/{transition-yBii4fu6.js → transition-Byvp3L6Y.js} +1 -1
- package/dist/node/cli.js +6 -6
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +24 -10
- package/dist/types/core/client/eodashSTAC/auth.d.ts +7 -0
- package/dist/types/core/client/eodashSTAC/createLayers.d.ts +15 -3
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +46 -15
- package/dist/types/core/client/plugins/vuetify.d.ts +14 -14
- package/dist/types/core/client/store/actions.d.ts +2 -0
- package/dist/types/core/client/store/stac.d.ts +16 -7
- package/dist/types/core/client/store/states.d.ts +4 -0
- package/dist/types/core/client/types.d.ts +170 -2
- package/dist/types/core/client/utils/bands-editor/arithmetic.d.ts +8 -0
- package/dist/types/core/client/utils/bands-editor/colors.d.ts +15 -0
- package/dist/types/core/client/utils/bands-editor/dom.d.ts +42 -0
- package/dist/types/core/client/utils/bands-editor/index.d.ts +20 -0
- package/dist/types/core/client/utils/bands-editor/rgb.d.ts +15 -0
- package/dist/types/core/client/utils/index.d.ts +1 -1
- package/dist/types/templates/baseConfig.d.ts +87 -1
- package/dist/types/templates/expert.d.ts +6 -6
- package/dist/types/templates/explore.d.ts +67 -0
- package/dist/types/templates/index.d.ts +1 -1
- package/dist/types/templates/{light.d.ts → lite.d.ts} +5 -5
- package/dist/types/widgets/EodashItemCatalog/index.vue.d.ts +21 -0
- package/dist/types/widgets/EodashItemCatalog/methods/filters.d.ts +49 -0
- package/dist/types/widgets/EodashItemCatalog/methods/handlers.d.ts +4 -0
- package/dist/types/widgets/EodashItemCatalog/methods/map.d.ts +12 -0
- package/dist/types/widgets/EodashItemCatalog/types.d.ts +14 -0
- package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +2 -0
- package/dist/types/widgets/EodashMap/index.vue.d.ts +108 -2
- package/dist/types/widgets/EodashMap/methods/create-layers-config.d.ts +1 -1
- package/dist/types/widgets/EodashMap/methods/index.d.ts +1 -1
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +1 -1
- package/dist/types/widgets/EodashTimeSlider.vue.d.ts +7 -0
- package/dist/types/widgets/EodashTools.vue.d.ts +10 -10
- package/dist/types/widgets/ExportState.vue.d.ts +2 -0
- package/package.json +28 -27
- package/templates/baseConfig.js +10 -5
- package/templates/compare.js +2 -2
- package/templates/expert.js +5 -5
- package/templates/explore.js +62 -0
- package/templates/index.js +1 -1
- package/templates/{light.js → lite.js} +1 -1
- package/widgets/EodashDatePicker.vue +15 -18
- package/widgets/EodashItemCatalog/index.vue +161 -0
- package/widgets/EodashItemCatalog/methods/filters.js +216 -0
- package/widgets/EodashItemCatalog/methods/handlers.js +50 -0
- package/widgets/EodashItemCatalog/methods/map.js +144 -0
- package/widgets/EodashItemCatalog/types.ts +15 -0
- package/widgets/EodashItemFilter.vue +35 -28
- package/widgets/EodashLayerControl.vue +10 -6
- package/widgets/EodashLayoutSwitcher.vue +1 -1
- package/widgets/EodashMap/EodashMapBtns.vue +18 -9
- package/widgets/EodashMap/index.vue +22 -12
- package/widgets/EodashMap/methods/create-layers-config.js +9 -6
- package/widgets/EodashMap/methods/index.js +27 -13
- package/widgets/EodashProcess/index.vue +17 -1
- package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +9 -3
- package/widgets/EodashProcess/methods/handling.js +2 -0
- package/widgets/EodashProcess/methods/outputs.js +1 -0
- package/widgets/EodashTimeSlider.vue +40 -0
- package/widgets/EodashTools.vue +7 -3
- package/widgets/ExportState.vue +53 -22
- package/dist/client/EodashLayerControl-BLBds28C.js +0 -154
- package/dist/client/EodashMapBtns-B89_YBDw.js +0 -326
- package/dist/client/MobileLayout-JelB6w1G.js +0 -118
- package/dist/client/asWebComponent-ZyEzWOOf.js +0 -19092
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
:key="mapElement"
|
|
6
6
|
v-bind="config"
|
|
7
7
|
:for="mapElement"
|
|
8
|
+
.customEditorInterfaces="bandsEditorInterface"
|
|
8
9
|
@datetime:updated="debouncedHandleDateTime"
|
|
9
10
|
toolsAsList="true"
|
|
10
|
-
style="--eox-background-color: transparent"
|
|
11
11
|
ref="eoxLayercontrol"
|
|
12
12
|
@layerConfig:change="onLayerConfigChange"
|
|
13
13
|
>
|
|
@@ -22,12 +22,8 @@
|
|
|
22
22
|
</span>
|
|
23
23
|
</template>
|
|
24
24
|
<script setup>
|
|
25
|
-
import "@eox/layercontrol";
|
|
26
|
-
|
|
27
|
-
import "@eox/jsonform";
|
|
28
|
-
import "@eox/timecontrol";
|
|
29
25
|
import "color-legend-element";
|
|
30
|
-
|
|
26
|
+
import "@eox/timecontrol";
|
|
31
27
|
import { computed, ref } from "vue";
|
|
32
28
|
import { mapEl, mapCompareEl } from "@/store/states";
|
|
33
29
|
import { getColFromLayer } from "@/eodashSTAC/helpers";
|
|
@@ -39,6 +35,14 @@ import {
|
|
|
39
35
|
} from "@/utils/states";
|
|
40
36
|
import { storeToRefs } from "pinia";
|
|
41
37
|
import { useSTAcStore } from "@/store/stac";
|
|
38
|
+
import { bandsEditorInterface } from "@/utils/bands-editor";
|
|
39
|
+
|
|
40
|
+
if (!customElements.get("eox-layercontrol")) {
|
|
41
|
+
await import("@eox/layercontrol");
|
|
42
|
+
}
|
|
43
|
+
if (!customElements.get("eox-jsonform")) {
|
|
44
|
+
await import("@eox/jsonform");
|
|
45
|
+
}
|
|
42
46
|
|
|
43
47
|
const props = defineProps({
|
|
44
48
|
map: {
|
|
@@ -86,15 +86,8 @@
|
|
|
86
86
|
:height="popupHeight"
|
|
87
87
|
>
|
|
88
88
|
<EodashItemFilter
|
|
89
|
+
v-bind="itemFilterConfig"
|
|
89
90
|
:enableCompare="true"
|
|
90
|
-
:enableHighlighting="false"
|
|
91
|
-
resultType="cards"
|
|
92
|
-
style="--select-filter-max-items: 8"
|
|
93
|
-
filters-title="Select an indicator to compare"
|
|
94
|
-
subTitleProperty="subtitle"
|
|
95
|
-
imageProperty="thumbnail"
|
|
96
|
-
aggregateResults="collection_group"
|
|
97
|
-
results-title=""
|
|
98
91
|
@select="onSelectCompareIndicator"
|
|
99
92
|
/>
|
|
100
93
|
</PopUp>
|
|
@@ -148,7 +141,11 @@ const {
|
|
|
148
141
|
default: true,
|
|
149
142
|
},
|
|
150
143
|
compareIndicators: {
|
|
151
|
-
/** @type {import("vue").PropType<boolean | {
|
|
144
|
+
/** @type {import("vue").PropType<boolean | {
|
|
145
|
+
compareTemplate?:string;
|
|
146
|
+
fallbackTemplate?:string;
|
|
147
|
+
itemFilterConfig?:Partial<InstanceType<import("./EodashItemFilter.vue").default>["$props"]>
|
|
148
|
+
}> }*/
|
|
152
149
|
type: [Boolean, Object],
|
|
153
150
|
default: true,
|
|
154
151
|
},
|
|
@@ -181,6 +178,18 @@ const compareIcon = computed(() =>
|
|
|
181
178
|
? mdiCompareRemove
|
|
182
179
|
: mdiCompare,
|
|
183
180
|
);
|
|
181
|
+
const itemFilterConfig = {
|
|
182
|
+
enableHighlighting: false,
|
|
183
|
+
resultType: "cards",
|
|
184
|
+
style: "--select-filter-max-items: 8",
|
|
185
|
+
"filters-title": "Select an indicator to compare",
|
|
186
|
+
subTitleProperty: "subtitle",
|
|
187
|
+
imageProperty: "thumbnail",
|
|
188
|
+
aggregateResults: "collection_group",
|
|
189
|
+
"results-title": "",
|
|
190
|
+
...(typeof compareIndicators === "object" &&
|
|
191
|
+
compareIndicators.itemFilterConfig),
|
|
192
|
+
};
|
|
184
193
|
|
|
185
194
|
const onCompareClick = () => {
|
|
186
195
|
showCompareIndicators.value =
|
|
@@ -43,26 +43,22 @@
|
|
|
43
43
|
class="map-buttons-container"
|
|
44
44
|
:style="`margin: ${btnsPosition.gap}px 0 ${btnsPosition.gap}px 0`"
|
|
45
45
|
>
|
|
46
|
+
<!-- prettier-ignore -->
|
|
46
47
|
<EodashMapBtns
|
|
47
48
|
:style="{
|
|
48
|
-
gridColumn: indicator || compareIndicator ? responsiveX : '12',
|
|
49
|
+
gridColumn: (indicator || compareIndicator) ? responsiveX : '12',
|
|
49
50
|
gridRow: responsiveY,
|
|
50
51
|
}"
|
|
51
52
|
:exportMap="(indicator || compareIndicator) ? btnsProps.exportMap : false"
|
|
52
|
-
:changeProjection="
|
|
53
|
-
(indicator || compareIndicator) ? btnsProps.changeProjection : false
|
|
53
|
+
:changeProjection="(indicator || compareIndicator) ? btnsProps.changeProjection : false
|
|
54
54
|
"
|
|
55
|
-
:compareIndicators="
|
|
56
|
-
(indicator || compareIndicator) ? btnsProps.compareIndicators : false
|
|
55
|
+
:compareIndicators="(indicator || compareIndicator) ? btnsProps.compareIndicators : false
|
|
57
56
|
"
|
|
58
|
-
:backToPOIs="
|
|
59
|
-
(indicator || compareIndicator) ? btnsProps.backToPOIs : false
|
|
57
|
+
:backToPOIs="(indicator || compareIndicator) ? btnsProps.backToPOIs : false
|
|
60
58
|
"
|
|
61
|
-
:enableSearch="
|
|
62
|
-
(indicator || compareIndicator) ? btnsProps.enableSearch : false
|
|
59
|
+
:enableSearch="(indicator || compareIndicator) ? btnsProps.enableSearch : false
|
|
63
60
|
"
|
|
64
|
-
:enableZoom="
|
|
65
|
-
(indicator || compareIndicator) ? btnsProps.enableZoom : false
|
|
61
|
+
:enableZoom="(indicator || compareIndicator) ? btnsProps.enableZoom : false
|
|
66
62
|
"
|
|
67
63
|
/>
|
|
68
64
|
</div>
|
|
@@ -134,6 +130,18 @@ const props = defineProps({
|
|
|
134
130
|
}),
|
|
135
131
|
},
|
|
136
132
|
btns: {
|
|
133
|
+
/** @type {import("vue").PropType<{
|
|
134
|
+
* enableExportMap?: boolean;
|
|
135
|
+
* enableChangeProjection?: boolean;
|
|
136
|
+
* enableBackToPOIs?: boolean;
|
|
137
|
+
* enableSearch?: boolean;
|
|
138
|
+
* enableZoom?: boolean;
|
|
139
|
+
* enableCompareIndicators?: boolean | {
|
|
140
|
+
* compareTemplate?:string;
|
|
141
|
+
* fallbackTemplate?:string;
|
|
142
|
+
* itemFilterConfig?:InstanceType<import("../EodashItemFilter.vue").default>["$props"]
|
|
143
|
+
* };
|
|
144
|
+
* }> }*/
|
|
137
145
|
type: Object,
|
|
138
146
|
default: () => ({
|
|
139
147
|
enableExportMap: true,
|
|
@@ -272,7 +280,8 @@ const showCompare = computed(() =>
|
|
|
272
280
|
useHandleMapMoveEnd(eoxMap, mapPosition);
|
|
273
281
|
|
|
274
282
|
onMounted(() => {
|
|
275
|
-
const { selectedCompareStac, selectedStac } =
|
|
283
|
+
const { selectedCompareStac, selectedStac, selectedItem } =
|
|
284
|
+
storeToRefs(useSTAcStore());
|
|
276
285
|
// assign map Element state to eox map
|
|
277
286
|
mapEl.value = eoxMap.value;
|
|
278
287
|
|
|
@@ -302,6 +311,7 @@ onMounted(() => {
|
|
|
302
311
|
eoxMapLayers,
|
|
303
312
|
compareMap,
|
|
304
313
|
props.zoomToExtent,
|
|
314
|
+
selectedItem,
|
|
305
315
|
);
|
|
306
316
|
});
|
|
307
317
|
|
|
@@ -9,19 +9,19 @@ import log from "loglevel";
|
|
|
9
9
|
* | null
|
|
10
10
|
* } selectedIndicator
|
|
11
11
|
* @param {EodashCollection[]} eodashCols
|
|
12
|
-
* @param {string} [
|
|
12
|
+
* @param {string | import("stac-ts").StacItem | null} [timeOrItem] - time as a string, or a stac item
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
export const createLayersConfig = async (
|
|
16
16
|
selectedIndicator,
|
|
17
17
|
eodashCols,
|
|
18
|
-
|
|
18
|
+
timeOrItem,
|
|
19
19
|
) => {
|
|
20
20
|
log.debug(
|
|
21
21
|
"Creating layers config",
|
|
22
22
|
selectedIndicator,
|
|
23
23
|
eodashCols,
|
|
24
|
-
|
|
24
|
+
timeOrItem,
|
|
25
25
|
);
|
|
26
26
|
const layersCollection = [];
|
|
27
27
|
const dataLayers = {
|
|
@@ -35,11 +35,14 @@ export const createLayersConfig = async (
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
for (const ec of eodashCols) {
|
|
38
|
+
/** @type {Record<string,any>[]} */
|
|
38
39
|
let layers;
|
|
39
|
-
if (
|
|
40
|
-
|
|
40
|
+
if (timeOrItem) {
|
|
41
|
+
const dateOrItem =
|
|
42
|
+
typeof timeOrItem === "string" ? new Date(timeOrItem) : timeOrItem;
|
|
43
|
+
layers = await ec.createLayersJson(dateOrItem);
|
|
41
44
|
} else {
|
|
42
|
-
layers = await ec.createLayersJson();
|
|
45
|
+
layers = await ec.createLayersJson(undefined);
|
|
43
46
|
}
|
|
44
47
|
// Add expand to all analysis layers
|
|
45
48
|
layers.forEach((dl) => {
|
|
@@ -7,6 +7,7 @@ import { storeToRefs } from "pinia";
|
|
|
7
7
|
import { isFirstLoad } from "@/utils/states";
|
|
8
8
|
import { useEmitLayersUpdate, useOnLayersUpdate } from "@/composables";
|
|
9
9
|
import { mapPosition } from "@/store/states";
|
|
10
|
+
import { sanitizeBbox } from "@/eodashSTAC/helpers";
|
|
10
11
|
/**
|
|
11
12
|
* Holder for previous compare map view as it is overwritten by sync
|
|
12
13
|
* @type { import("ol").View | null} mapElement
|
|
@@ -58,6 +59,7 @@ export const useHandleMapMoveEnd = (mapElement, mapPosition) => {
|
|
|
58
59
|
* @param {import("vue").Ref<Record<string,any>[]>} mapLayers
|
|
59
60
|
* @param {import("vue").Ref<import("@eox/map").EOxMap| null>} partnerMap
|
|
60
61
|
* @param {boolean} zoomToExtent
|
|
62
|
+
* @param {import("vue").Ref<import("stac-ts").StacItem | import("stac-ts").StacLink | null>} [selectedItem]
|
|
61
63
|
*/
|
|
62
64
|
export const useInitMap = (
|
|
63
65
|
mapElement,
|
|
@@ -67,6 +69,7 @@ export const useInitMap = (
|
|
|
67
69
|
mapLayers,
|
|
68
70
|
partnerMap,
|
|
69
71
|
zoomToExtent,
|
|
72
|
+
selectedItem,
|
|
70
73
|
) => {
|
|
71
74
|
log.debug(
|
|
72
75
|
"InitMap",
|
|
@@ -75,10 +78,22 @@ export const useInitMap = (
|
|
|
75
78
|
eodashCols.values,
|
|
76
79
|
datetime.value,
|
|
77
80
|
);
|
|
78
|
-
|
|
81
|
+
// watch selectedItem if provided
|
|
82
|
+
const watching = selectedItem
|
|
83
|
+
? [selectedIndicator, datetime, selectedItem]
|
|
84
|
+
: [selectedIndicator, datetime];
|
|
79
85
|
const stopIndicatorWatcher = watch(
|
|
80
|
-
|
|
81
|
-
async (
|
|
86
|
+
watching,
|
|
87
|
+
async (updated, previous) => {
|
|
88
|
+
const [updatedStac, updatedTime, updatedItem] =
|
|
89
|
+
/** @type {[import("stac-ts").StacCollection, string, import("stac-ts").StacItem | null]} */ (
|
|
90
|
+
selectedItem ? updated : [updated[0], updated[1], null]
|
|
91
|
+
);
|
|
92
|
+
const [previousStac, previousTime, previousItem] =
|
|
93
|
+
/** @type {[import("stac-ts").StacCollection, string, import("stac-ts").StacItem]} */ (
|
|
94
|
+
selectedItem ? previous : [previous[0], previous[1], null]
|
|
95
|
+
);
|
|
96
|
+
|
|
82
97
|
if (updatedStac) {
|
|
83
98
|
log.debug(
|
|
84
99
|
"Selected Indicator watch triggered",
|
|
@@ -98,7 +113,9 @@ export const useInitMap = (
|
|
|
98
113
|
let layersCollection = [];
|
|
99
114
|
|
|
100
115
|
const onlyTimeChanged =
|
|
101
|
-
updatedStac?.id === previousStac?.id &&
|
|
116
|
+
updatedStac?.id === previousStac?.id &&
|
|
117
|
+
(updatedTime !== previousTime ||
|
|
118
|
+
(updatedItem && updatedItem?.id !== previousItem?.id));
|
|
102
119
|
|
|
103
120
|
const { selectedCompareStac } = storeToRefs(useSTAcStore());
|
|
104
121
|
if (mapElement?.value?.id === "main") {
|
|
@@ -115,12 +132,12 @@ export const useInitMap = (
|
|
|
115
132
|
}
|
|
116
133
|
}
|
|
117
134
|
|
|
118
|
-
// We re-
|
|
135
|
+
// We re-create the configuration if time changed
|
|
119
136
|
if (onlyTimeChanged) {
|
|
120
137
|
layersCollection = await createLayersConfig(
|
|
121
138
|
updatedStac,
|
|
122
139
|
eodashCols,
|
|
123
|
-
updatedTime,
|
|
140
|
+
updatedItem ?? updatedTime,
|
|
124
141
|
);
|
|
125
142
|
log.debug(
|
|
126
143
|
"Assigned layers after changing time only",
|
|
@@ -142,7 +159,7 @@ export const useInitMap = (
|
|
|
142
159
|
layersCollection = await createLayersConfig(
|
|
143
160
|
updatedStac,
|
|
144
161
|
eodashCols,
|
|
145
|
-
|
|
162
|
+
selectedItem ? updatedItem : updatedTime,
|
|
146
163
|
);
|
|
147
164
|
|
|
148
165
|
// We try to set the current time selection to latest extent date
|
|
@@ -157,6 +174,7 @@ export const useInitMap = (
|
|
|
157
174
|
);
|
|
158
175
|
}
|
|
159
176
|
if (
|
|
177
|
+
!updatedItem &&
|
|
160
178
|
endInterval !== null &&
|
|
161
179
|
endInterval.toISOString() !== datetime.value &&
|
|
162
180
|
!isFirstLoad.value
|
|
@@ -168,6 +186,7 @@ export const useInitMap = (
|
|
|
168
186
|
// Try to move map view to extent only when main
|
|
169
187
|
// indicator and map changes
|
|
170
188
|
if (
|
|
189
|
+
!updatedItem &&
|
|
171
190
|
mapElement?.value?.id === "main" &&
|
|
172
191
|
updatedStac.extent?.spatial.bbox &&
|
|
173
192
|
!(
|
|
@@ -178,12 +197,7 @@ export const useInitMap = (
|
|
|
178
197
|
) {
|
|
179
198
|
// Sanitize extent,
|
|
180
199
|
const b = updatedStac.extent?.spatial.bbox[0];
|
|
181
|
-
const sanitizedExtent = [
|
|
182
|
-
b?.[0] > -180 ? b?.[0] : -180,
|
|
183
|
-
b?.[1] > -90 ? b?.[1] : -90,
|
|
184
|
-
b?.[2] < 180 ? b?.[2] : 180,
|
|
185
|
-
b?.[3] < 90 ? b?.[3] : 90,
|
|
186
|
-
];
|
|
200
|
+
const sanitizedExtent = sanitizeBbox([...b]);
|
|
187
201
|
|
|
188
202
|
const reprojExtent = mapElement.value?.transformExtent(
|
|
189
203
|
sanitizedExtent,
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
.schema="jsonformSchema"
|
|
10
10
|
></eox-jsonform>
|
|
11
11
|
<eox-chart
|
|
12
|
+
ref="chartElRef"
|
|
12
13
|
class="chart"
|
|
13
14
|
v-if="isProcessed && chartSpec"
|
|
14
15
|
.spec="toRaw(chartSpec)"
|
|
@@ -45,7 +46,7 @@ import "@eox/drawtools";
|
|
|
45
46
|
import "@eox/jsonform";
|
|
46
47
|
import { useSTAcStore } from "@/store/stac";
|
|
47
48
|
import { storeToRefs } from "pinia";
|
|
48
|
-
import { computed, ref, toRaw, useTemplateRef } from "vue";
|
|
49
|
+
import { computed, ref, toRaw, useTemplateRef, watch } from "vue";
|
|
49
50
|
import ProcessList from "./ProcessList.vue";
|
|
50
51
|
import { handleProcesses, onChartClick } from "./methods/handling";
|
|
51
52
|
import { useInitProcess, useAutoExec } from "./methods/composables";
|
|
@@ -55,6 +56,8 @@ import {
|
|
|
55
56
|
indicator,
|
|
56
57
|
mapCompareEl,
|
|
57
58
|
mapEl,
|
|
59
|
+
chartEl,
|
|
60
|
+
compareChartEl,
|
|
58
61
|
} from "@/store/states";
|
|
59
62
|
import { download } from "./methods/utils";
|
|
60
63
|
import { compareJobs, jobs } from "./states";
|
|
@@ -86,6 +89,10 @@ const jsonformEl =
|
|
|
86
89
|
/** @type {Readonly<import("vue").ShallowRef<import("@eox/jsonform").EOxJSONForm | null>>} */ (
|
|
87
90
|
useTemplateRef("jsonformEl")
|
|
88
91
|
);
|
|
92
|
+
const chartElRef =
|
|
93
|
+
/** @type {Readonly<import("vue").ShallowRef<import("@eox/chart").EOxChart | null>>} */ (
|
|
94
|
+
useTemplateRef("chartElRef")
|
|
95
|
+
);
|
|
89
96
|
const isAsync = computed(
|
|
90
97
|
() =>
|
|
91
98
|
selectedStac.value?.links.filter((l) => l.endpoint === "eoxhub_workspaces")
|
|
@@ -208,6 +215,15 @@ const chartStyles = computed(() => {
|
|
|
208
215
|
}
|
|
209
216
|
return styles;
|
|
210
217
|
});
|
|
218
|
+
|
|
219
|
+
// Assign chart element to global state based on compare mode
|
|
220
|
+
watch(chartElRef, (newVal) => {
|
|
221
|
+
if (enableCompare) {
|
|
222
|
+
compareChartEl.value = newVal;
|
|
223
|
+
} else {
|
|
224
|
+
chartEl.value = newVal;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
211
227
|
</script>
|
|
212
228
|
<style>
|
|
213
229
|
eox-chart {
|
|
@@ -2,7 +2,10 @@ import axios from "@/plugins/axios";
|
|
|
2
2
|
import { getBboxProperty } from "../../utils";
|
|
3
3
|
import { toAbsolute } from "stac-js/src/http.js";
|
|
4
4
|
import { currentCompareUrl, currentUrl } from "@/store/states";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
getDatetimeProperty,
|
|
7
|
+
generateLinksFromItems,
|
|
8
|
+
} from "@/eodashSTAC/helpers";
|
|
6
9
|
import { readParquetItems } from "@/eodashSTAC/parquet";
|
|
7
10
|
|
|
8
11
|
/**
|
|
@@ -82,10 +85,13 @@ async function fetchVedaCOGsConfig(selectedStac, absoluteUrl) {
|
|
|
82
85
|
const parquetAsset = Object.values(collection.assets ?? {}).find(
|
|
83
86
|
(asset) =>
|
|
84
87
|
asset.type === "application/vnd.apache.parquet" &&
|
|
85
|
-
|
|
88
|
+
asset.roles?.includes("collection-mirror"),
|
|
86
89
|
);
|
|
87
90
|
if (parquetAsset) {
|
|
88
|
-
const parquetAbsoluteUrl = toAbsolute(
|
|
91
|
+
const parquetAbsoluteUrl = toAbsolute(
|
|
92
|
+
parquetAsset.href,
|
|
93
|
+
toAbsolute(link.href, absoluteUrl),
|
|
94
|
+
);
|
|
89
95
|
await readParquetItems(parquetAbsoluteUrl).then((items) => {
|
|
90
96
|
collection.links.push(...generateLinksFromItems(items));
|
|
91
97
|
});
|
|
@@ -181,7 +181,9 @@ export async function handleProcesses({
|
|
|
181
181
|
for (const layer of newLayers) {
|
|
182
182
|
if (layer.type === "WebGLTile" && layer.source?.type === "GeoTIFF") {
|
|
183
183
|
processResults.value.push(...(layer.source.sources ?? []));
|
|
184
|
+
//@ts-expect-error TODO
|
|
184
185
|
} else if (layer.source && "url" in layer.source) {
|
|
186
|
+
//@ts-expect-error TODO
|
|
185
187
|
processResults.value.push(layer.source.url);
|
|
186
188
|
}
|
|
187
189
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<eox-timeslider
|
|
3
|
+
v-if="hasMultipleItems"
|
|
4
|
+
:key="mapEl"
|
|
5
|
+
@update="update"
|
|
6
|
+
.externalMapRendering="true"
|
|
7
|
+
.filters="filters"
|
|
8
|
+
titleKey="title"
|
|
9
|
+
layerIdKey="id"
|
|
10
|
+
for="eox-map#main"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
<script setup>
|
|
14
|
+
import { datetime, mapEl } from "@/store/states";
|
|
15
|
+
import { eodashCollections } from "@/utils/states";
|
|
16
|
+
import "@eox/timeslider";
|
|
17
|
+
import { computed } from "vue";
|
|
18
|
+
|
|
19
|
+
defineProps({
|
|
20
|
+
filters: {
|
|
21
|
+
type: Array,
|
|
22
|
+
default: () => [],
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const hasMultipleItems = computed(() => {
|
|
27
|
+
return eodashCollections.some((ec) => {
|
|
28
|
+
const itemLinks = ec.collectionStac?.links.filter((l) => l.rel === "item");
|
|
29
|
+
const itemsLink = ec.collectionStac?.links.some((l) => l.rel === "items");
|
|
30
|
+
return (itemLinks && itemLinks.length > 1) || itemsLink;
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param {CustomEvent} e
|
|
36
|
+
*/
|
|
37
|
+
const update = (e) => {
|
|
38
|
+
datetime.value = e.detail.date.toISOString();
|
|
39
|
+
};
|
|
40
|
+
</script>
|
package/widgets/EodashTools.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div ref="rootEl" class="d-flex flex-column fill-height bg-primary">
|
|
3
3
|
<div
|
|
4
|
-
class="d-flex flex-row align-center fill-height justify-space-between pa-
|
|
4
|
+
class="d-flex flex-row align-center fill-height justify-space-between pa-1 align-center"
|
|
5
5
|
>
|
|
6
6
|
<v-btn
|
|
7
7
|
v-if="props.showIndicatorsBtn"
|
|
@@ -61,7 +61,7 @@ const props = defineProps({
|
|
|
61
61
|
},
|
|
62
62
|
layoutTarget: {
|
|
63
63
|
type: String,
|
|
64
|
-
default: "
|
|
64
|
+
default: "lite",
|
|
65
65
|
},
|
|
66
66
|
// mdi/js icon
|
|
67
67
|
layoutIcon: {
|
|
@@ -81,4 +81,8 @@ const props = defineProps({
|
|
|
81
81
|
const rootEl = ref(null);
|
|
82
82
|
useTransparentPanel(rootEl);
|
|
83
83
|
</script>
|
|
84
|
-
<style lang="scss" scoped
|
|
84
|
+
<style lang="scss" scoped>
|
|
85
|
+
.v-btn--size-default {
|
|
86
|
+
--v-btn-height: 30px;
|
|
87
|
+
}
|
|
88
|
+
</style>
|
package/widgets/ExportState.vue
CHANGED
|
@@ -6,12 +6,19 @@
|
|
|
6
6
|
</v-card-title>
|
|
7
7
|
|
|
8
8
|
<v-card-text class="py-5 overflow-auto" style="height: 400px">
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
<div class="d-flex flex-wrap gap-2 mb-4">
|
|
10
|
+
<v-btn
|
|
11
|
+
v-for="btn in copyBtns"
|
|
12
|
+
v-show="!btn.showIf || btn.showIf()"
|
|
13
|
+
class="text-body-2"
|
|
14
|
+
@click="btn.copyFn"
|
|
15
|
+
:key="btn.id"
|
|
16
|
+
small
|
|
17
|
+
variant="text"
|
|
18
|
+
:prepend-icon="[mdiContentCopy]"
|
|
19
|
+
>
|
|
20
|
+
copy as {{ btn.copyAs }}
|
|
21
|
+
</v-btn>
|
|
15
22
|
</div>
|
|
16
23
|
|
|
17
24
|
<div style="position: absolute; bottom: 15px">
|
|
@@ -22,21 +29,22 @@
|
|
|
22
29
|
</div>
|
|
23
30
|
</v-expand-transition>
|
|
24
31
|
</div>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
|
|
33
|
+
<p class="text-body-2 mb-2">
|
|
34
|
+
<strong>Map Layers Configuration</strong>
|
|
35
|
+
</p>
|
|
36
|
+
<div class="pa-3 code-block mb-4">
|
|
37
|
+
{{ removeUnneededProperties(getLayers()) }}
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div v-if="props.getChartSpec?.()" class="mb-4">
|
|
41
|
+
<p class="text-body-2 mb-2">
|
|
42
|
+
<strong>Chart Spec (for export)</strong>
|
|
43
|
+
</p>
|
|
44
|
+
<div class="pa-3 code-block">
|
|
45
|
+
{{ getChartExportCode() }}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
40
48
|
</v-card-text>
|
|
41
49
|
|
|
42
50
|
<v-divider></v-divider>
|
|
@@ -53,7 +61,10 @@ import { mdiClipboardCheckOutline, mdiContentCopy } from "@mdi/js";
|
|
|
53
61
|
import PopUp from "./PopUp.vue";
|
|
54
62
|
import { copyToClipBoard } from "@/utils";
|
|
55
63
|
import { ref } from "vue";
|
|
56
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
getLayers as getLayerAction,
|
|
66
|
+
getChartSpec as getChartSpecAction,
|
|
67
|
+
} from "@/store/actions";
|
|
57
68
|
import { mapPosition, availableMapProjection } from "@/store/states";
|
|
58
69
|
import { removeUnneededProperties } from "@/eodashSTAC/helpers";
|
|
59
70
|
|
|
@@ -64,6 +75,10 @@ const props = defineProps({
|
|
|
64
75
|
type: Function,
|
|
65
76
|
default: getLayerAction,
|
|
66
77
|
},
|
|
78
|
+
getChartSpec: {
|
|
79
|
+
type: Function,
|
|
80
|
+
default: getChartSpecAction,
|
|
81
|
+
},
|
|
67
82
|
});
|
|
68
83
|
|
|
69
84
|
const copySuccess = ref(false);
|
|
@@ -85,6 +100,13 @@ const copyBtns = [
|
|
|
85
100
|
copyFn: async () => await copyToClipBoard(getMapStepCode(), copySuccess),
|
|
86
101
|
copyAs: "map tour section",
|
|
87
102
|
},
|
|
103
|
+
{
|
|
104
|
+
id: Symbol(),
|
|
105
|
+
copyFn: async () =>
|
|
106
|
+
await copyToClipBoard(getChartExportCode(), copySuccess),
|
|
107
|
+
copyAs: "chart",
|
|
108
|
+
showIf: () => !!props.getChartSpec?.(),
|
|
109
|
+
},
|
|
88
110
|
];
|
|
89
111
|
|
|
90
112
|
const getMapStepCode = () => {
|
|
@@ -104,6 +126,15 @@ const getMapEntryCode = () => {
|
|
|
104
126
|
const endTag = `zoom="${z}" center=[${[x, y]}] projection="${availableMapProjection.value}" }-->`;
|
|
105
127
|
return `${preTag}'${JSON.stringify(removeUnneededProperties(props.getLayers()))}' ${endTag}`;
|
|
106
128
|
};
|
|
129
|
+
|
|
130
|
+
const getChartExportCode = () => {
|
|
131
|
+
const chartSpec = props.getChartSpec?.();
|
|
132
|
+
if (!chartSpec) return "";
|
|
133
|
+
const preTag =
|
|
134
|
+
"## Chart Example <!" + '--{as="eox-chart" style="height: 300px;" spec=';
|
|
135
|
+
const endTag = " }-->";
|
|
136
|
+
return `${preTag}'${JSON.stringify(chartSpec)}'${endTag}`;
|
|
137
|
+
};
|
|
107
138
|
</script>
|
|
108
139
|
<style scoped>
|
|
109
140
|
.code-block {
|