@gooddata/sdk-ui-geo 11.11.0-alpha.2 → 11.11.0-alpha.3
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/esm/next/GeoAreaChart.d.ts +33 -0
- package/esm/next/GeoAreaChart.d.ts.map +1 -0
- package/esm/next/GeoAreaChart.js +65 -0
- package/esm/next/GeoAreaChart.js.map +1 -0
- package/esm/next/GeoPushpinChartNext.js +2 -2
- package/esm/next/GeoPushpinChartNext.js.map +1 -1
- package/esm/next/RenderGeoAreaChart.d.ts +15 -0
- package/esm/next/RenderGeoAreaChart.d.ts.map +1 -0
- package/esm/next/RenderGeoAreaChart.js +104 -0
- package/esm/next/RenderGeoAreaChart.js.map +1 -0
- package/esm/next/RenderGeoPushpinChart.d.ts.map +1 -1
- package/esm/next/RenderGeoPushpinChart.js.map +1 -1
- package/esm/next/components/legends/Legend.js +1 -1
- package/esm/next/components/legends/Legend.js.map +1 -1
- package/esm/next/components/legends/types.d.ts +2 -2
- package/esm/next/components/legends/types.d.ts.map +1 -1
- package/esm/next/context/GeoAreaCollectionContext.d.ts +24 -0
- package/esm/next/context/GeoAreaCollectionContext.d.ts.map +1 -0
- package/esm/next/context/GeoAreaCollectionContext.js +39 -0
- package/esm/next/context/GeoAreaCollectionContext.js.map +1 -0
- package/esm/next/context/GeoAreaDataContext.d.ts +69 -0
- package/esm/next/context/GeoAreaDataContext.d.ts.map +1 -0
- package/esm/next/context/GeoAreaDataContext.js +87 -0
- package/esm/next/context/GeoAreaDataContext.js.map +1 -0
- package/esm/next/context/GeoAreaPropsContext.d.ts +47 -0
- package/esm/next/context/GeoAreaPropsContext.d.ts.map +1 -0
- package/esm/next/context/GeoAreaPropsContext.js +84 -0
- package/esm/next/context/GeoAreaPropsContext.js.map +1 -0
- package/esm/next/context/GeoDataContext.d.ts +13 -19
- package/esm/next/context/GeoDataContext.d.ts.map +1 -1
- package/esm/next/context/GeoDataContext.js +7 -53
- package/esm/next/context/GeoDataContext.js.map +1 -1
- package/esm/next/context/GeoPushpinDataContext.d.ts +14 -0
- package/esm/next/context/GeoPushpinDataContext.d.ts.map +1 -0
- package/esm/next/context/GeoPushpinDataContext.js +51 -0
- package/esm/next/context/GeoPushpinDataContext.js.map +1 -0
- package/esm/next/features/clustering/clustering.d.ts +2 -2
- package/esm/next/features/clustering/clustering.d.ts.map +1 -1
- package/esm/next/features/clustering/clustering.js.map +1 -1
- package/esm/next/features/coloring/areaColorStrategy.d.ts +22 -0
- package/esm/next/features/coloring/areaColorStrategy.d.ts.map +1 -0
- package/esm/next/features/coloring/areaColorStrategy.js +83 -0
- package/esm/next/features/coloring/areaColorStrategy.js.map +1 -0
- package/esm/next/features/coloring/areaPalette.d.ts +28 -0
- package/esm/next/features/coloring/areaPalette.d.ts.map +1 -0
- package/esm/next/features/coloring/areaPalette.js +41 -0
- package/esm/next/features/coloring/areaPalette.js.map +1 -0
- package/esm/next/features/coloring/colorStrategy.d.ts +2 -2
- package/esm/next/features/coloring/colorStrategy.d.ts.map +1 -1
- package/esm/next/features/coloring/colorStrategy.js +2 -2
- package/esm/next/features/coloring/colorStrategy.js.map +1 -1
- package/esm/next/features/data/areaTransformation.d.ts +60 -0
- package/esm/next/features/data/areaTransformation.d.ts.map +1 -0
- package/esm/next/features/data/areaTransformation.js +248 -0
- package/esm/next/features/data/areaTransformation.js.map +1 -0
- package/esm/next/features/data/dataSourceManagement.d.ts +2 -2
- package/esm/next/features/data/dataSourceManagement.d.ts.map +1 -1
- package/esm/next/features/data/dataSourceManagement.js.map +1 -1
- package/esm/next/features/data/pushpinTransformation.d.ts +72 -0
- package/esm/next/features/data/pushpinTransformation.d.ts.map +1 -0
- package/esm/next/features/data/{transformation.js → pushpinTransformation.js} +21 -70
- package/esm/next/features/data/pushpinTransformation.js.map +1 -0
- package/esm/next/features/data/transformationCommon.d.ts +21 -0
- package/esm/next/features/data/transformationCommon.d.ts.map +1 -0
- package/esm/next/features/data/transformationCommon.js +52 -0
- package/esm/next/features/data/transformationCommon.js.map +1 -0
- package/esm/next/features/map/areaLayerManagement.d.ts +51 -0
- package/esm/next/features/map/areaLayerManagement.d.ts.map +1 -0
- package/esm/next/features/map/areaLayerManagement.js +81 -0
- package/esm/next/features/map/areaLayerManagement.js.map +1 -0
- package/esm/next/features/map/layerManagement.d.ts +3 -3
- package/esm/next/features/map/layerManagement.d.ts.map +1 -1
- package/esm/next/features/map/layerManagement.js.map +1 -1
- package/esm/next/features/map/viewportManagement.d.ts +13 -0
- package/esm/next/features/map/viewportManagement.d.ts.map +1 -1
- package/esm/next/features/map/viewportManagement.js +30 -0
- package/esm/next/features/map/viewportManagement.js.map +1 -1
- package/esm/next/features/tooltip/tooltipManagement.d.ts +1 -1
- package/esm/next/features/tooltip/tooltipManagement.d.ts.map +1 -1
- package/esm/next/features/tooltip/tooltipManagement.js +11 -7
- package/esm/next/features/tooltip/tooltipManagement.js.map +1 -1
- package/esm/next/helpers/areaAttributeResolver.d.ts +10 -0
- package/esm/next/helpers/areaAttributeResolver.d.ts.map +1 -0
- package/esm/next/helpers/areaAttributeResolver.js +26 -0
- package/esm/next/helpers/areaAttributeResolver.js.map +1 -0
- package/esm/next/hooks/init/useInitExecution.d.ts +5 -2
- package/esm/next/hooks/init/useInitExecution.d.ts.map +1 -1
- package/esm/next/hooks/init/useInitExecution.js +32 -16
- package/esm/next/hooks/init/useInitExecution.js.map +1 -1
- package/esm/next/hooks/legend/useAreaLegendItems.d.ts +27 -0
- package/esm/next/hooks/legend/useAreaLegendItems.d.ts.map +1 -0
- package/esm/next/hooks/legend/useAreaLegendItems.js +33 -0
- package/esm/next/hooks/legend/useAreaLegendItems.js.map +1 -0
- package/esm/next/hooks/legend/useLegendDetails.d.ts +2 -2
- package/esm/next/hooks/legend/useLegendDetails.d.ts.map +1 -1
- package/esm/next/hooks/legend/useLegendDetails.js.map +1 -1
- package/esm/next/hooks/legend/useLegendProps.d.ts +2 -2
- package/esm/next/hooks/legend/useLegendProps.d.ts.map +1 -1
- package/esm/next/hooks/legend/useLegendProps.js.map +1 -1
- package/esm/next/hooks/legend/{useLegendItems.d.ts → usePushpinLegendItems.d.ts} +3 -3
- package/esm/next/hooks/legend/usePushpinLegendItems.d.ts.map +1 -0
- package/esm/next/hooks/legend/usePushpinLegendItems.js +33 -0
- package/esm/next/hooks/legend/usePushpinLegendItems.js.map +1 -0
- package/esm/next/hooks/map/useAreaMapDataSync.d.ts +9 -0
- package/esm/next/hooks/map/useAreaMapDataSync.d.ts.map +1 -0
- package/esm/next/hooks/map/useAreaMapDataSync.js +71 -0
- package/esm/next/hooks/map/useAreaMapDataSync.js.map +1 -0
- package/esm/next/hooks/map/useMapDataSync.d.ts +2 -2
- package/esm/next/hooks/map/useMapDataSync.d.ts.map +1 -1
- package/esm/next/hooks/map/useMapDataSync.js.map +1 -1
- package/esm/next/hooks/map/useTooltipHandlers.d.ts +1 -1
- package/esm/next/hooks/map/useTooltipHandlers.d.ts.map +1 -1
- package/esm/next/hooks/map/useTooltipHandlers.js +3 -3
- package/esm/next/hooks/map/useTooltipHandlers.js.map +1 -1
- package/esm/next/hooks/shared/geoCollectionBoundingBox.d.ts +17 -0
- package/esm/next/hooks/shared/geoCollectionBoundingBox.d.ts.map +1 -0
- package/esm/next/hooks/shared/geoCollectionBoundingBox.js +86 -0
- package/esm/next/hooks/shared/geoCollectionBoundingBox.js.map +1 -0
- package/esm/next/hooks/shared/useAreaCollectionFeatures.d.ts +43 -0
- package/esm/next/hooks/shared/useAreaCollectionFeatures.d.ts.map +1 -0
- package/esm/next/hooks/shared/useAreaCollectionFeatures.js +213 -0
- package/esm/next/hooks/shared/useAreaCollectionFeatures.js.map +1 -0
- package/esm/next/hooks/shared/useAreaDataTransformation.d.ts +21 -0
- package/esm/next/hooks/shared/useAreaDataTransformation.d.ts.map +1 -0
- package/esm/next/hooks/shared/useAreaDataTransformation.js +25 -0
- package/esm/next/hooks/shared/useAreaDataTransformation.js.map +1 -0
- package/esm/next/hooks/shared/useAreaPushData.d.ts +11 -0
- package/esm/next/hooks/shared/useAreaPushData.d.ts.map +1 -0
- package/esm/next/hooks/shared/useAreaPushData.js +20 -0
- package/esm/next/hooks/shared/useAreaPushData.js.map +1 -0
- package/esm/next/hooks/shared/useGeoDataTransformation.d.ts +4 -18
- package/esm/next/hooks/shared/useGeoDataTransformation.d.ts.map +1 -1
- package/esm/next/hooks/shared/useGeoDataTransformation.js +5 -22
- package/esm/next/hooks/shared/useGeoDataTransformation.js.map +1 -1
- package/esm/next/hooks/shared/useGeoPushData.d.ts +20 -0
- package/esm/next/hooks/shared/useGeoPushData.d.ts.map +1 -0
- package/esm/next/hooks/shared/useGeoPushData.js +36 -0
- package/esm/next/hooks/shared/useGeoPushData.js.map +1 -0
- package/esm/next/hooks/shared/usePushData.d.ts.map +1 -1
- package/esm/next/hooks/shared/usePushData.js +5 -26
- package/esm/next/hooks/shared/usePushData.js.map +1 -1
- package/esm/next/hooks/shared/usePushpinDataTransformation.d.ts +23 -0
- package/esm/next/hooks/shared/usePushpinDataTransformation.d.ts.map +1 -0
- package/esm/next/hooks/shared/usePushpinDataTransformation.js +27 -0
- package/esm/next/hooks/shared/usePushpinDataTransformation.js.map +1 -0
- package/esm/next/hooks/shared/useResolvedAreaProps.d.ts +16 -0
- package/esm/next/hooks/shared/useResolvedAreaProps.d.ts.map +1 -0
- package/esm/next/hooks/shared/useResolvedAreaProps.js +36 -0
- package/esm/next/hooks/shared/useResolvedAreaProps.js.map +1 -0
- package/esm/next/hooks/shared/useResolvedPlaceholderValues.d.ts +8 -0
- package/esm/next/hooks/shared/useResolvedPlaceholderValues.d.ts.map +1 -0
- package/esm/next/hooks/shared/useResolvedPlaceholderValues.js +11 -0
- package/esm/next/hooks/shared/useResolvedPlaceholderValues.js.map +1 -0
- package/esm/next/hooks/shared/useResolvedProps.d.ts.map +1 -1
- package/esm/next/hooks/shared/useResolvedProps.js +3 -3
- package/esm/next/hooks/shared/useResolvedProps.js.map +1 -1
- package/esm/next/hooks/shared/useSegmentLegendItems.d.ts +17 -0
- package/esm/next/hooks/shared/useSegmentLegendItems.d.ts.map +1 -0
- package/esm/next/hooks/shared/useSegmentLegendItems.js +33 -0
- package/esm/next/hooks/shared/useSegmentLegendItems.js.map +1 -0
- package/esm/next/index.d.ts +4 -0
- package/esm/next/index.d.ts.map +1 -1
- package/esm/next/index.js +1 -0
- package/esm/next/index.js.map +1 -1
- package/esm/next/providers/maplibre/maplibreDataLayers.d.ts +2 -2
- package/esm/next/providers/maplibre/maplibreDataLayers.d.ts.map +1 -1
- package/esm/next/providers/maplibre/maplibreDataLayers.js.map +1 -1
- package/esm/next/providers/maplibre/maplibreDataLayersArea.d.ts +41 -0
- package/esm/next/providers/maplibre/maplibreDataLayersArea.d.ts.map +1 -0
- package/esm/next/providers/maplibre/maplibreDataLayersArea.js +83 -0
- package/esm/next/providers/maplibre/maplibreDataLayersArea.js.map +1 -0
- package/esm/next/providers/maplibre/maplibreDataSource.d.ts +2 -2
- package/esm/next/providers/maplibre/maplibreDataSource.d.ts.map +1 -1
- package/esm/next/providers/maplibre/maplibreDataSourceArea.d.ts +34 -0
- package/esm/next/providers/maplibre/maplibreDataSourceArea.d.ts.map +1 -0
- package/esm/next/providers/maplibre/maplibreDataSourceArea.js +209 -0
- package/esm/next/providers/maplibre/maplibreDataSourceArea.js.map +1 -0
- package/esm/next/providers/maplibre/maplibreTooltip.d.ts.map +1 -1
- package/esm/next/providers/maplibre/maplibreTooltip.js +20 -4
- package/esm/next/providers/maplibre/maplibreTooltip.js.map +1 -1
- package/esm/next/types/areaConfig.d.ts +68 -0
- package/esm/next/types/areaConfig.d.ts.map +1 -0
- package/esm/next/types/areaConfig.js +3 -0
- package/esm/next/types/areaConfig.js.map +1 -0
- package/esm/next/types/areaInternal.d.ts +13 -0
- package/esm/next/types/areaInternal.d.ts.map +1 -0
- package/esm/next/types/areaInternal.js +3 -0
- package/esm/next/types/areaInternal.js.map +1 -0
- package/esm/next/types/areaPublic.d.ts +68 -0
- package/esm/next/types/areaPublic.d.ts.map +1 -0
- package/esm/next/types/areaPublic.js +3 -0
- package/esm/next/types/areaPublic.js.map +1 -0
- package/esm/next/types/shared.d.ts +57 -21
- package/esm/next/types/shared.d.ts.map +1 -1
- package/esm/next/utils/geoCollection.d.ts +40 -0
- package/esm/next/utils/geoCollection.d.ts.map +1 -0
- package/esm/next/utils/geoCollection.js +102 -0
- package/esm/next/utils/geoCollection.js.map +1 -0
- package/package.json +10 -9
- package/styles/css/main.css +18 -0
- package/styles/css/main.css.map +1 -1
- package/styles/scss/geo-area-next.scss +24 -0
- package/styles/scss/main.scss +1 -0
- package/esm/next/features/data/transformation.d.ts +0 -99
- package/esm/next/features/data/transformation.d.ts.map +0 -1
- package/esm/next/features/data/transformation.js.map +0 -1
- package/esm/next/hooks/legend/useLegendItems.d.ts.map +0 -1
- package/esm/next/hooks/legend/useLegendItems.js +0 -54
- package/esm/next/hooks/legend/useLegendItems.js.map +0 -1
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// (C) 2025 GoodData Corporation
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { attributeDisplayFormRef, isIdentifierRef, objRefToString, } from "@gooddata/sdk-model";
|
|
4
|
+
import { useBackend, useWorkspace } from "@gooddata/sdk-ui";
|
|
5
|
+
import { deriveCollectionBoundingBox } from "./geoCollectionBoundingBox.js";
|
|
6
|
+
import { getLocationCollectionMetadata } from "../../utils/geoCollection.js";
|
|
7
|
+
const COLLECTION_OVERRIDES = {
|
|
8
|
+
region: {
|
|
9
|
+
collectionId: "regions",
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
function normalizeGeoCollectionMetadata(collectionId) {
|
|
13
|
+
const override = COLLECTION_OVERRIDES[collectionId];
|
|
14
|
+
if (!override) {
|
|
15
|
+
return { collectionId };
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
collectionId: override.collectionId ?? collectionId,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function resolveareaDisplayFormRef(locationAttribute) {
|
|
22
|
+
if (!locationAttribute) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return attributeDisplayFormRef(locationAttribute);
|
|
26
|
+
}
|
|
27
|
+
function ensureIdleState(prev) {
|
|
28
|
+
if (prev.status === "idle" && !prev.result && !prev.error) {
|
|
29
|
+
return prev;
|
|
30
|
+
}
|
|
31
|
+
return { status: "idle" };
|
|
32
|
+
}
|
|
33
|
+
function fetchCollectionMetadata(args) {
|
|
34
|
+
const { backend, workspace, areaDisplayFormRef, fetchedMetadata, metadataFromExecution, setFetchedMetadata, } = args;
|
|
35
|
+
if (metadataFromExecution || !backend || !workspace || fetchedMetadata !== undefined) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!areaDisplayFormRef) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (!isIdentifierRef(areaDisplayFormRef)) {
|
|
42
|
+
setFetchedMetadata(null);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let cancelled = false;
|
|
46
|
+
backend
|
|
47
|
+
.workspace(workspace)
|
|
48
|
+
.attributes()
|
|
49
|
+
.getAttributeDisplayForm(areaDisplayFormRef)
|
|
50
|
+
.then((displayForm) => {
|
|
51
|
+
if (cancelled) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const geoAreaConfig = displayForm.geoAreaConfig;
|
|
55
|
+
if (geoAreaConfig?.collectionId) {
|
|
56
|
+
const normalized = normalizeGeoCollectionMetadata(geoAreaConfig.collectionId);
|
|
57
|
+
setFetchedMetadata(normalized);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
setFetchedMetadata(null);
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
.catch((_error) => {
|
|
64
|
+
if (cancelled) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
setFetchedMetadata(null);
|
|
68
|
+
});
|
|
69
|
+
return () => {
|
|
70
|
+
cancelled = true;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function resolveMetadata(metadataFromExecution, fetchedMetadata) {
|
|
74
|
+
if (metadataFromExecution) {
|
|
75
|
+
return metadataFromExecution;
|
|
76
|
+
}
|
|
77
|
+
return fetchedMetadata === null ? undefined : fetchedMetadata;
|
|
78
|
+
}
|
|
79
|
+
function buildCacheKey(fingerprint, metadata) {
|
|
80
|
+
if (!fingerprint || !metadata) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
return [fingerprint, metadata.collectionId].join("|");
|
|
84
|
+
}
|
|
85
|
+
function fetchCollectionItems(args) {
|
|
86
|
+
const { cacheKey, cacheRef, dataView, locationAttribute, metadata, setState } = args;
|
|
87
|
+
if (!dataView || !locationAttribute || !metadata || !cacheKey) {
|
|
88
|
+
setState(ensureIdleState);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (cacheRef.current.has(cacheKey)) {
|
|
92
|
+
const cached = cacheRef.current.get(cacheKey);
|
|
93
|
+
setState({
|
|
94
|
+
status: "success",
|
|
95
|
+
result: cached,
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
let cancelled = false;
|
|
100
|
+
setState({ status: "loading" });
|
|
101
|
+
dataView
|
|
102
|
+
.getCollectionItemsForAttribute(locationAttribute, {
|
|
103
|
+
collectionId: metadata.collectionId,
|
|
104
|
+
})
|
|
105
|
+
.then((result) => {
|
|
106
|
+
if (cancelled) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
cacheRef.current.set(cacheKey, result);
|
|
110
|
+
setState({
|
|
111
|
+
status: "success",
|
|
112
|
+
result,
|
|
113
|
+
});
|
|
114
|
+
})
|
|
115
|
+
.catch((error) => {
|
|
116
|
+
if (cancelled) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
setState({
|
|
120
|
+
status: "error",
|
|
121
|
+
error,
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
return () => {
|
|
125
|
+
cancelled = true;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function buildResult(metadata, state) {
|
|
129
|
+
if (!metadata) {
|
|
130
|
+
return {
|
|
131
|
+
status: "idle",
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
if (state.status === "success") {
|
|
135
|
+
const bbox = deriveCollectionBoundingBox(state.result?.features, state.result?.bbox);
|
|
136
|
+
return {
|
|
137
|
+
status: "success",
|
|
138
|
+
metadata,
|
|
139
|
+
features: state.result?.features ?? [],
|
|
140
|
+
bbox,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
if (state.status === "error") {
|
|
144
|
+
return {
|
|
145
|
+
status: "error",
|
|
146
|
+
metadata,
|
|
147
|
+
error: state.error,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
status: state.status,
|
|
152
|
+
metadata,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Loads geo collection geometries for the area location attribute.
|
|
157
|
+
*
|
|
158
|
+
* @remarks
|
|
159
|
+
* The hook deduplicates requests using a local cache keyed by the execution fingerprint and collection metadata.
|
|
160
|
+
* If the necessary metadata are missing, the hook stays idle and returns no features.
|
|
161
|
+
*
|
|
162
|
+
* @param dataView - Initial execution data view
|
|
163
|
+
* @param locationAttribute - Attribute used for area locations
|
|
164
|
+
* @returns collection features state
|
|
165
|
+
*
|
|
166
|
+
* @alpha
|
|
167
|
+
*/
|
|
168
|
+
export function useAreaCollectionFeatures(dataView, locationAttribute, backendOrUndefined, workspaceOrUndefined) {
|
|
169
|
+
const backendFromContext = useBackend();
|
|
170
|
+
const workspaceFromContext = useWorkspace();
|
|
171
|
+
const backend = backendOrUndefined ?? backendFromContext;
|
|
172
|
+
const workspace = workspaceOrUndefined ?? workspaceFromContext;
|
|
173
|
+
const metadataFromExecution = useMemo(() => {
|
|
174
|
+
const raw = getLocationCollectionMetadata(dataView);
|
|
175
|
+
if (!raw) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
return normalizeGeoCollectionMetadata(raw.collectionId);
|
|
179
|
+
}, [dataView]);
|
|
180
|
+
const areaDisplayFormRef = useMemo(() => resolveareaDisplayFormRef(locationAttribute), [locationAttribute]);
|
|
181
|
+
const areaDisplayFormRefKey = useMemo(() => (areaDisplayFormRef ? objRefToString(areaDisplayFormRef) : ""), [areaDisplayFormRef]);
|
|
182
|
+
const [fetchedMetadata, setFetchedMetadata] = useState(undefined);
|
|
183
|
+
const fingerprint = dataView?.fingerprint();
|
|
184
|
+
const cacheRef = useRef(new Map());
|
|
185
|
+
const [state, setState] = useState({ status: "idle" });
|
|
186
|
+
useEffect(() => {
|
|
187
|
+
setFetchedMetadata(undefined);
|
|
188
|
+
}, [areaDisplayFormRefKey, metadataFromExecution]);
|
|
189
|
+
useEffect(() => {
|
|
190
|
+
return fetchCollectionMetadata({
|
|
191
|
+
backend,
|
|
192
|
+
workspace,
|
|
193
|
+
areaDisplayFormRef,
|
|
194
|
+
fetchedMetadata,
|
|
195
|
+
metadataFromExecution,
|
|
196
|
+
setFetchedMetadata,
|
|
197
|
+
});
|
|
198
|
+
}, [backend, workspace, areaDisplayFormRef, fetchedMetadata, metadataFromExecution]);
|
|
199
|
+
const metadata = resolveMetadata(metadataFromExecution, fetchedMetadata);
|
|
200
|
+
const cacheKey = useMemo(() => buildCacheKey(fingerprint, metadata), [fingerprint, metadata]);
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
return fetchCollectionItems({
|
|
203
|
+
cacheKey,
|
|
204
|
+
cacheRef,
|
|
205
|
+
dataView,
|
|
206
|
+
locationAttribute,
|
|
207
|
+
metadata,
|
|
208
|
+
setState,
|
|
209
|
+
});
|
|
210
|
+
}, [cacheKey, dataView, locationAttribute, metadata]);
|
|
211
|
+
return buildResult(metadata, state);
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=useAreaCollectionFeatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAreaCollectionFeatures.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useAreaCollectionFeatures.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAA8C,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGzG,OAAO,EAIH,uBAAuB,EACvB,eAAe,EACf,cAAc,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAkB,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAA0B,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAMrG,MAAM,oBAAoB,GAA2C;IACjE,MAAM,EAAE;QACJ,YAAY,EAAE,SAAS;KAC1B;CACJ,CAAC;AAEF,SAAS,8BAA8B,CAAC,YAAoB;IACxD,MAAM,QAAQ,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAEpD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,EAAE,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED,OAAO;QACH,YAAY,EAAE,QAAQ,CAAC,YAAY,IAAI,YAAY;KACtD,CAAC;AACN,CAAC;AAiCD,SAAS,yBAAyB,CAAC,iBAAyC;IACxE,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,OAAO,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,eAAe,CAAC,IAAsB;IAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACxD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM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AClC,CAAC,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAEnD,SAAS,CAAC,GAAG,EAAE;QACX,OAAO,uBAAuB,CAAC;YAC3B,OAAO;YACP,SAAS;YACT,kBAAkB;YAClB,eAAe;YACf,qBAAqB;YACrB,kBAAkB;SACrB,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAErF,MAAM,QAAQ,GAAG,eAAe,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE9F,SAAS,CAAC,GAAG,EAAE;QACX,OAAO,oBAAoB,CAAC;YACxB,QAAQ;YACR,QAAQ;YACR,QAAQ;YACR,iBAAiB;YACjB,QAAQ;YACR,QAAQ;SACX,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEtD,OAAO,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DataViewFacade } from "@gooddata/sdk-ui";
|
|
2
|
+
import { IAreaGeoData } from "../../types/shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Transforms DataView into IAreaGeoData structure.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This hook transforms the execution result data view into the IAreaGeoData format
|
|
8
|
+
* required for rendering geographic areas on the map. It handles:
|
|
9
|
+
* - Extracting area identifiers (country codes, region IDs, etc.)
|
|
10
|
+
* - Extracting color measure values for area fill
|
|
11
|
+
* - Processing segment attribute values and URIs
|
|
12
|
+
* - Handling tooltip text attribute values
|
|
13
|
+
* - Managing empty and null values with localized strings
|
|
14
|
+
*
|
|
15
|
+
* @param dataView - Data view facade containing execution results
|
|
16
|
+
* @returns Transformed area geographic data ready for map rendering, or null if no data view
|
|
17
|
+
*
|
|
18
|
+
* @alpha
|
|
19
|
+
*/
|
|
20
|
+
export declare function useAreaDataTransformation(dataView: DataViewFacade | null): IAreaGeoData | null;
|
|
21
|
+
//# sourceMappingURL=useAreaDataTransformation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAreaDataTransformation.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useAreaDataTransformation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAQrD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,GAAG,YAAY,GAAG,IAAI,CAE9F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// (C) 2025 GoodData Corporation
|
|
2
|
+
import { useGeoDataTransformation } from "./useGeoDataTransformation.js";
|
|
3
|
+
import { getAreaGeoData } from "../../features/data/areaTransformation.js";
|
|
4
|
+
const transformAreaGeoData = (dataView, emptyHeaderString, nullHeaderString) => getAreaGeoData(dataView, emptyHeaderString, nullHeaderString);
|
|
5
|
+
/**
|
|
6
|
+
* Transforms DataView into IAreaGeoData structure.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This hook transforms the execution result data view into the IAreaGeoData format
|
|
10
|
+
* required for rendering geographic areas on the map. It handles:
|
|
11
|
+
* - Extracting area identifiers (country codes, region IDs, etc.)
|
|
12
|
+
* - Extracting color measure values for area fill
|
|
13
|
+
* - Processing segment attribute values and URIs
|
|
14
|
+
* - Handling tooltip text attribute values
|
|
15
|
+
* - Managing empty and null values with localized strings
|
|
16
|
+
*
|
|
17
|
+
* @param dataView - Data view facade containing execution results
|
|
18
|
+
* @returns Transformed area geographic data ready for map rendering, or null if no data view
|
|
19
|
+
*
|
|
20
|
+
* @alpha
|
|
21
|
+
*/
|
|
22
|
+
export function useAreaDataTransformation(dataView) {
|
|
23
|
+
return useGeoDataTransformation(dataView, transformAreaGeoData);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=useAreaDataTransformation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAreaDataTransformation.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useAreaDataTransformation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAIhC,OAAO,EAAsB,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAG3E,MAAM,oBAAoB,GAAqC,CAC3D,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAClB,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAA+B;IACrE,OAAO,wBAAwB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IColorPalette } from "@gooddata/sdk-model";
|
|
2
|
+
import { IColorStrategy } from "@gooddata/sdk-ui-vis-commons";
|
|
3
|
+
import { IAvailableLegends } from "../../types/shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Area-specific hook to push data to analytical designer for configuration panel updates.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function useAreaPushData(colorStrategy: IColorStrategy | null, colorPalette: IColorPalette): void;
|
|
10
|
+
export declare function isAreaLegendVisible(availableLegends: IAvailableLegends): boolean;
|
|
11
|
+
//# sourceMappingURL=useAreaPushData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAreaPushData.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useAreaPushData.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,cAAc,GAAG,IAAI,EAAE,YAAY,EAAE,aAAa,GAAG,IAAI,CAMvG;AAED,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,OAAO,CAEhF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// (C) 2025 GoodData Corporation
|
|
2
|
+
import { useGeoPushData } from "./useGeoPushData.js";
|
|
3
|
+
import { useGeoAreaData } from "../../context/GeoAreaDataContext.js";
|
|
4
|
+
import { useGeoAreaProps } from "../../context/GeoAreaPropsContext.js";
|
|
5
|
+
/**
|
|
6
|
+
* Area-specific hook to push data to analytical designer for configuration panel updates.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export function useAreaPushData(colorStrategy, colorPalette) {
|
|
11
|
+
useGeoPushData(colorStrategy, colorPalette, {
|
|
12
|
+
useProps: useGeoAreaProps,
|
|
13
|
+
useLegendContext: useGeoAreaData,
|
|
14
|
+
getLegendVisibility: isAreaLegendVisible,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export function isAreaLegendVisible(availableLegends) {
|
|
18
|
+
return availableLegends.hasCategoryLegend || availableLegends.hasColorLegend;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=useAreaPushData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAreaPushData.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useAreaPushData.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAKhC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAGvE;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,aAAoC,EAAE,YAA2B;IAC7F,cAAc,CAAC,aAAa,EAAE,YAAY,EAAE;QACxC,QAAQ,EAAE,eAAe;QACzB,gBAAgB,EAAE,cAAc;QAChC,mBAAmB,EAAE,mBAAmB;KAC3C,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,gBAAmC;IACnE,OAAO,gBAAgB,CAAC,iBAAiB,IAAI,gBAAgB,CAAC,cAAc,CAAC;AACjF,CAAC"}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import { DataViewFacade } from "@gooddata/sdk-ui";
|
|
2
|
-
|
|
2
|
+
export type GeoDataTransformer<TResult> = (dataView: DataViewFacade, emptyHeaderString: string, nullHeaderString: string) => TResult;
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Resolves localized strings and transforms execution data into geo data structures.
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
7
|
-
* This hook transforms the execution result data view into the IGeoData format
|
|
8
|
-
* required for rendering pushpins on the map. It handles:
|
|
9
|
-
* - Parsing location coordinates (single location or lat/lng pair)
|
|
10
|
-
* - Extracting size and color measure values
|
|
11
|
-
* - Processing segment attribute values and URIs
|
|
12
|
-
* - Handling tooltip text attribute values
|
|
13
|
-
* - Managing empty and null values with localized strings
|
|
14
|
-
*
|
|
15
|
-
* The transformation logic is based on the existing getGeoData helper from the core implementation.
|
|
16
|
-
*
|
|
17
|
-
* @param dataView - Data view facade containing execution results
|
|
18
|
-
* @returns Transformed geographic data ready for map rendering, or null if no data view
|
|
19
|
-
*
|
|
20
|
-
* @alpha
|
|
6
|
+
* @internal
|
|
21
7
|
*/
|
|
22
|
-
export declare function useGeoDataTransformation(dataView: DataViewFacade | null):
|
|
8
|
+
export declare function useGeoDataTransformation<TResult>(dataView: DataViewFacade | null, transformer: GeoDataTransformer<TResult>): TResult | null;
|
|
23
9
|
//# sourceMappingURL=useGeoDataTransformation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGeoDataTransformation.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useGeoDataTransformation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useGeoDataTransformation.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useGeoDataTransformation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,kBAAkB,CAAC,OAAO,IAAI,CACtC,QAAQ,EAAE,cAAc,EACxB,iBAAiB,EAAE,MAAM,EACzB,gBAAgB,EAAE,MAAM,KACvB,OAAO,CAAC;AAEb;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAC5C,QAAQ,EAAE,cAAc,GAAG,IAAI,EAC/B,WAAW,EAAE,kBAAkB,CAAC,OAAO,CAAC,GACzC,OAAO,GAAG,IAAI,CAahB"}
|
|
@@ -1,37 +1,20 @@
|
|
|
1
1
|
// (C) 2025 GoodData Corporation
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import { getGeoData } from "../../features/data/transformation.js";
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
5
|
+
* Resolves localized strings and transforms execution data into geo data structures.
|
|
7
6
|
*
|
|
8
|
-
* @
|
|
9
|
-
* This hook transforms the execution result data view into the IGeoData format
|
|
10
|
-
* required for rendering pushpins on the map. It handles:
|
|
11
|
-
* - Parsing location coordinates (single location or lat/lng pair)
|
|
12
|
-
* - Extracting size and color measure values
|
|
13
|
-
* - Processing segment attribute values and URIs
|
|
14
|
-
* - Handling tooltip text attribute values
|
|
15
|
-
* - Managing empty and null values with localized strings
|
|
16
|
-
*
|
|
17
|
-
* The transformation logic is based on the existing getGeoData helper from the core implementation.
|
|
18
|
-
*
|
|
19
|
-
* @param dataView - Data view facade containing execution results
|
|
20
|
-
* @returns Transformed geographic data ready for map rendering, or null if no data view
|
|
21
|
-
*
|
|
22
|
-
* @alpha
|
|
7
|
+
* @internal
|
|
23
8
|
*/
|
|
24
|
-
export function useGeoDataTransformation(dataView) {
|
|
9
|
+
export function useGeoDataTransformation(dataView, transformer) {
|
|
25
10
|
const intl = useIntl();
|
|
26
11
|
return useMemo(() => {
|
|
27
12
|
if (!dataView) {
|
|
28
13
|
return null;
|
|
29
14
|
}
|
|
30
|
-
// Localized strings for empty and null values
|
|
31
15
|
const emptyHeaderString = intl.formatMessage({ id: "visualization.emptyValue" });
|
|
32
16
|
const nullHeaderString = intl.formatMessage({ id: "visualization.emptyValue" });
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, [dataView, intl]);
|
|
17
|
+
return transformer(dataView, emptyHeaderString, nullHeaderString);
|
|
18
|
+
}, [dataView, intl, transformer]);
|
|
36
19
|
}
|
|
37
20
|
//# sourceMappingURL=useGeoDataTransformation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGeoDataTransformation.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useGeoDataTransformation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"useGeoDataTransformation.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useGeoDataTransformation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAUrC;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACpC,QAA+B,EAC/B,WAAwC;IAExC,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,OAAO,OAAO,CAAC,GAAG,EAAE;QAChB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,0BAA0B,EAAE,CAAC,CAAC;QACjF,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,0BAA0B,EAAE,CAAC,CAAC;QAEhF,OAAO,WAAW,CAAC,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IACtE,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IColorPalette } from "@gooddata/sdk-model";
|
|
2
|
+
import { IDataVisualizationProps } from "@gooddata/sdk-ui";
|
|
3
|
+
import { IColorStrategy } from "@gooddata/sdk-ui-vis-commons";
|
|
4
|
+
import { IAvailableLegends } from "../../types/shared.js";
|
|
5
|
+
interface ILegendContext {
|
|
6
|
+
availableLegends: IAvailableLegends;
|
|
7
|
+
}
|
|
8
|
+
interface IUseGeoPushDataConfig<TProps extends IDataVisualizationProps, TLegendContext extends ILegendContext> {
|
|
9
|
+
useProps: () => TProps;
|
|
10
|
+
useLegendContext: () => TLegendContext;
|
|
11
|
+
getLegendVisibility?: (availableLegends: IAvailableLegends) => boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Shared implementation for Analytical Designer pushData updates.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function useGeoPushData<TProps extends IDataVisualizationProps, TLegendContext extends ILegendContext>(colorStrategy: IColorStrategy | null, colorPalette: IColorPalette, { useProps, useLegendContext, getLegendVisibility }: IUseGeoPushDataConfig<TProps, TLegendContext>): void;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=useGeoPushData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGeoPushData.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useGeoPushData.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,UAAU,cAAc;IACpB,gBAAgB,EAAE,iBAAiB,CAAC;CACvC;AAED,UAAU,qBAAqB,CAC3B,MAAM,SAAS,uBAAuB,EACtC,cAAc,SAAS,cAAc;IAErC,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,cAAc,CAAC;IACvC,mBAAmB,CAAC,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,KAAK,OAAO,CAAC;CAC1E;AAOD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,SAAS,uBAAuB,EAAE,cAAc,SAAS,cAAc,EACxG,aAAa,EAAE,cAAc,GAAG,IAAI,EACpC,YAAY,EAAE,aAAa,EAC3B,EAAE,QAAQ,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,EAAE,qBAAqB,CAAC,MAAM,EAAE,cAAc,CAAC,GACnG,IAAI,CAyBN"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// (C) 2025 GoodData Corporation
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useInitialExecution } from "../../context/InitialExecutionContext.js";
|
|
4
|
+
const defaultLegendVisibility = (availableLegends) => {
|
|
5
|
+
const hasSizeLegend = availableLegends.hasSizeLegend ?? false;
|
|
6
|
+
return Boolean(availableLegends.hasCategoryLegend || availableLegends.hasColorLegend || hasSizeLegend);
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Shared implementation for Analytical Designer pushData updates.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export function useGeoPushData(colorStrategy, colorPalette, { useProps, useLegendContext, getLegendVisibility }) {
|
|
14
|
+
const props = useProps();
|
|
15
|
+
const { availableLegends } = useLegendContext();
|
|
16
|
+
const { initialDataView } = useInitialExecution();
|
|
17
|
+
const { pushData } = props;
|
|
18
|
+
const legendVisibilitySelector = getLegendVisibility ?? defaultLegendVisibility;
|
|
19
|
+
const isLegendVisible = legendVisibilitySelector(availableLegends);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!pushData || !colorStrategy) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
pushData({
|
|
25
|
+
dataView: initialDataView?.dataView,
|
|
26
|
+
propertiesMeta: {
|
|
27
|
+
legend_enabled: isLegendVisible,
|
|
28
|
+
},
|
|
29
|
+
colors: {
|
|
30
|
+
colorAssignments: colorStrategy.getColorAssignment(),
|
|
31
|
+
colorPalette,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}, [pushData, availableLegends, colorStrategy, colorPalette, initialDataView, isLegendVisible]);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=useGeoPushData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGeoPushData.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useGeoPushData.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAgB/E,MAAM,uBAAuB,GAA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3,"file":"usePushData.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/usePushData.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAM9D;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,cAAc,GAAG,IAAI,EAAE,YAAY,EAAE,aAAa,GAAG,IAAI,CAKnG"}
|
|
@@ -1,36 +1,15 @@
|
|
|
1
1
|
// (C) 2025 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { useGeoPushData } from "./useGeoPushData.js";
|
|
3
3
|
import { useGeoData } from "../../context/GeoDataContext.js";
|
|
4
4
|
import { useGeoPushpinProps } from "../../context/GeoPushpinPropsContext.js";
|
|
5
|
-
import { useInitialExecution } from "../../context/InitialExecutionContext.js";
|
|
6
5
|
/**
|
|
7
6
|
* Hook to push data to analytical designer for configuration panel updates
|
|
8
7
|
* @internal
|
|
9
8
|
*/
|
|
10
9
|
export function usePushData(colorStrategy, colorPalette) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
if (!pushData || !colorStrategy) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
// Check if legend should be visible
|
|
20
|
-
const isLegendVisible = availableLegends.hasCategoryLegend ||
|
|
21
|
-
availableLegends.hasColorLegend ||
|
|
22
|
-
availableLegends.hasSizeLegend;
|
|
23
|
-
pushData({
|
|
24
|
-
dataView: initialDataView?.dataView,
|
|
25
|
-
propertiesMeta: {
|
|
26
|
-
// toggle legend section
|
|
27
|
-
legend_enabled: isLegendVisible,
|
|
28
|
-
},
|
|
29
|
-
colors: {
|
|
30
|
-
colorAssignments: colorStrategy.getColorAssignment(),
|
|
31
|
-
colorPalette,
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
}, [pushData, availableLegends, colorStrategy, colorPalette, initialDataView]);
|
|
10
|
+
useGeoPushData(colorStrategy, colorPalette, {
|
|
11
|
+
useProps: useGeoPushpinProps,
|
|
12
|
+
useLegendContext: useGeoData,
|
|
13
|
+
});
|
|
35
14
|
}
|
|
36
15
|
//# sourceMappingURL=usePushData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePushData.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/usePushData.ts"],"names":[],"mappings":"AAAA,gCAAgC;
|
|
1
|
+
{"version":3,"file":"usePushData.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/usePushData.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAKhC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,aAAoC,EAAE,YAA2B;IACzF,cAAc,CAAC,aAAa,EAAE,YAAY,EAAE;QACxC,QAAQ,EAAE,kBAAkB;QAC5B,gBAAgB,EAAE,UAAU;KAC/B,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataViewFacade } from "@gooddata/sdk-ui";
|
|
2
|
+
import { IPushpinGeoData } from "../../types/shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Transforms DataView into IPushpinGeoData structure.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This hook transforms the execution result data view into the IPushpinGeoData format
|
|
8
|
+
* required for rendering pushpins on the map. It handles:
|
|
9
|
+
* - Parsing location coordinates (single location or lat/lng pair)
|
|
10
|
+
* - Extracting size and color measure values
|
|
11
|
+
* - Processing segment attribute values and URIs
|
|
12
|
+
* - Handling tooltip text attribute values
|
|
13
|
+
* - Managing empty and null values with localized strings
|
|
14
|
+
*
|
|
15
|
+
* The transformation logic is based on the existing getGeoData helper from the core implementation.
|
|
16
|
+
*
|
|
17
|
+
* @param dataView - Data view facade containing execution results
|
|
18
|
+
* @returns Transformed geographic data ready for map rendering, or null if no data view
|
|
19
|
+
*
|
|
20
|
+
* @alpha
|
|
21
|
+
*/
|
|
22
|
+
export declare function usePushpinDataTransformation(dataView: DataViewFacade | null): IPushpinGeoData | null;
|
|
23
|
+
//# sourceMappingURL=usePushpinDataTransformation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePushpinDataTransformation.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/usePushpinDataTransformation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAQxD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,GAAG,eAAe,GAAG,IAAI,CAEpG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// (C) 2025 GoodData Corporation
|
|
2
|
+
import { useGeoDataTransformation } from "./useGeoDataTransformation.js";
|
|
3
|
+
import { getPushpinGeoData } from "../../features/data/pushpinTransformation.js";
|
|
4
|
+
const transformPushpinGeoData = (dataView, emptyHeaderString, nullHeaderString) => getPushpinGeoData(dataView, emptyHeaderString, nullHeaderString);
|
|
5
|
+
/**
|
|
6
|
+
* Transforms DataView into IPushpinGeoData structure.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This hook transforms the execution result data view into the IPushpinGeoData format
|
|
10
|
+
* required for rendering pushpins on the map. It handles:
|
|
11
|
+
* - Parsing location coordinates (single location or lat/lng pair)
|
|
12
|
+
* - Extracting size and color measure values
|
|
13
|
+
* - Processing segment attribute values and URIs
|
|
14
|
+
* - Handling tooltip text attribute values
|
|
15
|
+
* - Managing empty and null values with localized strings
|
|
16
|
+
*
|
|
17
|
+
* The transformation logic is based on the existing getGeoData helper from the core implementation.
|
|
18
|
+
*
|
|
19
|
+
* @param dataView - Data view facade containing execution results
|
|
20
|
+
* @returns Transformed geographic data ready for map rendering, or null if no data view
|
|
21
|
+
*
|
|
22
|
+
* @alpha
|
|
23
|
+
*/
|
|
24
|
+
export function usePushpinDataTransformation(dataView) {
|
|
25
|
+
return useGeoDataTransformation(dataView, transformPushpinGeoData);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=usePushpinDataTransformation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePushpinDataTransformation.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/usePushpinDataTransformation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAIhC,OAAO,EAAsB,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAGjF,MAAM,uBAAuB,GAAwC,CACjE,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAClB,EAAE,CAAC,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAA+B;IACxE,OAAO,wBAAwB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IGeoAreaChartProps } from "../../types/areaPublic.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves area props into a normalized format
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Unlike pushpin charts, area always uses a single area attribute
|
|
7
|
+
* (geographic areas like countries or regions), so no special resolution is needed.
|
|
8
|
+
* This hook exists for consistency with the pushpin implementation.
|
|
9
|
+
*
|
|
10
|
+
* @param props - Raw props from component
|
|
11
|
+
* @returns Resolved props ready for execution
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function useResolvedAreaProps(props: IGeoAreaChartProps): IGeoAreaChartProps;
|
|
16
|
+
//# sourceMappingURL=useResolvedAreaProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResolvedAreaProps.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useResolvedAreaProps.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,kBAAkB,CAmBlF"}
|