@dynatrace/strato-geo 1.0.3 → 1.2.1
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/index.js.map +2 -2
- package/esm/map/MapView.js +14 -10
- package/esm/map/MapView.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleCircleLayer.js +6 -6
- package/esm/map/components/BubbleLayer/BubbleCircleLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayer.js +1 -1
- package/esm/map/components/BubbleLayer/BubbleLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleOutlineLayer.js +1 -1
- package/esm/map/components/BubbleLayer/BubbleOutlineLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/utils/parse-bubble-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js +47 -24
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js +2 -1
- package/esm/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js +30 -48
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerDirection.js +10 -3
- package/esm/map/components/ConnectionLayer/ConnectionLayerDirection.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerLine.js +44 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayerLine.js.map +7 -0
- package/esm/map/components/ConnectionLayer/utils/{get-arc-line-features.js → get-arc-line-feature.js} +4 -8
- package/esm/map/components/ConnectionLayer/utils/{get-arc-line-features.js.map → get-arc-line-feature.js.map} +3 -3
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-feature.js +11 -0
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-feature.js.map +7 -0
- package/esm/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js +24 -19
- package/esm/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ConnectionLayer/utils/parse-direction-data-to-geo-json.js.map +1 -1
- package/esm/map/components/DotLayer/BackgroundLayer.js +1 -1
- package/esm/map/components/DotLayer/BackgroundLayer.js.map +2 -2
- package/esm/map/components/DotLayer/DotLayer.js +5 -5
- package/esm/map/components/DotLayer/DotLayer.js.map +2 -2
- package/esm/map/components/DotLayer/utils/parse-dot-data-to-geo-json.js.map +2 -2
- package/esm/map/components/MapContent.js +33 -7
- package/esm/map/components/MapContent.js.map +2 -2
- package/esm/map/components/MapUnavailable.js +2 -2
- package/esm/map/components/MapUnavailable.js.map +2 -2
- package/esm/map/components/toolbar/buttons/MapResetButton.js +1 -1
- package/esm/map/components/toolbar/buttons/MapResetButton.js.map +2 -2
- package/esm/map/components/toolbar/buttons/MapZoomInOutButtons.js +1 -1
- package/esm/map/components/toolbar/buttons/MapZoomInOutButtons.js.map +2 -2
- package/esm/map/components/toolbar/buttons/MapZoomToFitButton.js +1 -1
- package/esm/map/components/toolbar/buttons/MapZoomToFitButton.js.map +2 -2
- package/esm/map/constants.js +23 -17
- package/esm/map/constants.js.map +2 -2
- package/esm/map/contexts/map-data-bounding-box.context.js +2 -2
- package/esm/map/contexts/map-data-bounding-box.context.js.map +2 -2
- package/esm/map/hooks/use-active-interaction.js +14 -1
- package/esm/map/hooks/use-active-interaction.js.map +2 -2
- package/esm/map/hooks/use-attach-image-from-icon.js +4 -1
- package/esm/map/hooks/use-attach-image-from-icon.js.map +2 -2
- package/esm/map/hooks/use-attach-symbol-to-map.js +2 -2
- package/esm/map/hooks/use-attach-symbol-to-map.js.map +2 -2
- package/esm/map/hooks/use-hover-interaction.js +1 -1
- package/esm/map/hooks/use-hover-interaction.js.map +2 -2
- package/esm/map/hooks/use-legend-interaction-highlighting.js +30 -1
- package/esm/map/hooks/use-legend-interaction-highlighting.js.map +2 -2
- package/esm/map/hooks/use-legend-interaction-visibility.js +10 -1
- package/esm/map/hooks/use-legend-interaction-visibility.js.map +2 -2
- package/esm/map/hooks/use-load-map-base-layer.js +4 -4
- package/esm/map/hooks/use-load-map-base-layer.js.map +2 -2
- package/esm/map/hooks/use-map-mouse-move.js +1 -1
- package/esm/map/hooks/use-map-mouse-move.js.map +2 -2
- package/esm/map/hooks/use-resolve-color.js +4 -0
- package/esm/map/hooks/use-resolve-color.js.map +2 -2
- package/esm/map/providers/imperative-handler.provider.js +1 -1
- package/esm/map/providers/imperative-handler.provider.js.map +2 -2
- package/esm/map/providers/map-initial-view.provider.js +1 -1
- package/esm/map/providers/map-initial-view.provider.js.map +2 -2
- package/esm/map/slots/BaseLayer.js.map +2 -2
- package/esm/map/slots/BubbleLayer.js.map +2 -2
- package/esm/map/slots/CategoricalLegend.js.map +2 -2
- package/esm/map/slots/ChartInteractions.js +3 -3
- package/esm/map/slots/ChartInteractions.js.map +2 -2
- package/esm/map/slots/ChoroplethLayer.js.map +2 -2
- package/esm/map/slots/ConnectionLayer.js.map +2 -2
- package/esm/map/slots/DotLayer.js.map +2 -2
- package/esm/map/slots/SequentialLegend.js.map +2 -2
- package/esm/map/slots/ThresholdLegend.js.map +2 -2
- package/esm/map/slots/states/ErrorStateSlot.js.map +2 -2
- package/esm/map/types/bubble-layer.js.map +2 -2
- package/esm/map/types/coloring.js.map +2 -2
- package/esm/map/utils/attach-image-from-shape.js +3 -0
- package/esm/map/utils/attach-image-from-shape.js.map +2 -2
- package/esm/map/utils/attach-image-from-string.js.map +1 -1
- package/esm/map/utils/attach-image-from-text.js.map +1 -1
- package/esm/map/utils/attach-image-to-map.js +12 -5
- package/esm/map/utils/attach-image-to-map.js.map +2 -2
- package/esm/map/utils/build-scale-from-legend-config.js +5 -1
- package/esm/map/utils/build-scale-from-legend-config.js.map +2 -2
- package/esm/map/utils/create-categorical-color-scheme-from-custom-color-object.js +17 -0
- package/esm/map/utils/create-categorical-color-scheme-from-custom-color-object.js.map +7 -0
- package/esm/map/utils/extract-layers-data.js +50 -13
- package/esm/map/utils/extract-layers-data.js.map +2 -2
- package/esm/map/utils/iterate-config-slots.js +4 -2
- package/esm/map/utils/iterate-config-slots.js.map +2 -2
- package/esm/map/utils/set-layers-id.js +12 -4
- package/esm/map/utils/set-layers-id.js.map +2 -2
- package/esm/map/utils/tooltip-type-guards.js +1 -1
- package/esm/map/utils/tooltip-type-guards.js.map +2 -2
- package/esm/map/utils/use-set-map-initial-configuration.js.map +2 -2
- package/index.d.ts +2 -2
- package/map/MapView.d.ts +1 -1
- package/map/MapView.js +13 -9
- package/map/components/BubbleLayer/BubbleCircleLayer.js +5 -5
- package/map/components/BubbleLayer/BubbleLayer.js +2 -2
- package/map/components/BubbleLayer/BubbleOutlineLayer.js +2 -2
- package/map/components/BubbleLayer/utils/parse-bubble-data-to-geo-json.d.ts +2 -18
- package/map/components/ChoroplethLayer/ChoroplethLayer.d.ts +1 -1
- package/map/components/ChoroplethLayer/ChoroplethLayer.js +42 -22
- package/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js +2 -1
- package/map/components/ConnectionLayer/ConnectionLayer.d.ts +2 -2
- package/map/components/ConnectionLayer/ConnectionLayer.js +29 -41
- package/map/components/ConnectionLayer/ConnectionLayerDirection.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerDirection.js +9 -4
- package/map/components/ConnectionLayer/ConnectionLayerLine.d.ts +12 -0
- package/map/components/ConnectionLayer/ConnectionLayerLine.js +66 -0
- package/map/components/ConnectionLayer/utils/{get-arc-line-features.d.ts → get-arc-line-feature.d.ts} +1 -1
- package/map/components/ConnectionLayer/utils/{get-arc-line-features.js → get-arc-line-feature.js} +6 -10
- package/map/components/ConnectionLayer/utils/{get-straight-line-features.d.ts → get-straight-line-feature.d.ts} +1 -1
- package/map/components/ConnectionLayer/utils/{get-straight-line-features.js → get-straight-line-feature.js} +6 -7
- package/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.d.ts +1 -1
- package/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js +24 -19
- package/map/components/ConnectionLayer/utils/parse-direction-data-to-geo-json.d.ts +1 -1
- package/map/components/DotLayer/BackgroundLayer.js +2 -2
- package/map/components/DotLayer/DotLayer.js +5 -5
- package/map/components/DotLayer/utils/parse-dot-data-to-geo-json.d.ts +2 -19
- package/map/components/MapContent.d.ts +5 -1
- package/map/components/MapContent.js +28 -8
- package/map/components/MapUnavailable.d.ts +2 -2
- package/map/components/MapUnavailable.js +2 -2
- package/map/components/toolbar/buttons/MapResetButton.js +2 -2
- package/map/components/toolbar/buttons/MapZoomInOutButtons.js +2 -2
- package/map/components/toolbar/buttons/MapZoomToFitButton.js +2 -2
- package/map/constants.d.ts +13 -10
- package/map/constants.js +23 -17
- package/map/contexts/map-data-bounding-box.context.js +1 -1
- package/map/hooks/use-active-interaction.js +15 -2
- package/map/hooks/use-attach-image-from-icon.js +5 -2
- package/map/hooks/use-attach-symbol-to-map.js +2 -2
- package/map/hooks/use-hover-interaction.js +2 -2
- package/map/hooks/use-legend-interaction-highlighting.d.ts +2 -1
- package/map/hooks/use-legend-interaction-highlighting.js +31 -2
- package/map/hooks/use-legend-interaction-visibility.d.ts +2 -1
- package/map/hooks/use-legend-interaction-visibility.js +11 -2
- package/map/hooks/use-load-map-base-layer.d.ts +1 -1
- package/map/hooks/use-load-map-base-layer.js +4 -4
- package/map/hooks/use-map-mouse-move.js +2 -2
- package/map/hooks/use-resolve-color.d.ts +4 -2
- package/map/hooks/use-resolve-color.js +4 -0
- package/map/providers/imperative-handler.provider.js +2 -2
- package/map/providers/map-initial-view.provider.js +2 -2
- package/map/slots/BaseLayer.d.ts +4 -1
- package/map/slots/BubbleLayer.d.ts +1 -0
- package/map/slots/CategoricalLegend.d.ts +4 -1
- package/map/slots/ChartInteractions.d.ts +4 -1
- package/map/slots/ChartInteractions.js +3 -3
- package/map/slots/ChoroplethLayer.d.ts +1 -0
- package/map/slots/ConnectionLayer.d.ts +2 -1
- package/map/slots/DotLayer.d.ts +1 -0
- package/map/slots/SequentialLegend.d.ts +4 -1
- package/map/slots/ThresholdLegend.d.ts +4 -1
- package/map/slots/states/ErrorStateSlot.d.ts +6 -0
- package/map/types/base-layer.d.ts +4 -0
- package/map/types/bubble-layer.d.ts +4 -0
- package/map/types/choropleth-layer.d.ts +2 -0
- package/map/types/coloring.d.ts +16 -0
- package/map/types/connection-layer.d.ts +11 -7
- package/map/types/dot-layer.d.ts +2 -0
- package/map/types/legend.d.ts +18 -6
- package/map/types/location.d.ts +4 -1
- package/map/types/map-view.d.ts +10 -1
- package/map/types/shapes.d.ts +5 -1
- package/map/types/toolbar.d.ts +4 -1
- package/map/types/tooltip.d.ts +16 -1
- package/map/utils/attach-image-from-shape.d.ts +1 -1
- package/map/utils/attach-image-from-shape.js +3 -0
- package/map/utils/attach-image-from-string.d.ts +1 -1
- package/map/utils/attach-image-from-text.d.ts +1 -1
- package/map/utils/attach-image-to-map.d.ts +1 -1
- package/map/utils/attach-image-to-map.js +12 -5
- package/map/utils/build-scale-from-legend-config.js +5 -1
- package/map/utils/create-categorical-color-scheme-from-custom-color-object.d.ts +5 -0
- package/map/utils/create-categorical-color-scheme-from-custom-color-object.js +35 -0
- package/map/utils/extract-layers-data.d.ts +3 -2
- package/map/utils/extract-layers-data.js +50 -13
- package/map/utils/iterate-config-slots.d.ts +2 -1
- package/map/utils/iterate-config-slots.js +4 -2
- package/map/utils/set-layers-id.d.ts +1 -1
- package/map/utils/set-layers-id.js +12 -4
- package/map/utils/tooltip-type-guards.js +1 -1
- package/map/utils/use-set-map-initial-configuration.d.ts +1 -1
- package/package.json +8 -9
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-features.js +0 -12
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-features.js.map +0 -7
package/map/slots/DotLayer.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { Location } from '../types/location.js';
|
|
|
7
7
|
* for various shapes, optional features like custom background for icons, rotation,
|
|
8
8
|
* and tooltips, along with granular color customization and integration with
|
|
9
9
|
* legends for color configuration.
|
|
10
|
+
* @public
|
|
10
11
|
*/
|
|
11
12
|
export declare const DotLayer: {
|
|
12
13
|
<T extends Location>(_: PropsWithChildren<DotLayerProps<T>>): null;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { SequentialLegendProps } from '../types/legend.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The sequential legend slot component
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export declare const SequentialLegend: {
|
|
4
7
|
(props: SequentialLegendProps): null;
|
|
5
8
|
displayName: string;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { ThresholdLegendProps } from '../types/legend.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The sequential legend slot component
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export declare const ThresholdLegend: {
|
|
4
7
|
(props: ThresholdLegendProps): null;
|
|
5
8
|
displayName: string;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { ReactNode, JSX } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
2
5
|
export interface ErrorStateSlotProps {
|
|
3
6
|
children: ReactNode | ((errorMessage: string) => JSX.Element);
|
|
4
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
5
11
|
export declare const ErrorStateSlot: (props: ErrorStateSlotProps) => null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type to include or exclude countries to show
|
|
3
|
+
* @public
|
|
3
4
|
*/
|
|
4
5
|
export interface BaseLayerProps {
|
|
5
6
|
/** Include countries */
|
|
@@ -7,6 +8,9 @@ export interface BaseLayerProps {
|
|
|
7
8
|
/** Exclude countries */
|
|
8
9
|
exclude?: string[];
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
10
14
|
export interface BaseLayerRules {
|
|
11
15
|
exclude: string[];
|
|
12
16
|
include: string[];
|
|
@@ -3,6 +3,7 @@ import type { Location } from './location.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Base props to configure a BubbleLayer
|
|
5
5
|
* @typeParam T - Object extending Location
|
|
6
|
+
* @public
|
|
6
7
|
*/
|
|
7
8
|
export interface BubbleLayerBaseProps<T extends Location> {
|
|
8
9
|
/**
|
|
@@ -20,11 +21,13 @@ export interface BubbleLayerBaseProps<T extends Location> {
|
|
|
20
21
|
/**
|
|
21
22
|
* The BubbleLayer props
|
|
22
23
|
* @typeParam T - Object extending Location
|
|
24
|
+
* @public
|
|
23
25
|
*/
|
|
24
26
|
export type BubbleLayerProps<T extends Location> = BubbleLayerBaseProps<T> & (LocationColorProps<T> | LegendColorLayerProps) & (ScaleRadiusProps<T> | ScaleNoneProps<T>);
|
|
25
27
|
/**
|
|
26
28
|
* When there's no scale provided, the radius prop is used as radius size in pixels
|
|
27
29
|
* @typeParam T - Object extending Location
|
|
30
|
+
* @public
|
|
28
31
|
*/
|
|
29
32
|
export interface ScaleNoneProps<T> {
|
|
30
33
|
/**
|
|
@@ -41,6 +44,7 @@ export interface ScaleNoneProps<T> {
|
|
|
41
44
|
/**
|
|
42
45
|
* When a scale is provided, all the values in the dataset will be scaled to fit between the `radiusRange`.
|
|
43
46
|
* @typeParam T - Object extending Location
|
|
47
|
+
* @public
|
|
44
48
|
*/
|
|
45
49
|
export interface ScaleRadiusProps<T extends Location> {
|
|
46
50
|
/**
|
|
@@ -2,6 +2,7 @@ import type { ChoroplethCustomColorProps, LegendColorLayerProps } from './colori
|
|
|
2
2
|
/**
|
|
3
3
|
* Base props to configure a ChoroplethLayer
|
|
4
4
|
* @typeParam T - Object extending a record of string keys and any type of values
|
|
5
|
+
* @public
|
|
5
6
|
*/
|
|
6
7
|
export interface ChoroplethLayerBaseProps<T extends Record<string, unknown>> {
|
|
7
8
|
/**
|
|
@@ -17,6 +18,7 @@ export interface ChoroplethLayerBaseProps<T extends Record<string, unknown>> {
|
|
|
17
18
|
/**
|
|
18
19
|
* The ChoroplethLayer props
|
|
19
20
|
* @typeParam T - Object extending a record of string keys and any type of values
|
|
21
|
+
* @public
|
|
20
22
|
*/
|
|
21
23
|
export type ChoroplethLayerProps<T extends Record<string, unknown>> = ChoroplethLayerBaseProps<T> & (ChoroplethCustomColorProps<T> | LegendColorLayerProps);
|
|
22
24
|
/** @internal */
|
package/map/types/coloring.d.ts
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
|
+
import type { Connection } from './connection-layer.js';
|
|
1
2
|
import type { Location } from './location.js';
|
|
2
3
|
/**
|
|
3
4
|
* Props to configure any Layer with custom coloring
|
|
4
5
|
* @typeParam T - Object extending Location
|
|
6
|
+
* @public
|
|
5
7
|
*/
|
|
6
8
|
export interface LocationColorProps<T extends Location> {
|
|
7
9
|
/** Custom color to apply to the layer */
|
|
8
10
|
color?: string | ((item: T) => string);
|
|
9
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Props to configure a connection Layer with custom coloring
|
|
14
|
+
* @typeParam T - Object extending Connection
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export interface ConnectionColorProps<T extends Connection> {
|
|
18
|
+
/**
|
|
19
|
+
* Specifies the color of the connection layer.
|
|
20
|
+
* @defaultValue Colors.Charts.Categorical.Color03.Default
|
|
21
|
+
*/
|
|
22
|
+
color?: string | ((connection: T) => string);
|
|
23
|
+
}
|
|
10
24
|
/**
|
|
11
25
|
* Props to configure any Layer with legend coloring
|
|
26
|
+
* @public
|
|
12
27
|
*/
|
|
13
28
|
export interface LegendColorLayerProps {
|
|
14
29
|
/** When the color prop is set to 'legend', a value accessor is needed */
|
|
@@ -19,6 +34,7 @@ export interface LegendColorLayerProps {
|
|
|
19
34
|
/**
|
|
20
35
|
* Props to configure any Layer with custom coloring
|
|
21
36
|
* @typeParam T - Object extending a record of string keys and any type of values
|
|
37
|
+
* @public
|
|
22
38
|
*/
|
|
23
39
|
export interface ChoroplethCustomColorProps<T extends Record<string, unknown>> {
|
|
24
40
|
/** Color to apply to the layer */
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import type GeoJSON from 'geojson';
|
|
2
|
+
import type { ConnectionColorProps, LegendColorLayerProps } from './coloring.js';
|
|
2
3
|
import type { Location } from './location.js';
|
|
3
4
|
/**
|
|
4
5
|
* Data type for connections in the Connection Layer.
|
|
5
6
|
* @typeParam L - Object extending Location.
|
|
7
|
+
* @public
|
|
6
8
|
*/
|
|
7
9
|
export type Connection = {
|
|
8
10
|
/** Array of connections */
|
|
9
11
|
path: Location[];
|
|
10
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* The ConnectionLayer props
|
|
15
|
+
* @typeParam T - Object extending Connection
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export type ConnectionLayerProps<T extends Connection> = ConnectionLayerBaseProps<T> & (ConnectionColorProps<T> | LegendColorLayerProps);
|
|
11
19
|
/**
|
|
12
20
|
* Shape of the Connection Layer Component Props.
|
|
13
|
-
* @typeParam L - Object extending Location.
|
|
14
21
|
* @typeParam T - Object extending Connection<L>.
|
|
22
|
+
* @public
|
|
15
23
|
*/
|
|
16
|
-
export interface
|
|
24
|
+
export interface ConnectionLayerBaseProps<T extends Connection> {
|
|
17
25
|
/** Set of data related to the connections */
|
|
18
26
|
data: T[];
|
|
19
27
|
/**
|
|
@@ -30,11 +38,6 @@ export interface ConnectionLayerProps<T extends Connection> {
|
|
|
30
38
|
* @defaultValue 'linear'
|
|
31
39
|
*/
|
|
32
40
|
curve?: CurvedLine;
|
|
33
|
-
/**
|
|
34
|
-
* Specifies the color of the connection layer.
|
|
35
|
-
* @defaultValue Colors.Charts.Categorical.Color03.Default
|
|
36
|
-
*/
|
|
37
|
-
color?: string | ((connection: T) => string);
|
|
38
41
|
/**
|
|
39
42
|
* Specifies the thickness of the connection path.
|
|
40
43
|
* It can accept numbers from 1 to 64 (included).
|
|
@@ -60,5 +63,6 @@ export type GeoJSONFeature<T extends GeoJSON.Geometry> = GeoJSON.Feature<T, Feat
|
|
|
60
63
|
/**
|
|
61
64
|
* This property is responsible for setting the curve type
|
|
62
65
|
* @defaultValue linear
|
|
66
|
+
* @public
|
|
63
67
|
*/
|
|
64
68
|
export type CurvedLine = 'linear' | 'smooth';
|
package/map/types/dot-layer.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { MapShape } from './shapes.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Base props to configure a DotLayer.
|
|
7
7
|
* @typeParam T - Object extending Location
|
|
8
|
+
* @public
|
|
8
9
|
*/
|
|
9
10
|
export interface DotLayerBaseProps<T extends Location> {
|
|
10
11
|
/**
|
|
@@ -39,6 +40,7 @@ export interface DotLayerBaseProps<T extends Location> {
|
|
|
39
40
|
/**
|
|
40
41
|
* The DotLayer props
|
|
41
42
|
* @typeParam T - Object extending Location
|
|
43
|
+
* @public
|
|
42
44
|
*/
|
|
43
45
|
export type DotLayerProps<T extends Location> = DotLayerBaseProps<T> & (LocationColorProps<T> | LegendColorLayerProps);
|
|
44
46
|
/** @internal */
|
package/map/types/legend.d.ts
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import type { ColoredRange, ColorPalette, LegendProps } from '@dynatrace/strato-components-preview/charts';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The props common to all different legends
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export type BaseLegendProps = Omit<LegendProps, 'resizable'>;
|
|
4
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The sequential legend props
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
5
11
|
export interface SequentialLegendProps extends BaseLegendProps {
|
|
6
12
|
/** The min boundary */
|
|
7
|
-
min
|
|
13
|
+
min?: number;
|
|
8
14
|
/** The max boundary */
|
|
9
|
-
max
|
|
15
|
+
max?: number;
|
|
10
16
|
/** The color palette to apply to the legend */
|
|
11
17
|
colorPalette?: string[] | ColorPalette;
|
|
12
18
|
}
|
|
13
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* The categorical legend props
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
14
23
|
export interface CategoricalLegendProps extends BaseLegendProps {
|
|
15
24
|
/** Available categories to be shown in the legend */
|
|
16
25
|
categories?: string[];
|
|
@@ -19,7 +28,10 @@ export interface CategoricalLegendProps extends BaseLegendProps {
|
|
|
19
28
|
[key: string]: string;
|
|
20
29
|
};
|
|
21
30
|
}
|
|
22
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* The threshold legend props
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
23
35
|
export interface ThresholdLegendProps extends BaseLegendProps {
|
|
24
36
|
/** Ranges of the threshold legend */
|
|
25
37
|
ranges: ColoredRange[];
|
package/map/types/location.d.ts
CHANGED
package/map/types/map-view.d.ts
CHANGED
|
@@ -5,12 +5,14 @@ import { Formatter } from '@dynatrace/strato-components-preview/charts';
|
|
|
5
5
|
import { ConvertibleUnit, FormatOptions, Unit } from '@dynatrace-sdk/units';
|
|
6
6
|
/**
|
|
7
7
|
* Type to disallow al props in a given type
|
|
8
|
+
* @public
|
|
8
9
|
*/
|
|
9
10
|
export type DisallowAll<T> = {
|
|
10
11
|
[P in keyof T]?: never;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* Props to set the initial view state on the map.
|
|
15
|
+
* @public
|
|
14
16
|
*/
|
|
15
17
|
export interface ViewState {
|
|
16
18
|
/** Longitude at map center */
|
|
@@ -23,6 +25,7 @@ export interface ViewState {
|
|
|
23
25
|
/**
|
|
24
26
|
* Type to use in a controlled Map.
|
|
25
27
|
* It disallows the initial state and gives the user complete control over the interactions
|
|
28
|
+
* @public
|
|
26
29
|
*/
|
|
27
30
|
export interface MapViewControlledProps extends ViewState {
|
|
28
31
|
/**
|
|
@@ -33,6 +36,7 @@ export interface MapViewControlledProps extends ViewState {
|
|
|
33
36
|
/**
|
|
34
37
|
* Type to use in an uncontrolled Map.
|
|
35
38
|
* It allows only setting up an initial state and interactions come out of the box
|
|
39
|
+
* @public
|
|
36
40
|
*/
|
|
37
41
|
export interface MapViewUncontrolledProps extends DisallowAll<ViewState> {
|
|
38
42
|
/**
|
|
@@ -42,6 +46,7 @@ export interface MapViewUncontrolledProps extends DisallowAll<ViewState> {
|
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
44
48
|
* Props present in both ways of controlling a Map
|
|
49
|
+
* @public
|
|
45
50
|
*/
|
|
46
51
|
export interface MapViewBaseProps {
|
|
47
52
|
/**
|
|
@@ -82,9 +87,13 @@ export interface MapViewBaseProps {
|
|
|
82
87
|
}
|
|
83
88
|
/**
|
|
84
89
|
* Props to configure a Map
|
|
90
|
+
* @public
|
|
85
91
|
*/
|
|
86
92
|
export type MapViewProps = MapViewBaseProps & (MapViewControlledProps | MapViewUncontrolledProps);
|
|
87
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* The Map component ref
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
88
97
|
export interface MapViewRef {
|
|
89
98
|
/** The map component root element */
|
|
90
99
|
readonly element: HTMLDivElement | null;
|
package/map/types/shapes.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Available shapes to be used in the map.
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
2
5
|
export type MapShape = 'circle' | 'square' | 'diamond' | 'heart' | 'cross' | 'star' | 'triangle' | 'pin';
|
|
6
|
+
/** @internal */
|
|
3
7
|
export type SymbolType = 'shape' | 'icon' | 'emoji';
|
package/map/types/toolbar.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ToolbarPlacement, ZoomChangeHandler } from '@dynatrace/strato-components-preview/charts';
|
|
2
2
|
export type ToolbarInteractionModes = 'zoom' | 'zoom-to-fit' | 'zoom-in' | 'zoom-out' | 'reset' | 'download-data';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Props for the ChartInteractions component
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
4
7
|
export interface ChartInteractionsProps {
|
|
5
8
|
/** Callback called when any zoom event has been performed affecting the data timeframe */
|
|
6
9
|
onZoomChange?: ZoomChangeHandler;
|
package/map/types/tooltip.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export type LayerTooltipHandler = DotLayerTooltipHandler | BubbleLayerTooltipHan
|
|
|
12
12
|
/**
|
|
13
13
|
* Dot Tooltip data payload for the tooltip handler callback
|
|
14
14
|
* @typeParam T - Object extending Location
|
|
15
|
+
* @public
|
|
15
16
|
*/
|
|
16
17
|
export interface DotLayerTooltipData<T extends Location = Location> {
|
|
17
18
|
/** The hovered dot color */
|
|
@@ -23,11 +24,13 @@ export interface DotLayerTooltipData<T extends Location = Location> {
|
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Dot tooltip handler type
|
|
27
|
+
* @public
|
|
26
28
|
*/
|
|
27
29
|
export type DotLayerTooltipHandler = (dotData: DotLayerTooltipData) => React.ReactNode | null;
|
|
28
30
|
/**
|
|
29
31
|
* Dot tooltip handler type
|
|
30
32
|
* @typeParam T - Object extending Location
|
|
33
|
+
* @public
|
|
31
34
|
*/
|
|
32
35
|
export interface DotLayerTooltipHandlerProps {
|
|
33
36
|
/** The DotLayer tooltip handler template */
|
|
@@ -36,6 +39,7 @@ export interface DotLayerTooltipHandlerProps {
|
|
|
36
39
|
/**
|
|
37
40
|
* Bubble Tooltip data payload for the tooltip handler callback
|
|
38
41
|
* @typeParam T - Object extending Location
|
|
42
|
+
* @public
|
|
39
43
|
*/
|
|
40
44
|
export interface BubbleLayerTooltipData<T extends Location = Location> {
|
|
41
45
|
/** The hovered bubble color */
|
|
@@ -47,11 +51,13 @@ export interface BubbleLayerTooltipData<T extends Location = Location> {
|
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
49
53
|
* Bubble Tooltip Component Props
|
|
54
|
+
* @public
|
|
50
55
|
*/
|
|
51
56
|
export type BubbleLayerTooltipHandler = (closestDot: BubbleLayerTooltipData, dotsData: BubbleLayerTooltipData[]) => React.ReactNode | null;
|
|
52
57
|
/**
|
|
53
58
|
* Bubble Tooltip Component Props
|
|
54
59
|
* @typeParam T - Object extending Location
|
|
60
|
+
* @public
|
|
55
61
|
*/
|
|
56
62
|
export interface BubbleLayerTooltipHandlerProps {
|
|
57
63
|
/** The BubbleLayer tooltip handler template */
|
|
@@ -60,6 +66,7 @@ export interface BubbleLayerTooltipHandlerProps {
|
|
|
60
66
|
/**
|
|
61
67
|
* Connection Tooltip data payload for the tooltip handler callback
|
|
62
68
|
* @typeParam T - Object extending Connection
|
|
69
|
+
* @public
|
|
63
70
|
*/
|
|
64
71
|
export interface ConnectionLayerTooltipData<T extends Connection = Connection> {
|
|
65
72
|
/** The hovered connection color */
|
|
@@ -71,10 +78,12 @@ export interface ConnectionLayerTooltipData<T extends Connection = Connection> {
|
|
|
71
78
|
}
|
|
72
79
|
/**
|
|
73
80
|
* Connection tooltip handler type
|
|
81
|
+
* @public
|
|
74
82
|
*/
|
|
75
83
|
export type ConnectionLayerTooltipHandler = (connectionData: ConnectionLayerTooltipData) => React.ReactNode;
|
|
76
84
|
/**
|
|
77
85
|
* Connection Tooltip Component Props
|
|
86
|
+
* @public
|
|
78
87
|
*/
|
|
79
88
|
export interface ConnectionLayerTooltipHandlerProps {
|
|
80
89
|
/** The ConnectionLayer tooltip handler template */
|
|
@@ -83,6 +92,7 @@ export interface ConnectionLayerTooltipHandlerProps {
|
|
|
83
92
|
/**
|
|
84
93
|
* Choropleth Tooltip data payload for the tooltip handler callback
|
|
85
94
|
* @typeParam T - Object extending a record of string keys and any type of values
|
|
95
|
+
* @public
|
|
86
96
|
*/
|
|
87
97
|
export interface ChoroplethLayerTooltipData<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
88
98
|
/** The hovered region color */
|
|
@@ -94,14 +104,19 @@ export interface ChoroplethLayerTooltipData<T extends Record<string, unknown> =
|
|
|
94
104
|
}
|
|
95
105
|
/**
|
|
96
106
|
* Choropleth tooltip handler type
|
|
107
|
+
* @public
|
|
97
108
|
*/
|
|
98
109
|
export type ChoroplethLayerTooltipHandler = (regionData: ChoroplethLayerTooltipData) => React.ReactNode;
|
|
99
110
|
/**
|
|
100
111
|
* Choropleth Tooltip Component Props
|
|
112
|
+
* @public
|
|
101
113
|
*/
|
|
102
114
|
export interface ChoroplethLayerTooltipHandlerProps {
|
|
103
115
|
/** The ChoroplethLayer tooltip handler template */
|
|
104
116
|
children?: ChoroplethLayerTooltipHandler | null;
|
|
105
117
|
}
|
|
106
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* Map Geo Tooltip Props
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
107
122
|
export type ChartTooltip = ChartTooltipSlotsType & ChartTooltipTemplateType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { MapRef } from 'react-
|
|
1
|
+
import type { MapRef } from '@vis.gl/react-maplibre';
|
|
2
2
|
import type { MapShape } from '../types/shapes.js';
|
|
3
3
|
export declare const attachImageFromShape: (map: MapRef, shape: MapShape, name: string, outputSize?: number) => void;
|
|
@@ -38,6 +38,9 @@ const attachImageFromShape = (map, shape, name, outputSize) => {
|
|
|
38
38
|
import_constants.DEFAULT_INPUT_ICON_SIZE,
|
|
39
39
|
(0, import_create_bitmap_config_options.createBitmapConfigOptions)(outputSize)
|
|
40
40
|
).then((bitmap) => {
|
|
41
|
+
if (!map) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
41
44
|
(0, import_attach_image_to_map.attachImageToMap)(map, bitmap, name);
|
|
42
45
|
});
|
|
43
46
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { MapRef } from 'react-
|
|
1
|
+
import type { MapRef } from '@vis.gl/react-maplibre';
|
|
2
2
|
import type { MapShape } from '../types/shapes.js';
|
|
3
3
|
export declare const attachImageFromString: (map: MapRef, shape: MapShape | string, suffix?: string, outputSize?: number) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { MapRef } from 'react-
|
|
1
|
+
import type { MapRef } from '@vis.gl/react-maplibre';
|
|
2
2
|
export declare const attachImageFromText: (map: MapRef, text: string, name: string, outputSize?: number) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { MapRef } from 'react-
|
|
1
|
+
import type { MapRef } from '@vis.gl/react-maplibre';
|
|
2
2
|
export declare const attachImageToMap: (map: MapRef, bitmap: ImageBitmap | HTMLImageElement, iconName: string, sdf?: boolean) => void;
|
|
@@ -22,10 +22,17 @@ __export(attach_image_to_map_exports, {
|
|
|
22
22
|
module.exports = __toCommonJS(attach_image_to_map_exports);
|
|
23
23
|
const attachImageToMap = (map, bitmap, iconName, sdf = true) => {
|
|
24
24
|
const pixelRatio = devicePixelRatio;
|
|
25
|
-
|
|
26
|
-
map.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
try {
|
|
26
|
+
if (!map.hasImage(iconName)) {
|
|
27
|
+
map.addImage(iconName, bitmap, { sdf, pixelRatio });
|
|
28
|
+
} else {
|
|
29
|
+
map.removeImage(iconName);
|
|
30
|
+
map.addImage(iconName, bitmap, { sdf, pixelRatio });
|
|
31
|
+
}
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (error instanceof Error) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
throw error;
|
|
30
37
|
}
|
|
31
38
|
};
|
|
@@ -26,6 +26,7 @@ module.exports = __toCommonJS(build_scale_from_legend_config_exports);
|
|
|
26
26
|
var import_charts = require("@dynatrace/strato-components-preview/charts");
|
|
27
27
|
var import_build_categorical_scale = require("./build-categorical-scale.js");
|
|
28
28
|
var import_constants = require("../constants.js");
|
|
29
|
+
var import_create_categorical_color_scheme_from_custom_color_object = require("./create-categorical-color-scheme-from-custom-color-object.js");
|
|
29
30
|
var import_create_categorical_color_scheme_from_legend_props = require("./create-categorical-color-scheme-from-legend-props.js");
|
|
30
31
|
const isThresholdLegend = (legendConfig) => legendConfig.type === "threshold";
|
|
31
32
|
const isSequentialLegend = (legendConfig) => legendConfig.type === "sequential";
|
|
@@ -43,7 +44,10 @@ const buildScaleFromLegendConfig = (mapLegendConfig, categories) => {
|
|
|
43
44
|
mapLegendConfig.colorPalette
|
|
44
45
|
);
|
|
45
46
|
const isCustomColorObject = !(isDefaultColorPalette || isArrayOfColors);
|
|
46
|
-
const colorPaletteObject = isCustomColorObject ?
|
|
47
|
+
const colorPaletteObject = isCustomColorObject ? (0, import_create_categorical_color_scheme_from_custom_color_object.createCategoricalColorSchemeFromCustomColorObject)(
|
|
48
|
+
mapLegendConfig.colorPalette,
|
|
49
|
+
categories ?? []
|
|
50
|
+
) : (0, import_create_categorical_color_scheme_from_legend_props.createCategoricalColorSchemeFromLegendProps)(
|
|
47
51
|
mapLegendConfig.colorPalette,
|
|
48
52
|
categories ?? []
|
|
49
53
|
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var create_categorical_color_scheme_from_custom_color_object_exports = {};
|
|
19
|
+
__export(create_categorical_color_scheme_from_custom_color_object_exports, {
|
|
20
|
+
createCategoricalColorSchemeFromCustomColorObject: () => createCategoricalColorSchemeFromCustomColorObject
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(create_categorical_color_scheme_from_custom_color_object_exports);
|
|
23
|
+
var import_constants = require("../constants.js");
|
|
24
|
+
const createCategoricalColorSchemeFromCustomColorObject = (colorPalette, categories) => {
|
|
25
|
+
let obj = { ...colorPalette };
|
|
26
|
+
categories.forEach((categoryName, index) => {
|
|
27
|
+
if (!obj[categoryName]) {
|
|
28
|
+
obj = {
|
|
29
|
+
...obj,
|
|
30
|
+
[categoryName]: import_constants.DEFAULT_BASIC_SHAPE_COLOR_TOKEN.Default
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return obj;
|
|
35
|
+
};
|
|
@@ -2,10 +2,11 @@ import React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Extract layers data
|
|
4
4
|
* @param children - MapView children
|
|
5
|
-
* @param
|
|
5
|
+
* @param valueAccessors - MapView Layer valueAccessor
|
|
6
6
|
* @returns flattened data array
|
|
7
7
|
*/
|
|
8
|
-
export declare const extractLayersData: (children: React.ReactNode,
|
|
8
|
+
export declare const extractLayersData: (children: React.ReactNode, valueAccessors: Map<string, string>) => {
|
|
9
9
|
flattenData: Record<string, unknown>[];
|
|
10
10
|
categories: string[];
|
|
11
|
+
legendDomain: [number, number];
|
|
11
12
|
};
|
|
@@ -42,9 +42,20 @@ const addCategory = (extendedDataPoint, valueAccessor) => {
|
|
|
42
42
|
return extendedDataPoint[valueAccessor];
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
-
const
|
|
45
|
+
const updateDomain = (domain, value) => {
|
|
46
|
+
const [min, max] = domain;
|
|
47
|
+
if (value < min) {
|
|
48
|
+
return [value, max];
|
|
49
|
+
}
|
|
50
|
+
if (value > max) {
|
|
51
|
+
return [min, value];
|
|
52
|
+
}
|
|
53
|
+
return domain;
|
|
54
|
+
};
|
|
55
|
+
const extractLayersData = (children, valueAccessors) => {
|
|
46
56
|
let flattenData = [];
|
|
47
57
|
const categoriesSet = /* @__PURE__ */ new Set();
|
|
58
|
+
let legendDomain = [Infinity, -Infinity];
|
|
48
59
|
import_react.default.Children.forEach(children, (child) => {
|
|
49
60
|
if ((0, import_is_component.isComponent)(child, import_BubbleLayer.BubbleLayer) || (0, import_is_component.isComponent)(child, import_DotLayer.DotLayer)) {
|
|
50
61
|
const { data } = child.props;
|
|
@@ -53,22 +64,38 @@ const extractLayersData = (children, valueAccessor) => {
|
|
|
53
64
|
...dataPoint,
|
|
54
65
|
"layer-name": child.props.layerId
|
|
55
66
|
};
|
|
56
|
-
const category = addCategory(
|
|
67
|
+
const category = addCategory(
|
|
68
|
+
extendedDataPoint,
|
|
69
|
+
valueAccessors.get(child.props.layerId)
|
|
70
|
+
);
|
|
57
71
|
category && categoriesSet.add(category);
|
|
72
|
+
if (typeof category === "number") {
|
|
73
|
+
legendDomain = updateDomain(legendDomain, category);
|
|
74
|
+
}
|
|
58
75
|
flattenData = flattenData.concat(extendedDataPoint);
|
|
59
76
|
});
|
|
60
77
|
} else if ((0, import_is_component.isComponent)(child, import_ConnectionLayer.ConnectionLayer)) {
|
|
61
78
|
const { data } = child.props;
|
|
62
79
|
data.forEach((connection, connectionIndex) => {
|
|
63
|
-
connection.path.
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
80
|
+
if (connection.path.length >= 2) {
|
|
81
|
+
const category = addCategory(
|
|
82
|
+
connection,
|
|
83
|
+
valueAccessors.get(child.props.layerId)
|
|
84
|
+
);
|
|
85
|
+
category && categoriesSet.add(category);
|
|
86
|
+
if (typeof category === "number") {
|
|
87
|
+
legendDomain = updateDomain(legendDomain, category);
|
|
88
|
+
}
|
|
89
|
+
connection.path.forEach((path, pathIndex) => {
|
|
90
|
+
const parsedPath = {
|
|
91
|
+
...path,
|
|
92
|
+
"connection-name": `connection-${connectionIndex + 1}`,
|
|
93
|
+
"connection-item-index": pathIndex,
|
|
94
|
+
"layer-name": child.props.layerId
|
|
95
|
+
};
|
|
96
|
+
flattenData.push(parsedPath);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
72
99
|
});
|
|
73
100
|
} else if ((0, import_is_component.isComponent)(child, import_ChoroplethLayer.ChoroplethLayer)) {
|
|
74
101
|
const { data, regionAccessor } = child.props;
|
|
@@ -79,11 +106,21 @@ const extractLayersData = (children, valueAccessor) => {
|
|
|
79
106
|
region,
|
|
80
107
|
"layer-name": child.props.layerId
|
|
81
108
|
};
|
|
82
|
-
const category = addCategory(
|
|
109
|
+
const category = addCategory(
|
|
110
|
+
choroplethLayerData,
|
|
111
|
+
valueAccessors.get(child.props.layerId)
|
|
112
|
+
);
|
|
83
113
|
category && categoriesSet.add(category);
|
|
114
|
+
if (typeof category === "number") {
|
|
115
|
+
legendDomain = updateDomain(legendDomain, category);
|
|
116
|
+
}
|
|
84
117
|
flattenData.push(choroplethLayerData);
|
|
85
118
|
});
|
|
86
119
|
}
|
|
87
120
|
});
|
|
88
|
-
return {
|
|
121
|
+
return {
|
|
122
|
+
flattenData,
|
|
123
|
+
categories: [...categoriesSet],
|
|
124
|
+
legendDomain
|
|
125
|
+
};
|
|
89
126
|
};
|