@eodash/eodash 5.4.0 → 5.5.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/asWebComponent.js +1 -1
- package/core/client/composables/DefineWidgets.js +12 -2
- package/core/client/eodashSTAC/EodashCollection.js +3 -3
- package/core/client/eodashSTAC/createLayers.js +44 -17
- package/core/client/eodashSTAC/helpers.js +12 -5
- package/core/client/eodashSTAC/parquet.js +2 -1
- package/core/client/eodashSTAC/triggers.js +1 -2
- package/core/client/store/actions.js +17 -17
- package/core/client/store/states.js +26 -4
- package/core/client/types.ts +9 -0
- package/core/client/utils/index.js +18 -1
- package/dist/client/{DashboardLayout-CQOGHPW_.js → DashboardLayout-CkSgvaFF.js} +2 -2
- package/dist/client/{DynamicWebComponent-CoLO8FEf.js → DynamicWebComponent-Ncsg6fb9.js} +1 -1
- package/dist/client/EodashChart-5v7adDpG.js +144 -0
- package/dist/client/{EodashDatePicker-BZeQ6bcu.js → EodashDatePicker-RoQJe6ss.js} +4 -4
- package/dist/client/{EodashItemFilter-CmZkk7GK.js → EodashItemFilter-CCoVC5BE.js} +2 -2
- package/dist/client/{EodashLayerControl-D54fY-bX.js → EodashLayerControl-weVj7aQA.js} +2 -2
- package/dist/client/{EodashLayoutSwitcher-BCP3FvDb.js → EodashLayoutSwitcher-CL-Z9d5_.js} +3 -3
- package/dist/client/EodashMapBtns-CXU8IuPO.js +433 -0
- package/dist/client/{EodashStacInfo-BZbmT8vT.js → EodashStacInfo-BbMnjf-n.js} +11 -15
- package/dist/client/{EodashTimeSlider-DIcAJr6D.js → EodashTimeSlider-BZXnqfax.js} +2 -2
- package/dist/client/{EodashTools-Cz6X6hsF.js → EodashTools-DUJlkkgx.js} +4 -4
- package/dist/client/{ExportState-DFVFAgKz.js → ExportState-CT3FQOHW.js} +46 -21
- package/dist/client/{Footer-DLzQcjkI.js → Footer-D_iqP-1K.js} +1 -1
- package/dist/client/{Header-_D9Z-zFJ.js → Header-Dzhnvsy-.js} +127 -17
- package/dist/client/MobileLayout-6Rg_PSO8.js +118 -0
- package/dist/client/{PopUp-DwI8V2gW.js → PopUp-DPPv_GSA.js} +8 -59
- package/dist/client/{ProcessList-C9eAg2Sb.js → ProcessList-BIN_Mb27.js} +9 -13
- package/dist/client/{VImg-COXTnCWE.js → VImg-DhbuvNrA.js} +2 -2
- package/dist/client/{VMain-C74l1bv-.js → VMain-CVabY_NY.js} +1 -1
- package/dist/client/{VTooltip-BLS-cQ9N.js → VTooltip-Cc6au3Sn.js} +3 -4
- package/dist/client/{WidgetsContainer-D-VfMRxE.js → WidgetsContainer-ChqTJS4h.js} +1 -1
- package/dist/client/asWebComponent-DaIxULaA.js +9207 -0
- package/dist/client/{async-D4G-FOIc.js → async-D6Lvv-fT.js} +4 -4
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-CRMFoNYN.js → forwardRefs--IccUBdR.js} +196 -37
- package/dist/client/{handling-DTAhQuPh.js → handling-DSA67d6E.js} +74 -35
- package/dist/client/{helpers-CsjKHAcK.js → helpers-BBSdbOmv.js} +187 -87
- package/dist/client/{index-DEmHaCL3.js → index-6LlXNkke.js} +5 -3
- package/dist/client/{index-BHilH1qx.js → index-BS-8Y5FE.js} +22 -69
- package/dist/client/{index-BIcmbjr0.js → index-CQihL_c6.js} +27 -14
- package/dist/client/{index-BoCcZ0l4.js → index-qsZhYR_6.js} +15 -16
- package/dist/client/templates.js +48 -2
- package/dist/client/{transition-6MJLK-_H.js → transition-DFr4cXu8.js} +1 -1
- package/dist/node/cli.js +1 -1
- package/dist/types/core/client/App.vue.d.ts +16 -6
- package/dist/types/core/client/asWebComponent.d.ts +2 -2
- package/dist/types/core/client/components/DashboardLayout.vue.d.ts +2 -1
- package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +36 -16
- package/dist/types/core/client/components/EodashOverlay.vue.d.ts +2 -1
- package/dist/types/core/client/components/ErrorAlert.vue.d.ts +9 -1
- package/dist/types/core/client/components/Footer.vue.d.ts +2 -1
- package/dist/types/core/client/components/Header.vue.d.ts +2 -1
- package/dist/types/core/client/components/IframeWrapper.vue.d.ts +12 -6
- package/dist/types/core/client/components/Loading.vue.d.ts +2 -1
- package/dist/types/core/client/components/MobileLayout.vue.d.ts +2 -1
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +1 -0
- package/dist/types/core/client/store/actions.d.ts +1 -2
- package/dist/types/core/client/store/states.d.ts +22 -4
- package/dist/types/core/client/types.d.ts +6 -1
- package/dist/types/core/client/utils/index.d.ts +1 -0
- package/dist/types/core/client/views/Dashboard.vue.d.ts +20 -8
- package/dist/types/templates/compare.d.ts +20 -0
- package/dist/types/templates/expert.d.ts +30 -1
- package/dist/types/widgets/EodashChart.vue.d.ts +28 -0
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +38 -9
- package/dist/types/widgets/EodashItemCatalog/index.vue.d.ts +88 -13
- package/dist/types/widgets/EodashItemCatalog/methods/map.d.ts +1 -1
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +169 -26
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +38 -10
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +22 -7
- package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +94 -21
- package/dist/types/widgets/EodashMap/index.vue.d.ts +646 -93
- package/dist/types/widgets/EodashMap/methods/btns.d.ts +14 -0
- package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +24 -7
- package/dist/types/widgets/EodashProcess/index.vue.d.ts +26 -7
- package/dist/types/widgets/EodashProcess/methods/composables.d.ts +1 -2
- package/dist/types/widgets/EodashProcess/methods/handling.d.ts +5 -11
- package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +2 -2
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +67 -18
- package/dist/types/widgets/EodashTimeSlider.vue.d.ts +14 -6
- package/dist/types/widgets/EodashTools.vue.d.ts +437 -47
- package/dist/types/widgets/ExportState.vue.d.ts +26 -8
- package/dist/types/widgets/PopUp.vue.d.ts +61 -11
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +22 -6
- package/package.json +33 -34
- package/templates/baseConfig.js +2 -1
- package/templates/compare.js +28 -1
- package/templates/expert.js +19 -1
- package/widgets/EodashChart.vue +139 -0
- package/widgets/EodashItemCatalog/index.vue +2 -2
- package/widgets/EodashItemCatalog/methods/map.js +9 -10
- package/widgets/EodashMap/EodashMapBtns.vue +58 -93
- package/widgets/EodashMap/index.vue +10 -2
- package/widgets/EodashMap/methods/btns.js +155 -0
- package/widgets/EodashMap/methods/create-layers-config.js +3 -3
- package/widgets/EodashMap/methods/index.js +2 -1
- package/widgets/EodashProcess/ProcessList.vue +2 -3
- package/widgets/EodashProcess/index.vue +18 -61
- package/widgets/EodashProcess/methods/async.js +1 -1
- package/widgets/EodashProcess/methods/composables.js +0 -5
- package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +10 -6
- package/widgets/EodashProcess/methods/handling.js +23 -22
- package/widgets/EodashProcess/methods/outputs.js +44 -4
- package/widgets/EodashProcess/methods/utils.js +1 -1
- package/widgets/EodashStacInfo.vue +10 -23
- package/widgets/ExportState.vue +9 -15
- package/dist/client/EodashMapBtns-D-HulIl1.js +0 -306
- package/dist/client/MobileLayout-3Ko9XSfO.js +0 -118
- package/dist/client/asWebComponent-Bw03Jutr.js +0 -9090
|
@@ -17,7 +17,7 @@ import { isFirstLoad } from "@/utils/states";
|
|
|
17
17
|
* @param {Record<string,any>} options.jsonformSchema
|
|
18
18
|
* @param {import("vue").Ref<import("../types").AsyncJob[]>} options.jobs
|
|
19
19
|
* @param {boolean} [options.enableCompare=false] - Whether to enable compare mode
|
|
20
|
-
* @returns {Promise<[import("
|
|
20
|
+
* @returns {Promise<[import("vega-embed").VisualizationSpec | null,Record<string,any>|null]>}
|
|
21
21
|
**/
|
|
22
22
|
export async function processCharts({
|
|
23
23
|
links,
|
|
@@ -61,10 +61,50 @@ export async function processCharts({
|
|
|
61
61
|
if (data && data.length) {
|
|
62
62
|
//@ts-expect-error we assume data to exist in spec
|
|
63
63
|
spec.data.values = data;
|
|
64
|
-
return [spec, dataValues];
|
|
64
|
+
return [structuredClone(spec), structuredClone(dataValues)];
|
|
65
65
|
}
|
|
66
|
-
|
|
67
66
|
const dataLinks = standardLinks.filter((link) => link.rel === "service");
|
|
67
|
+
|
|
68
|
+
// We count if there are at least two application/json links, if yes,
|
|
69
|
+
// we download the data and assign them to specific data ids in the spec
|
|
70
|
+
const jsonLinks = dataLinks.filter(
|
|
71
|
+
(link) => link.type === "application/json",
|
|
72
|
+
);
|
|
73
|
+
if (jsonLinks.length >= 2) {
|
|
74
|
+
for (const link of jsonLinks ?? []) {
|
|
75
|
+
let linkType = link.type;
|
|
76
|
+
switch (linkType) {
|
|
77
|
+
case undefined:
|
|
78
|
+
continue;
|
|
79
|
+
case "application/json":
|
|
80
|
+
dataValues[/** @type {string} */ (link.id)] = await axios
|
|
81
|
+
.get(
|
|
82
|
+
mustache.render(link.href, {
|
|
83
|
+
...(jsonformValue ?? {}),
|
|
84
|
+
}),
|
|
85
|
+
)
|
|
86
|
+
.then((resp) => resp.data);
|
|
87
|
+
// assign to spec datasets, assuming spec.data is InlineData
|
|
88
|
+
// Always assign values as an object with string keys
|
|
89
|
+
if (spec.data) {
|
|
90
|
+
/** @type {import("vega-lite/build/src/data").InlineData} */
|
|
91
|
+
(spec.data).values = {
|
|
92
|
+
...(spec.data &&
|
|
93
|
+
"values" in spec.data &&
|
|
94
|
+
typeof spec.data.values === "object"
|
|
95
|
+
? spec.data.values
|
|
96
|
+
: {}),
|
|
97
|
+
[/** @type {string} */ (link.id)]:
|
|
98
|
+
dataValues[/** @type {string} */ (link.id)],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return [spec, dataValues];
|
|
107
|
+
}
|
|
68
108
|
try {
|
|
69
109
|
checkForData: for (const link of dataLinks ?? []) {
|
|
70
110
|
switch (link.type) {
|
|
@@ -104,7 +144,7 @@ export async function processCharts({
|
|
|
104
144
|
} catch (e) {
|
|
105
145
|
console.error("[eodash] Error while injecting Vega data", e);
|
|
106
146
|
}
|
|
107
|
-
return [spec, dataValues];
|
|
147
|
+
return [structuredClone(spec), structuredClone(dataValues)];
|
|
108
148
|
}
|
|
109
149
|
|
|
110
150
|
/**
|
|
@@ -543,7 +543,7 @@ export const applyProcessLayersToMap = (mapElement, processLayers) => {
|
|
|
543
543
|
(l) => l.properties?.id === layer.properties?.id,
|
|
544
544
|
);
|
|
545
545
|
if (!exists) {
|
|
546
|
-
analysisGroup.layers.
|
|
546
|
+
analysisGroup.layers.push(layer);
|
|
547
547
|
} else {
|
|
548
548
|
analysisGroup.layers = replaceLayer(
|
|
549
549
|
analysisGroup.layers,
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
.body="body"
|
|
7
7
|
.featured="featured"
|
|
8
8
|
.footer="footer"
|
|
9
|
-
.styleOverride="styleOverride"
|
|
10
9
|
.header="header"
|
|
11
|
-
.subheader="subheader"
|
|
12
10
|
.tags="tags"
|
|
13
11
|
style="--color-primary-lighter: none"
|
|
14
12
|
>
|
|
@@ -20,25 +18,12 @@
|
|
|
20
18
|
import "@eox/stacinfo";
|
|
21
19
|
import { currentUrl } from "@/store/states";
|
|
22
20
|
|
|
23
|
-
const {
|
|
24
|
-
allowHtml,
|
|
25
|
-
featured,
|
|
26
|
-
footer,
|
|
27
|
-
header,
|
|
28
|
-
body,
|
|
29
|
-
styleOverride,
|
|
30
|
-
subheader,
|
|
31
|
-
tags,
|
|
32
|
-
} = defineProps({
|
|
21
|
+
const { allowHtml, featured, footer, header, body, tags } = defineProps({
|
|
33
22
|
allowHtml: {
|
|
34
23
|
type: Boolean,
|
|
35
24
|
default: true,
|
|
36
25
|
},
|
|
37
26
|
|
|
38
|
-
styleOverride: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: "",
|
|
41
|
-
},
|
|
42
27
|
header: {
|
|
43
28
|
/** @type {import("vue").PropType<string[]>} */
|
|
44
29
|
type: Array,
|
|
@@ -49,15 +34,17 @@ const {
|
|
|
49
34
|
type: Array,
|
|
50
35
|
default: () => ["themes"],
|
|
51
36
|
},
|
|
52
|
-
subheader: {
|
|
53
|
-
/** @type {import("vue").PropType<string[]>} */
|
|
54
|
-
type: Array,
|
|
55
|
-
default: () => [],
|
|
56
|
-
},
|
|
57
37
|
body: {
|
|
58
38
|
/** @type {import("vue").PropType<string[]>} */
|
|
59
39
|
type: Array,
|
|
60
|
-
default: () => [
|
|
40
|
+
default: () => [
|
|
41
|
+
"satellite",
|
|
42
|
+
"sensor",
|
|
43
|
+
"insituSources",
|
|
44
|
+
"otherSources",
|
|
45
|
+
"agency",
|
|
46
|
+
"extent",
|
|
47
|
+
],
|
|
61
48
|
},
|
|
62
49
|
featured: {
|
|
63
50
|
/** @type {import("vue").PropType<string[]>} */
|
|
@@ -67,7 +54,7 @@ const {
|
|
|
67
54
|
footer: {
|
|
68
55
|
/** @type {import("vue").PropType<string[]>} */
|
|
69
56
|
type: Array,
|
|
70
|
-
default: () => ["sci:citation"],
|
|
57
|
+
default: () => ["sci:citation", "sci:doi", "sci:publication"],
|
|
71
58
|
},
|
|
72
59
|
});
|
|
73
60
|
</script>
|
package/widgets/ExportState.vue
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
{{ removeUnneededProperties(getLayers()) }}
|
|
38
38
|
</div>
|
|
39
39
|
|
|
40
|
-
<div v-if="
|
|
40
|
+
<div v-if="chartSpec" class="mb-4">
|
|
41
41
|
<p class="text-body-2 mb-2">
|
|
42
42
|
<strong>Chart Spec (for export)</strong>
|
|
43
43
|
</p>
|
|
@@ -61,12 +61,10 @@ import { mdiClipboardCheckOutline, mdiContentCopy } from "@mdi/js";
|
|
|
61
61
|
import PopUp from "./PopUp.vue";
|
|
62
62
|
import { copyToClipBoard } from "@/utils";
|
|
63
63
|
import { ref } from "vue";
|
|
64
|
-
import {
|
|
65
|
-
|
|
66
|
-
getChartSpec as getChartSpecAction,
|
|
67
|
-
} from "@/store/actions";
|
|
68
|
-
import { mapPosition, availableMapProjection } from "@/store/states";
|
|
64
|
+
import { getLayers as getLayerAction } from "@/store/actions";
|
|
65
|
+
import { mapPosition, availableMapProjection, chartSpec } from "@/store/states";
|
|
69
66
|
import { removeUnneededProperties } from "@/eodashSTAC/helpers";
|
|
67
|
+
import { base64EncodeSpec } from "@eox/chart";
|
|
70
68
|
|
|
71
69
|
const dialog = defineModel({ type: Boolean, required: true, default: false });
|
|
72
70
|
|
|
@@ -75,10 +73,6 @@ const props = defineProps({
|
|
|
75
73
|
type: Function,
|
|
76
74
|
default: getLayerAction,
|
|
77
75
|
},
|
|
78
|
-
getChartSpec: {
|
|
79
|
-
type: Function,
|
|
80
|
-
default: getChartSpecAction,
|
|
81
|
-
},
|
|
82
76
|
});
|
|
83
77
|
|
|
84
78
|
const copySuccess = ref(false);
|
|
@@ -105,7 +99,7 @@ const copyBtns = [
|
|
|
105
99
|
copyFn: async () =>
|
|
106
100
|
await copyToClipBoard(getChartExportCode(), copySuccess),
|
|
107
101
|
copyAs: "chart",
|
|
108
|
-
showIf: () =>
|
|
102
|
+
showIf: () => chartSpec.value,
|
|
109
103
|
},
|
|
110
104
|
];
|
|
111
105
|
|
|
@@ -128,12 +122,12 @@ const getMapEntryCode = () => {
|
|
|
128
122
|
};
|
|
129
123
|
|
|
130
124
|
const getChartExportCode = () => {
|
|
131
|
-
|
|
132
|
-
if (!chartSpec) return "";
|
|
125
|
+
if (!chartSpec.value) return "";
|
|
133
126
|
const preTag =
|
|
134
|
-
"## Chart Example <!" + '--{as="eox-chart" style="height:
|
|
127
|
+
"## Chart Example <!" + '--{as="eox-chart" style="height: 400px;" spec=';
|
|
135
128
|
const endTag = " }-->";
|
|
136
|
-
|
|
129
|
+
const escapedSpec = base64EncodeSpec(chartSpec.value);
|
|
130
|
+
return `${preTag}'${escapedSpec}'${endTag}`;
|
|
137
131
|
};
|
|
138
132
|
</script>
|
|
139
133
|
<style scoped>
|