@dynatrace/strato-geo 0.8.13 → 0.9.17
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/map/MapView.js +15 -13
- package/esm/map/MapView.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js.map +1 -1
- package/esm/map/components/BubbleLayer/functions/add-outline-size.js.map +1 -1
- package/esm/map/components/BubbleLayer/functions/build-radius-scale.js +4 -1
- package/esm/map/components/BubbleLayer/functions/build-radius-scale.js.map +2 -2
- package/esm/map/components/BubbleLayer/functions/build-stick-to-distance-expressions.js.map +1 -1
- package/esm/map/components/BubbleLayer/functions/define-radius.js.map +1 -1
- package/esm/map/components/BubbleLayer/functions/parse-bubble-data-to-geo-json.js.map +1 -1
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js.map +1 -1
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js.map +1 -1
- package/esm/map/components/ConnectionLayer/ConnectionLayerDirection.js.map +1 -1
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js.map +1 -1
- package/esm/map/components/ConnectionLayer/functions/get-arc-line-features.js.map +1 -1
- package/esm/map/components/ConnectionLayer/functions/get-straight-line-features.js.map +1 -1
- package/esm/map/components/ConnectionLayer/functions/parse-connection-data-to-geo-json.js.map +1 -1
- package/esm/map/components/ConnectionLayer/functions/parse-direction-data-to-geo-json.js.map +1 -1
- package/esm/map/components/DefaultTooltip/DefaultTooltip.js.map +1 -1
- package/esm/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.js.map +1 -1
- package/esm/map/components/DotLayer/DotLayer.js +1 -1
- package/esm/map/components/DotLayer/DotLayer.js.map +2 -2
- package/esm/map/components/DotLayer/DotLayerTooltip.js.map +1 -1
- package/esm/map/components/DotLayer/functions/define-bearing.js.map +1 -1
- package/esm/map/components/DotLayer/functions/parse-dot-data-to-geo-json.js.map +1 -1
- package/esm/map/components/MapContent.js.map +2 -2
- package/esm/map/components/legend/CategoricalLegendRenderer.js.map +2 -2
- package/esm/map/components/legend/SequentialLegendRenderer.js.map +1 -1
- package/esm/map/components/legend/ThresholdLegendRenderer.js.map +1 -1
- package/esm/map/components/legend/functions/resolve-color.js.map +1 -1
- package/esm/map/components/toolbar/constants.js.map +1 -1
- package/esm/map/components/toolbar/functions/a11y-toolbar-controls.js.map +1 -1
- package/esm/map/components/toolbar/hooks/use-a11y-toolbar-tab-index.js.map +1 -1
- package/esm/map/constants.js +4 -2
- package/esm/map/constants.js.map +2 -2
- package/esm/map/contexts/a11y-toolbar-tab-index.context.js.map +1 -1
- package/esm/map/contexts/color-scale.context.js.map +1 -1
- package/esm/map/contexts/map-configuration.context.js.map +1 -1
- package/esm/map/contexts/map-initial-view.context.js.map +1 -1
- package/esm/map/functions/__test__/fixtures/business-locations.js.map +1 -1
- package/esm/map/functions/__test__/fixtures/events-locations.js.map +1 -1
- package/esm/map/functions/__test__/fixtures/facilities-locations.js.map +1 -1
- package/esm/map/functions/__test__/fixtures/flight-connections.js.map +1 -1
- package/esm/map/functions/attach-image-from-shape.js.map +1 -1
- package/esm/map/functions/attach-image-from-string.js.map +1 -1
- package/esm/map/functions/attach-image-from-text.js.map +1 -1
- package/esm/map/functions/attach-image-to-map.js.map +1 -1
- package/esm/map/functions/build-categorical-scale.js.map +1 -1
- package/esm/map/functions/extract-layers-data.js.map +1 -1
- package/esm/map/functions/get-client-settings.js.map +1 -1
- package/esm/map/functions/get-data-layers-bounding-box.js.map +1 -1
- package/esm/map/functions/is-valid-shape.js.map +1 -1
- package/esm/map/functions/iterate-config-slots.js +10 -1
- package/esm/map/functions/iterate-config-slots.js.map +2 -2
- package/esm/map/functions/parse-tooltip-data.js.map +1 -1
- package/esm/map/functions/set-layers-id.js +1 -0
- package/esm/map/functions/set-layers-id.js.map +2 -2
- package/esm/map/functions/tooltip-type-guards.js.map +1 -1
- package/esm/map/hooks/use-active-interaction.js.map +1 -1
- package/esm/map/hooks/use-attach-image-from-icon.js.map +2 -2
- package/esm/map/hooks/use-attach-symbol-to-map.js.map +1 -1
- package/esm/map/hooks/use-color-scale.js.map +1 -1
- package/esm/map/hooks/use-hover-interaction.js.map +2 -2
- package/esm/map/hooks/use-initial-view-state.js.map +1 -1
- package/esm/map/hooks/use-legend-interaction-highlighting.js.map +1 -1
- package/esm/map/hooks/use-legend-interaction-visibility.js.map +1 -1
- package/esm/map/hooks/use-load-symbol-into-map.js.map +1 -1
- package/esm/map/hooks/use-map-performance.js +0 -15
- package/esm/map/hooks/use-map-performance.js.map +2 -2
- package/esm/map/hooks/use-overlay-events.js.map +1 -1
- package/esm/map/hooks/use-tooltip-template.js.map +2 -2
- package/esm/map/providers/color-scale.provider.js.map +2 -2
- package/esm/map/providers/layer-color-strategy.provider.js.map +2 -2
- package/esm/map/providers/map-initial-view.provider.js.map +2 -2
- package/esm/map/shapes/shape-picker.js.map +1 -1
- package/esm/map/slots/BubbleLayer.js.map +1 -1
- package/esm/map/slots/BubbleLayerTooltip.js.map +1 -1
- package/esm/map/slots/CategoricalLegend.js.map +1 -1
- package/esm/map/slots/ChartInteractions.js.map +1 -1
- package/esm/map/slots/ChoroplethLayer.js.map +1 -1
- package/esm/map/slots/ChoroplethLayerTooltip.js.map +1 -1
- package/esm/map/slots/ConnectionLayer.js.map +1 -1
- package/esm/map/slots/ConnectionLayerTooltip.js.map +1 -1
- package/esm/map/slots/DotLayer.js.map +1 -1
- package/esm/map/slots/DotLayerTooltip.js.map +1 -1
- package/esm/map/slots/SequentialLegend.js.map +1 -1
- package/esm/map/slots/ThresholdLegend.js.map +1 -1
- package/esm/map/slots/Tooltip.js.map +2 -2
- package/esm/map/slots/states/DisabledState.js.map +2 -2
- package/esm/map/slots/states/ErrorStateSlot.js.map +1 -1
- package/esm/map/store/map-store.context.js +3 -1
- package/esm/map/store/map-store.context.js.map +2 -2
- package/esm/map/store/map-store.provider.js +3 -1
- package/esm/map/store/map-store.provider.js.map +2 -2
- package/esm/map/store/selectors.js.map +1 -1
- package/esm/map/store/store.js.map +1 -1
- package/esm/map/types/bubble-layer.js.map +1 -1
- package/esm/map/types/coloring.js.map +1 -1
- package/map/MapView.d.ts +1 -1
- package/map/MapView.js +14 -8
- package/map/components/BubbleLayer/BubbleLayer.d.ts +3 -3
- package/map/components/BubbleLayer/BubbleLayerTooltip.d.ts +1 -1
- package/map/components/BubbleLayer/functions/add-outline-size.d.ts +1 -1
- package/map/components/BubbleLayer/functions/build-radius-scale.d.ts +2 -2
- package/map/components/BubbleLayer/functions/build-stick-to-distance-expressions.d.ts +1 -1
- package/map/components/BubbleLayer/functions/define-radius.d.ts +1 -1
- package/map/components/BubbleLayer/functions/parse-bubble-data-to-geo-json.d.ts +2 -2
- package/map/components/ChoroplethLayer/ChoroplethLayer.d.ts +2 -2
- package/map/components/ChoroplethLayer/ChoroplethLayerTooltip.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayer.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerDirection.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.d.ts +1 -1
- package/map/components/ConnectionLayer/functions/get-arc-line-features.d.ts +2 -2
- package/map/components/ConnectionLayer/functions/get-straight-line-features.d.ts +2 -2
- package/map/components/ConnectionLayer/functions/parse-connection-data-to-geo-json.d.ts +1 -1
- package/map/components/ConnectionLayer/functions/parse-direction-data-to-geo-json.d.ts +1 -1
- package/map/components/DefaultTooltip/DefaultTooltip.d.ts +1 -1
- package/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.d.ts +1 -1
- package/map/components/DotLayer/DotLayer.d.ts +3 -3
- package/map/components/DotLayer/DotLayer.js +1 -1
- package/map/components/DotLayer/DotLayerTooltip.d.ts +1 -1
- package/map/components/DotLayer/functions/define-bearing.d.ts +1 -1
- package/map/components/DotLayer/functions/parse-dot-data-to-geo-json.d.ts +1 -1
- package/map/components/MapContent.d.ts +1 -1
- package/map/components/legend/functions/resolve-color.d.ts +1 -1
- package/map/components/toolbar/constants.d.ts +1 -1
- package/map/components/toolbar/functions/a11y-toolbar-controls.d.ts +1 -1
- package/map/components/toolbar/hooks/use-a11y-toolbar-tab-index.d.ts +1 -1
- package/map/constants.d.ts +3 -2
- package/map/constants.js +4 -2
- package/map/contexts/a11y-toolbar-tab-index.context.d.ts +1 -1
- package/map/contexts/color-scale.context.d.ts +1 -1
- package/map/contexts/map-configuration.context.d.ts +1 -1
- package/map/contexts/map-initial-view.context.d.ts +1 -1
- package/map/functions/__test__/fixtures/business-locations.d.ts +1 -1
- package/map/functions/__test__/fixtures/events-locations.d.ts +1 -1
- package/map/functions/__test__/fixtures/facilities-locations.d.ts +1 -1
- package/map/functions/__test__/fixtures/flight-connections.d.ts +1 -1
- package/map/functions/attach-image-from-shape.d.ts +2 -2
- package/map/functions/attach-image-from-string.d.ts +2 -2
- package/map/functions/attach-image-from-text.d.ts +1 -1
- package/map/functions/attach-image-to-map.d.ts +1 -1
- package/map/functions/build-categorical-scale.d.ts +1 -1
- package/map/functions/is-valid-shape.d.ts +2 -2
- package/map/functions/iterate-config-slots.d.ts +1 -1
- package/map/functions/iterate-config-slots.js +5 -0
- package/map/functions/parse-tooltip-data.d.ts +1 -1
- package/map/functions/set-layers-id.js +1 -0
- package/map/functions/tooltip-type-guards.d.ts +1 -1
- package/map/hooks/use-attach-image-from-icon.d.ts +2 -2
- package/map/hooks/use-attach-symbol-to-map.d.ts +2 -2
- package/map/hooks/use-color-scale.d.ts +1 -1
- package/map/hooks/use-initial-view-state.d.ts +1 -1
- package/map/hooks/use-legend-interaction-highlighting.d.ts +4 -4
- package/map/hooks/use-legend-interaction-visibility.d.ts +4 -4
- package/map/hooks/use-load-symbol-into-map.d.ts +2 -2
- package/map/hooks/use-map-performance.d.ts +0 -15
- package/map/hooks/use-map-performance.js +0 -15
- package/map/hooks/use-overlay-events.d.ts +1 -1
- package/map/hooks/use-tooltip-template.d.ts +2 -2
- package/map/providers/color-scale.provider.d.ts +1 -1
- package/map/providers/layer-color-strategy.provider.d.ts +3 -3
- package/map/providers/map-initial-view.provider.d.ts +2 -2
- package/map/shapes/shape-picker.d.ts +1 -1
- package/map/slots/BubbleLayer.d.ts +5 -5
- package/map/slots/BubbleLayerTooltip.d.ts +1 -1
- package/map/slots/CategoricalLegend.d.ts +1 -1
- package/map/slots/ChartInteractions.d.ts +2 -2
- package/map/slots/ChoroplethLayer.d.ts +3 -3
- package/map/slots/ChoroplethLayerTooltip.d.ts +1 -1
- package/map/slots/ConnectionLayer.d.ts +3 -3
- package/map/slots/ConnectionLayerTooltip.d.ts +1 -1
- package/map/slots/DotLayer.d.ts +5 -5
- package/map/slots/DotLayerTooltip.d.ts +1 -1
- package/map/slots/SequentialLegend.d.ts +1 -1
- package/map/slots/ThresholdLegend.d.ts +1 -1
- package/map/slots/Tooltip.d.ts +1 -1
- package/map/slots/states/ErrorStateSlot.d.ts +2 -2
- package/map/store/map-store.context.d.ts +2 -2
- package/map/store/map-store.provider.d.ts +1 -1
- package/map/store/selectors.d.ts +1 -1
- package/map/store/store.d.ts +1 -1
- package/map/types/bubble-layer.d.ts +2 -2
- package/map/types/choropleth-layer.d.ts +1 -1
- package/map/types/coloring.d.ts +1 -1
- package/map/types/configuration.d.ts +2 -2
- package/map/types/connection-layer.d.ts +1 -1
- package/map/types/dot-layer.d.ts +5 -5
- package/map/types/legend.d.ts +3 -25
- package/map/types/map-view.d.ts +3 -3
- package/map/types/state.d.ts +1 -1
- package/map/types/toolbar.d.ts +1 -1
- package/map/types/tooltip.d.ts +2 -2
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/functions/iterate-config-slots.ts"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { isElement } from 'react-is';\n\nimport { ChartToolbar } from '@dynatrace/strato-components-preview/charts';\n\nimport {
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAE1B,SAAS,oBAAoB;AAE7B,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { isElement } from 'react-is';\n\nimport { ChartToolbar } from '@dynatrace/strato-components-preview/charts';\n\nimport {\n DEFAULT_MAP_LEGEND_RATIO,\n DEFAULT_MAP_POSITION,\n DEFAULT_SEQUENTIAL_LEGEND_COLOR_PALETTE,\n} from '../constants.js';\nimport { CategoricalLegend } from '../slots/CategoricalLegend.js';\nimport { ChartInteractions } from '../slots/ChartInteractions.js';\nimport { SequentialLegend } from '../slots/SequentialLegend.js';\nimport { ThresholdLegend } from '../slots/ThresholdLegend.js';\nimport type { MapConfig } from '../types/configuration.js';\nimport type { ChartInteractionsConfig } from '../types/toolbar.js';\n\n/**\n * Generate map config based on slots\n * @param children - Map children\n * @returns Map slot config\n */\nexport const iterateConfigSlots = (children: React.ReactNode) => {\n let slots: MapConfig = {\n toolbar: undefined,\n interactions: undefined,\n legend: undefined,\n };\n\n React.Children.forEach(children, (child) => {\n if (isElement(child)) {\n switch (child.type) {\n case ChartInteractions: {\n const { children, ...previousInteractions } = child.props;\n\n const interactions = iterateChartInteractionsSlots(children);\n\n slots = {\n ...slots,\n interactions: {\n ...previousInteractions,\n ...interactions,\n },\n };\n break;\n }\n\n case ChartToolbar: {\n const { children, ...toolbar } = child.props;\n const childrenToolbar = iterateChartToolbarSlots(children);\n\n slots = {\n ...slots,\n toolbar: {\n ...toolbar,\n ...childrenToolbar,\n },\n };\n break;\n }\n\n case SequentialLegend: {\n const { children, ...legend } = child.props;\n\n slots = {\n ...slots,\n legend: {\n type: 'sequential',\n colorPalette: DEFAULT_SEQUENTIAL_LEGEND_COLOR_PALETTE,\n position: DEFAULT_MAP_POSITION,\n ratio: DEFAULT_MAP_LEGEND_RATIO,\n ...legend,\n },\n };\n break;\n }\n\n case CategoricalLegend: {\n const { children, ...legend } = child.props;\n\n slots = {\n ...slots,\n legend: {\n type: 'categorical',\n position: DEFAULT_MAP_POSITION,\n ...legend,\n },\n };\n break;\n }\n\n case ThresholdLegend: {\n const { children, ...legend } = child.props;\n\n slots = {\n ...slots,\n legend: {\n type: 'threshold',\n position: DEFAULT_MAP_POSITION,\n ratio: DEFAULT_MAP_LEGEND_RATIO,\n ...legend,\n },\n };\n break;\n }\n }\n }\n });\n\n return slots;\n};\n\nconst iterateChartInteractionsSlots = (children: React.ReactElement[]) => {\n let interactions: ChartInteractionsConfig = {};\n\n React.Children.forEach(children, (childInteractions) => {\n if (isElement(childInteractions)) {\n switch (childInteractions.type) {\n case ChartInteractions.Zoom:\n interactions = { ...interactions, zoom: { enabled: true } };\n break;\n case ChartInteractions.ZoomToFit:\n interactions = { ...interactions, zoomToFit: { enabled: true } };\n break;\n }\n }\n });\n\n return interactions;\n};\n\n/**\n * Generates chart config based on slots\n * @param children - CharInteraction children\n * @returns ChartInteraction slot config\n */\nconst iterateChartToolbarSlots = (children: React.ReactElement[]) => {\n let toolbar = {};\n\n React.Children.forEach(children, (childToolbar) => {\n if (\n isElement(childToolbar) &&\n childToolbar.type === ChartToolbar.DownloadData\n ) {\n toolbar = {\n ...toolbar,\n downloadData: { enabled: true },\n };\n }\n });\n\n return toolbar;\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["children"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/functions/parse-tooltip-data.ts"],
|
|
4
|
-
"sourcesContent": ["import type GeoJSON from 'geojson';\nimport { MapGeoJSONFeature } from 'maplibre-gl';\n\n/**\n * Tries to deserialize an object, if serialized\n * @param serializedObject - string\n */\nconst deserializeObject = (\n serializedObject: string,\n): string | Record<string, unknown> => {\n try {\n return JSON.parse(serializedObject);\n } catch {\n return serializedObject;\n }\n};\n\n/**\n * Deserializes map feature properties that are serialized\n *\n * @param featureProperties - map feature properties\n */\nconst parseFeatureProperties = (featureProperties: Record<string, unknown>) => {\n const properties = {};\n\n for (const [key, value] of Object.entries(featureProperties)) {\n if (typeof value === 'string') {\n properties[key] = deserializeObject(value);\n } else {\n properties[key] = value;\n }\n }\n\n return properties;\n};\n\n/**\n * Extracts useful map features data for the tooltip\n * @param features - map features\n */\nexport const parseTooltipData = (features: MapGeoJSONFeature[]) => {\n const data: unknown[] = [];\n\n for (const feature of features) {\n const properties = parseFeatureProperties(feature.properties);\n const [latitude, longitude] = (feature.geometry as GeoJSON.Point)\n .coordinates;\n\n data.push({\n ...properties,\n latitude,\n longitude,\n });\n }\n\n return data;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import type GeoJSON from 'geojson';\nimport type { MapGeoJSONFeature } from 'maplibre-gl';\n\n/**\n * Tries to deserialize an object, if serialized\n * @param serializedObject - string\n */\nconst deserializeObject = (\n serializedObject: string,\n): string | Record<string, unknown> => {\n try {\n return JSON.parse(serializedObject);\n } catch {\n return serializedObject;\n }\n};\n\n/**\n * Deserializes map feature properties that are serialized\n *\n * @param featureProperties - map feature properties\n */\nconst parseFeatureProperties = (featureProperties: Record<string, unknown>) => {\n const properties = {};\n\n for (const [key, value] of Object.entries(featureProperties)) {\n if (typeof value === 'string') {\n properties[key] = deserializeObject(value);\n } else {\n properties[key] = value;\n }\n }\n\n return properties;\n};\n\n/**\n * Extracts useful map features data for the tooltip\n * @param features - map features\n */\nexport const parseTooltipData = (features: MapGeoJSONFeature[]) => {\n const data: unknown[] = [];\n\n for (const feature of features) {\n const properties = parseFeatureProperties(feature.properties);\n const [latitude, longitude] = (feature.geometry as GeoJSON.Point)\n .coordinates;\n\n data.push({\n ...properties,\n latitude,\n longitude,\n });\n }\n\n return data;\n};\n"],
|
|
5
5
|
"mappings": "AAOA,MAAM,oBAAoB,CACxB,qBACqC;AACrC,MAAI;AACF,WAAO,KAAK,MAAM,gBAAgB;AAAA,EACpC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAOA,MAAM,yBAAyB,CAAC,sBAA+C;AAC7E,QAAM,aAAa,CAAC;AAEpB,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,iBAAiB,GAAG;AAC5D,QAAI,OAAO,UAAU,UAAU;AAC7B,iBAAW,GAAG,IAAI,kBAAkB,KAAK;AAAA,IAC3C,OAAO;AACL,iBAAW,GAAG,IAAI;AAAA,IACpB;AAAA,EACF;AAEA,SAAO;AACT;AAMO,MAAM,mBAAmB,CAAC,aAAkC;AACjE,QAAM,OAAkB,CAAC;AAEzB,aAAW,WAAW,UAAU;AAC9B,UAAM,aAAa,uBAAuB,QAAQ,UAAU;AAC5D,UAAM,CAAC,UAAU,SAAS,IAAK,QAAQ,SACpC;AAEH,SAAK,KAAK;AAAA,MACR,GAAG;AAAA,MACH;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/functions/set-layers-id.ts"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { isElement } from 'react-is';\n\nimport { BubbleLayer as _BubbleLayer } from '../components/BubbleLayer/BubbleLayer.js';\nimport { ChoroplethLayer as _ChoroplethLayer } from '../components/ChoroplethLayer/ChoroplethLayer.js';\nimport { ConnectionLayer as _ConnectionLayer } from '../components/ConnectionLayer/ConnectionLayer.js';\nimport { DotLayer as _DotLayer } from '../components/DotLayer/DotLayer.js';\nimport { BubbleLayer } from '../slots/BubbleLayer.js';\nimport { ChoroplethLayer } from '../slots/ChoroplethLayer.js';\nimport { ConnectionLayer } from '../slots/ConnectionLayer.js';\nimport { DotLayer } from '../slots/DotLayer.js';\nimport { InternalBubbleLayerProps } from '../types/bubble-layer.js';\nimport { InternalChoroplethLayerProps } from '../types/choropleth-layer.js';\nimport { InternalConnectionLayerProps } from '../types/connection-layer.js';\nimport { InternalDotLayerProps } from '../types/dot-layer.js';\n\nconst layers = new WeakMap<\n React.JSXElementConstructor<never>,\n { prefix: string; component: React.JSXElementConstructor<never> }\n>([\n [BubbleLayer, { component: _BubbleLayer, prefix: 'bubble' }],\n [DotLayer, { component: _DotLayer, prefix: 'dot' }],\n [ChoroplethLayer, { component: _ChoroplethLayer, prefix: 'choropleth' }],\n [ConnectionLayer, { component: _ConnectionLayer, prefix: 'connection' }],\n]);\n\n/**\n * Set layers id to layer slots provided by the consumer.\n * @param children - MapView children\n * @returns An array with all the layers IDs and the children using the layer component\n */\nexport const setLayersId = (children: React.ReactNode) => {\n const layerIds: string[] = [];\n let index = 0;\n\n const parsedChildren = React.Children.map(children, (child) => {\n if (isElement(child)) {\n switch (child.type) {\n case BubbleLayer:\n case ConnectionLayer:\n case ChoroplethLayer:\n case DotLayer: {\n const layer = layers.get(child.type);\n\n const layerId = `${layer?.prefix}-${index}`;\n index += 1;\n\n layerIds.push(layerId);\n\n const newProps: React.PropsWithChildren<\n | InternalBubbleLayerProps<never>\n | InternalConnectionLayerProps<never>\n | InternalDotLayerProps<never>\n | InternalChoroplethLayerProps<never>\n > = {\n ...child.props,\n layerId,\n };\n\n return {\n ...child,\n props: newProps,\n type: layer?.component,\n };\n }\n default: {\n return child;\n }\n }\n }\n\n return child;\n }) as React.ReactNode;\n\n return { layerIds, parsedChildren };\n};\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAE1B,SAAS,eAAe,oBAAoB;AAC5C,SAAS,mBAAmB,wBAAwB;AACpD,SAAS,mBAAmB,wBAAwB;AACpD,SAAS,YAAY,iBAAiB;AACtC,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AAMzB,MAAM,SAAS,IAAI,QAGjB;AAAA,EACA,CAAC,aAAa,EAAE,WAAW,cAAc,QAAQ,SAAS,CAAC;AAAA,EAC3D,CAAC,UAAU,EAAE,WAAW,WAAW,QAAQ,MAAM,CAAC;AAAA,EAClD,CAAC,iBAAiB,EAAE,WAAW,kBAAkB,QAAQ,aAAa,CAAC;AAAA,EACvE,CAAC,iBAAiB,EAAE,WAAW,kBAAkB,QAAQ,aAAa,CAAC;AACzE,CAAC;AAOM,MAAM,cAAc,CAAC,aAA8B;AACxD,QAAM,WAAqB,CAAC;AAC5B,MAAI,QAAQ;AAEZ,QAAM,iBAAiB,MAAM,SAAS,IAAI,UAAU,CAAC,UAAU;AAC7D,QAAI,UAAU,KAAK,GAAG;AACpB,cAAQ,MAAM,MAAM;AAAA,QAClB,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK,UAAU;AACb,gBAAM,QAAQ,OAAO,IAAI,MAAM,IAAI;AAEnC,gBAAM,UAAU,GAAG,OAAO,MAAM,IAAI,KAAK;AACzC,mBAAS;AAET,mBAAS,KAAK,OAAO;AAErB,gBAAM,WAKF;AAAA,YACF,GAAG,MAAM;AAAA,YACT;AAAA,UACF;AAEA,iBAAO;AAAA,YACL,GAAG;AAAA,YACH,OAAO;AAAA,YACP,MAAM,OAAO;AAAA,UACf;AAAA,QACF;AAAA,QACA,SAAS;AACP,iBAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,EACT,CAAC;AAED,SAAO,EAAE,UAAU,eAAe;AACpC;",
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { isElement } from 'react-is';\n\nimport { BubbleLayer as _BubbleLayer } from '../components/BubbleLayer/BubbleLayer.js';\nimport { ChoroplethLayer as _ChoroplethLayer } from '../components/ChoroplethLayer/ChoroplethLayer.js';\nimport { ConnectionLayer as _ConnectionLayer } from '../components/ConnectionLayer/ConnectionLayer.js';\nimport { DotLayer as _DotLayer } from '../components/DotLayer/DotLayer.js';\nimport { BubbleLayer } from '../slots/BubbleLayer.js';\nimport { ChoroplethLayer } from '../slots/ChoroplethLayer.js';\nimport { ConnectionLayer } from '../slots/ConnectionLayer.js';\nimport { DotLayer } from '../slots/DotLayer.js';\nimport type { InternalBubbleLayerProps } from '../types/bubble-layer.js';\nimport type { InternalChoroplethLayerProps } from '../types/choropleth-layer.js';\nimport type { InternalConnectionLayerProps } from '../types/connection-layer.js';\nimport type { InternalDotLayerProps } from '../types/dot-layer.js';\n\nconst layers = new WeakMap<\n React.JSXElementConstructor<never>,\n { prefix: string; component: React.JSXElementConstructor<never> }\n>([\n [BubbleLayer, { component: _BubbleLayer, prefix: 'bubble' }],\n [DotLayer, { component: _DotLayer, prefix: 'dot' }],\n [ChoroplethLayer, { component: _ChoroplethLayer, prefix: 'choropleth' }],\n [ConnectionLayer, { component: _ConnectionLayer, prefix: 'connection' }],\n]);\n\n/**\n * Set layers id to layer slots provided by the consumer.\n * @param children - MapView children\n * @returns An array with all the layers IDs and the children using the layer component\n */\nexport const setLayersId = (children: React.ReactNode) => {\n const layerIds: string[] = [];\n let index = 0;\n\n const parsedChildren = React.Children.map(children, (child) => {\n if (isElement(child)) {\n switch (child.type) {\n case BubbleLayer:\n case ConnectionLayer:\n case ChoroplethLayer:\n case DotLayer: {\n const layer = layers.get(child.type);\n\n const layerId = `${layer?.prefix}-${index}`;\n index += 1;\n\n layerIds.push(layerId);\n\n const newProps: React.PropsWithChildren<\n | InternalBubbleLayerProps<never>\n | InternalConnectionLayerProps<never>\n | InternalDotLayerProps<never>\n | InternalChoroplethLayerProps<never>\n > = {\n ...child.props,\n layerId,\n };\n\n return {\n ...child,\n key: layerId,\n props: newProps,\n type: layer?.component,\n };\n }\n default: {\n return child;\n }\n }\n }\n\n return child;\n }) as React.ReactNode;\n\n return { layerIds, parsedChildren };\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAE1B,SAAS,eAAe,oBAAoB;AAC5C,SAAS,mBAAmB,wBAAwB;AACpD,SAAS,mBAAmB,wBAAwB;AACpD,SAAS,YAAY,iBAAiB;AACtC,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AAMzB,MAAM,SAAS,IAAI,QAGjB;AAAA,EACA,CAAC,aAAa,EAAE,WAAW,cAAc,QAAQ,SAAS,CAAC;AAAA,EAC3D,CAAC,UAAU,EAAE,WAAW,WAAW,QAAQ,MAAM,CAAC;AAAA,EAClD,CAAC,iBAAiB,EAAE,WAAW,kBAAkB,QAAQ,aAAa,CAAC;AAAA,EACvE,CAAC,iBAAiB,EAAE,WAAW,kBAAkB,QAAQ,aAAa,CAAC;AACzE,CAAC;AAOM,MAAM,cAAc,CAAC,aAA8B;AACxD,QAAM,WAAqB,CAAC;AAC5B,MAAI,QAAQ;AAEZ,QAAM,iBAAiB,MAAM,SAAS,IAAI,UAAU,CAAC,UAAU;AAC7D,QAAI,UAAU,KAAK,GAAG;AACpB,cAAQ,MAAM,MAAM;AAAA,QAClB,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK,UAAU;AACb,gBAAM,QAAQ,OAAO,IAAI,MAAM,IAAI;AAEnC,gBAAM,UAAU,GAAG,OAAO,MAAM,IAAI,KAAK;AACzC,mBAAS;AAET,mBAAS,KAAK,OAAO;AAErB,gBAAM,WAKF;AAAA,YACF,GAAG,MAAM;AAAA,YACT;AAAA,UACF;AAEA,iBAAO;AAAA,YACL,GAAG;AAAA,YACH,KAAK;AAAA,YACL,OAAO;AAAA,YACP,MAAM,OAAO;AAAA,UACf;AAAA,QACF;AAAA,QACA,SAAS;AACP,iBAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,EACT,CAAC;AAED,SAAO,EAAE,UAAU,eAAe;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/functions/tooltip-type-guards.ts"],
|
|
4
|
-
"sourcesContent": ["import { BubbleLayerTooltip } from '../slots/BubbleLayerTooltip.js';\nimport { ChoroplethLayerTooltip } from '../slots/ChoroplethLayerTooltip.js';\nimport { ConnectionLayerTooltip } from '../slots/ConnectionLayerTooltip.js';\nimport { DotLayerTooltip } from '../slots/DotLayerTooltip.js';\nimport {\n BubbleLayerTooltipHandler,\n ChoroplethLayerTooltipData,\n ChoroplethLayerTooltipHandler,\n ConnectionLayerTooltipData,\n ConnectionLayerTooltipHandler,\n DotLayerTooltipHandler,\n LayerTooltipData,\n LayerTooltipHandler,\n} from '../types/tooltip.js';\n\n/**\n * Type guards for tooltip template\n * @param template\n */\nexport const isDotTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is DotLayerTooltipHandler =>\n typeof template === typeof DotLayerTooltip;\n\nexport const isBubbleTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is BubbleLayerTooltipHandler =>\n typeof template === typeof BubbleLayerTooltip;\n\nexport const isConnectionTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is ConnectionLayerTooltipHandler =>\n typeof template === typeof ConnectionLayerTooltip;\n\nexport const isChoroplethTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is ChoroplethLayerTooltipHandler =>\n typeof template === typeof ChoroplethLayerTooltip;\n\n/**\n * Type guards for map types in tooltip context\n * @param data -\n */\nexport const isConnection = (\n data: LayerTooltipData,\n): data is ConnectionLayerTooltipData => data['path'] !== undefined;\n\nexport const isRegion = (\n data: LayerTooltipData,\n): data is ChoroplethLayerTooltipData => data['name'] !== undefined;\n"],
|
|
4
|
+
"sourcesContent": ["import { BubbleLayerTooltip } from '../slots/BubbleLayerTooltip.js';\nimport { ChoroplethLayerTooltip } from '../slots/ChoroplethLayerTooltip.js';\nimport { ConnectionLayerTooltip } from '../slots/ConnectionLayerTooltip.js';\nimport { DotLayerTooltip } from '../slots/DotLayerTooltip.js';\nimport type {\n BubbleLayerTooltipHandler,\n ChoroplethLayerTooltipData,\n ChoroplethLayerTooltipHandler,\n ConnectionLayerTooltipData,\n ConnectionLayerTooltipHandler,\n DotLayerTooltipHandler,\n LayerTooltipData,\n LayerTooltipHandler,\n} from '../types/tooltip.js';\n\n/**\n * Type guards for tooltip template\n * @param template\n */\nexport const isDotTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is DotLayerTooltipHandler =>\n typeof template === typeof DotLayerTooltip;\n\nexport const isBubbleTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is BubbleLayerTooltipHandler =>\n typeof template === typeof BubbleLayerTooltip;\n\nexport const isConnectionTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is ConnectionLayerTooltipHandler =>\n typeof template === typeof ConnectionLayerTooltip;\n\nexport const isChoroplethTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is ChoroplethLayerTooltipHandler =>\n typeof template === typeof ChoroplethLayerTooltip;\n\n/**\n * Type guards for map types in tooltip context\n * @param data -\n */\nexport const isConnection = (\n data: LayerTooltipData,\n): data is ConnectionLayerTooltipData => data['path'] !== undefined;\n\nexport const isRegion = (\n data: LayerTooltipData,\n): data is ChoroplethLayerTooltipData => data['name'] !== undefined;\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AACvC,SAAS,uBAAuB;AAgBzB,MAAM,uBAAuB,CAClC,aAEA,OAAO,aAAa,OAAO;AAEtB,MAAM,0BAA0B,CACrC,aAEA,OAAO,aAAa,OAAO;AAEtB,MAAM,8BAA8B,CACzC,aAEA,OAAO,aAAa,OAAO;AAEtB,MAAM,8BAA8B,CACzC,aAEA,OAAO,aAAa,OAAO;AAMtB,MAAM,eAAe,CAC1B,SACuC,KAAK,MAAM,MAAM;AAEnD,MAAM,WAAW,CACtB,SACuC,KAAK,MAAM,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-active-interaction.ts"],
|
|
4
|
-
"sourcesContent": ["import { isNil, isUndefined } from 'lodash-es';\nimport { MapLayerMouseEvent } from 'maplibre-gl';\nimport { useCallback, useEffect } from 'react';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { BASE_LAYER_IDS } from '../constants.js';\n\nexport const useActiveInteraction = () => {\n const map = useMap().current!;\n\n let featureId: string | number | undefined;\n let sourceId: string | undefined;\n const handleClick = useCallback(\n ({ point }: MapLayerMouseEvent) => {\n const features = map.queryRenderedFeatures(point);\n\n const layerId = features?.[0]?.layer?.id;\n\n const hasHoveredFeatures =\n !isNil(features) && features.length > 0 && !isUndefined(layerId);\n const isBaseLayer = BASE_LAYER_IDS.includes(layerId);\n\n if (hasHoveredFeatures && !isBaseLayer) {\n if (!isUndefined(featureId) && !isUndefined(sourceId)) {\n // if there's already an active feature, remove the active state\n map.setFeatureState(\n { source: sourceId, id: featureId },\n { active: false },\n );\n }\n\n featureId = features[0].id;\n sourceId = features[0].layer.source;\n const activeState = features[0].state.active;\n\n // add the active state to the closest feature\n map.setFeatureState(\n { source: sourceId, id: featureId },\n { active: !activeState },\n );\n } else {\n if (!isUndefined(featureId) && !isUndefined(sourceId)) {\n // remove the active state from the last active feature\n map.setFeatureState(\n { source: sourceId, id: featureId },\n { active: false },\n );\n }\n }\n },\n [featureId, sourceId, map],\n );\n\n useEffect(() => {\n map.on('click', handleClick);\n return () => {\n map.off('click', handleClick);\n };\n }, []);\n};\n"],
|
|
4
|
+
"sourcesContent": ["import { isNil, isUndefined } from 'lodash-es';\nimport type { MapLayerMouseEvent } from 'maplibre-gl';\nimport { useCallback, useEffect } from 'react';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { BASE_LAYER_IDS } from '../constants.js';\n\nexport const useActiveInteraction = () => {\n const map = useMap().current!;\n\n let featureId: string | number | undefined;\n let sourceId: string | undefined;\n const handleClick = useCallback(\n ({ point }: MapLayerMouseEvent) => {\n const features = map.queryRenderedFeatures(point);\n\n const layerId = features?.[0]?.layer?.id;\n\n const hasHoveredFeatures =\n !isNil(features) && features.length > 0 && !isUndefined(layerId);\n const isBaseLayer = BASE_LAYER_IDS.includes(layerId);\n\n if (hasHoveredFeatures && !isBaseLayer) {\n if (!isUndefined(featureId) && !isUndefined(sourceId)) {\n // if there's already an active feature, remove the active state\n map.setFeatureState(\n { source: sourceId, id: featureId },\n { active: false },\n );\n }\n\n featureId = features[0].id;\n sourceId = features[0].layer.source;\n const activeState = features[0].state.active;\n\n // add the active state to the closest feature\n map.setFeatureState(\n { source: sourceId, id: featureId },\n { active: !activeState },\n );\n } else {\n if (!isUndefined(featureId) && !isUndefined(sourceId)) {\n // remove the active state from the last active feature\n map.setFeatureState(\n { source: sourceId, id: featureId },\n { active: false },\n );\n }\n }\n },\n [featureId, sourceId, map],\n );\n\n useEffect(() => {\n map.on('click', handleClick);\n return () => {\n map.off('click', handleClick);\n };\n }, []);\n};\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,OAAO,mBAAmB;AAEnC,SAAS,aAAa,iBAAiB;AACvC,SAAS,cAAc;AAEvB,SAAS,sBAAsB;AAExB,MAAM,uBAAuB,MAAM;AACxC,QAAM,MAAM,OAAO,EAAE;AAErB,MAAI;AACJ,MAAI;AACJ,QAAM,cAAc;AAAA,IAClB,CAAC,EAAE,MAAM,MAA0B;AACjC,YAAM,WAAW,IAAI,sBAAsB,KAAK;AAEhD,YAAM,UAAU,WAAW,CAAC,GAAG,OAAO;AAEtC,YAAM,qBACJ,CAAC,MAAM,QAAQ,KAAK,SAAS,SAAS,KAAK,CAAC,YAAY,OAAO;AACjE,YAAM,cAAc,eAAe,SAAS,OAAO;AAEnD,UAAI,sBAAsB,CAAC,aAAa;AACtC,YAAI,CAAC,YAAY,SAAS,KAAK,CAAC,YAAY,QAAQ,GAAG;AAErD,cAAI;AAAA,YACF,EAAE,QAAQ,UAAU,IAAI,UAAU;AAAA,YAClC,EAAE,QAAQ,MAAM;AAAA,UAClB;AAAA,QACF;AAEA,oBAAY,SAAS,CAAC,EAAE;AACxB,mBAAW,SAAS,CAAC,EAAE,MAAM;AAC7B,cAAM,cAAc,SAAS,CAAC,EAAE,MAAM;AAGtC,YAAI;AAAA,UACF,EAAE,QAAQ,UAAU,IAAI,UAAU;AAAA,UAClC,EAAE,QAAQ,CAAC,YAAY;AAAA,QACzB;AAAA,MACF,OAAO;AACL,YAAI,CAAC,YAAY,SAAS,KAAK,CAAC,YAAY,QAAQ,GAAG;AAErD,cAAI;AAAA,YACF,EAAE,QAAQ,UAAU,IAAI,UAAU;AAAA,YAClC,EAAE,QAAQ,MAAM;AAAA,UAClB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,WAAW,UAAU,GAAG;AAAA,EAC3B;AAEA,YAAU,MAAM;AACd,QAAI,GAAG,SAAS,WAAW;AAC3B,WAAO,MAAM;AACX,UAAI,IAAI,SAAS,WAAW;AAAA,IAC9B;AAAA,EACF,GAAG,CAAC,CAAC;AACP;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-attach-image-from-icon.ts"],
|
|
4
|
-
"sourcesContent": ["import { isString } from 'lodash-es';\nimport { createElement, ReactNode, useLayoutEffect } from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { useSafeSvgParser } from './use-safe-svg-parser.js';\nimport { DEFAULT_INPUT_ICON_SIZE } from '../constants.js';\nimport { attachImageToMap } from '../functions/attach-image-to-map.js';\nimport { createBitmapConfigOptions } from '../functions/create-bitmap-config-options.js';\nimport { getDataUri } from '../functions/get-data-uri.js';\nimport { getScaledSymbolSize } from '../functions/get-scaled-symbol-size.js';\nimport { MapShape } from '../types/shapes.js';\n\nexport const useAttachImageFromIcon = (\n icon: string | MapShape | ReactNode,\n suffix: string,\n outputSize?: number,\n) => {\n const { elementAsString, ref } = useSafeSvgParser();\n const defaultScaledIconSize = getScaledSymbolSize();\n const { current: map } = useMap()!;\n const img = new Image(defaultScaledIconSize, defaultScaledIconSize);\n\n /*\n * As we can only create a reference in a React Node, but we need a virtual\n * 'root' element in the DOM to attach it, we create a 'div'\n * container that lately will hold the React Node. This is done to ensure\n * everything is cached prior any manipulation.\n */\n // Create a div element that acts as a container node in the DOM\n const fakeDomContainer = document.createElement('div');\n useLayoutEffect(() => {\n if (isString(icon)) {\n return;\n }\n // Create a React Node that will have a ref callback to be run when loaded and\n // the input icon as a children\n const reactNodeRefContainer = createElement('div', { ref }, icon);\n // Attach React Node with the ref callback into DOM Node\n const root = createRoot(fakeDomContainer);\n root.render(reactNodeRefContainer);\n }, [icon]);\n\n // Remove cached element to free resources\n fakeDomContainer.remove();\n\n const stringUrl = getDataUri(elementAsString);\n\n img.addEventListener('load', () => {\n createImageBitmap(\n img,\n 0,\n 0,\n DEFAULT_INPUT_ICON_SIZE,\n DEFAULT_INPUT_ICON_SIZE,\n createBitmapConfigOptions(outputSize),\n ).then((bitmap) => {\n const iconName = `custom-icon-${suffix}`;\n attachImageToMap(map!, bitmap, iconName);\n });\n });\n img.src = stringUrl;\n\n return !isString(icon);\n};\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,
|
|
4
|
+
"sourcesContent": ["import { isString } from 'lodash-es';\nimport { createElement, type ReactNode, useLayoutEffect } from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { useSafeSvgParser } from './use-safe-svg-parser.js';\nimport { DEFAULT_INPUT_ICON_SIZE } from '../constants.js';\nimport { attachImageToMap } from '../functions/attach-image-to-map.js';\nimport { createBitmapConfigOptions } from '../functions/create-bitmap-config-options.js';\nimport { getDataUri } from '../functions/get-data-uri.js';\nimport { getScaledSymbolSize } from '../functions/get-scaled-symbol-size.js';\nimport type { MapShape } from '../types/shapes.js';\n\nexport const useAttachImageFromIcon = (\n icon: string | MapShape | ReactNode,\n suffix: string,\n outputSize?: number,\n) => {\n const { elementAsString, ref } = useSafeSvgParser();\n const defaultScaledIconSize = getScaledSymbolSize();\n const { current: map } = useMap()!;\n const img = new Image(defaultScaledIconSize, defaultScaledIconSize);\n\n /*\n * As we can only create a reference in a React Node, but we need a virtual\n * 'root' element in the DOM to attach it, we create a 'div'\n * container that lately will hold the React Node. This is done to ensure\n * everything is cached prior any manipulation.\n */\n // Create a div element that acts as a container node in the DOM\n const fakeDomContainer = document.createElement('div');\n useLayoutEffect(() => {\n if (isString(icon)) {\n return;\n }\n // Create a React Node that will have a ref callback to be run when loaded and\n // the input icon as a children\n const reactNodeRefContainer = createElement('div', { ref }, icon);\n // Attach React Node with the ref callback into DOM Node\n const root = createRoot(fakeDomContainer);\n root.render(reactNodeRefContainer);\n }, [icon]);\n\n // Remove cached element to free resources\n fakeDomContainer.remove();\n\n const stringUrl = getDataUri(elementAsString);\n\n img.addEventListener('load', () => {\n createImageBitmap(\n img,\n 0,\n 0,\n DEFAULT_INPUT_ICON_SIZE,\n DEFAULT_INPUT_ICON_SIZE,\n createBitmapConfigOptions(outputSize),\n ).then((bitmap) => {\n const iconName = `custom-icon-${suffix}`;\n attachImageToMap(map!, bitmap, iconName);\n });\n });\n img.src = stringUrl;\n\n return !isString(icon);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,eAA+B,uBAAuB;AAC/D,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AAEvB,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AACjC,SAAS,iCAAiC;AAC1C,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAG7B,MAAM,yBAAyB,CACpC,MACA,QACA,eACG;AACH,QAAM,EAAE,iBAAiB,IAAI,IAAI,iBAAiB;AAClD,QAAM,wBAAwB,oBAAoB;AAClD,QAAM,EAAE,SAAS,IAAI,IAAI,OAAO;AAChC,QAAM,MAAM,IAAI,MAAM,uBAAuB,qBAAqB;AASlE,QAAM,mBAAmB,SAAS,cAAc,KAAK;AACrD,kBAAgB,MAAM;AACpB,QAAI,SAAS,IAAI,GAAG;AAClB;AAAA,IACF;AAGA,UAAM,wBAAwB,cAAc,OAAO,EAAE,IAAI,GAAG,IAAI;AAEhE,UAAM,OAAO,WAAW,gBAAgB;AACxC,SAAK,OAAO,qBAAqB;AAAA,EACnC,GAAG,CAAC,IAAI,CAAC;AAGT,mBAAiB,OAAO;AAExB,QAAM,YAAY,WAAW,eAAe;AAE5C,MAAI,iBAAiB,QAAQ,MAAM;AACjC;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,0BAA0B,UAAU;AAAA,IACtC,EAAE,KAAK,CAAC,WAAW;AACjB,YAAM,WAAW,eAAe,MAAM;AACtC,uBAAiB,KAAM,QAAQ,QAAQ;AAAA,IACzC,CAAC;AAAA,EACH,CAAC;AACD,MAAI,MAAM;AAEV,SAAO,CAAC,SAAS,IAAI;AACvB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-attach-symbol-to-map.ts"],
|
|
4
|
-
"sourcesContent": ["import { isNil, isString } from 'lodash-es';\nimport { ReactNode } from 'react';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { useAttachImageFromIcon } from './use-attach-image-from-icon.js';\nimport { attachImageFromString } from '../functions/attach-image-from-string.js';\nimport { MapShape } from '../types/shapes.js';\n\nexport const useAttachSymbolToMap = (\n icon: string | MapShape | ReactNode,\n suffix: string = '',\n outputSize?: number,\n) => {\n const { current: map } = useMap();\n const customIconAttached = useAttachImageFromIcon(icon, suffix, outputSize);\n\n if (isNil(map)) {\n return null;\n }\n\n if (!customIconAttached && isString(icon)) {\n attachImageFromString(map, icon, suffix, outputSize);\n }\n};\n"],
|
|
4
|
+
"sourcesContent": ["import { isNil, isString } from 'lodash-es';\nimport type { ReactNode } from 'react';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { useAttachImageFromIcon } from './use-attach-image-from-icon.js';\nimport { attachImageFromString } from '../functions/attach-image-from-string.js';\nimport type { MapShape } from '../types/shapes.js';\n\nexport const useAttachSymbolToMap = (\n icon: string | MapShape | ReactNode,\n suffix: string = '',\n outputSize?: number,\n) => {\n const { current: map } = useMap();\n const customIconAttached = useAttachImageFromIcon(icon, suffix, outputSize);\n\n if (isNil(map)) {\n return null;\n }\n\n if (!customIconAttached && isString(icon)) {\n attachImageFromString(map, icon, suffix, outputSize);\n }\n};\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,OAAO,gBAAgB;AAEhC,SAAS,cAAc;AAEvB,SAAS,8BAA8B;AACvC,SAAS,6BAA6B;AAG/B,MAAM,uBAAuB,CAClC,MACA,SAAiB,IACjB,eACG;AACH,QAAM,EAAE,SAAS,IAAI,IAAI,OAAO;AAChC,QAAM,qBAAqB,uBAAuB,MAAM,QAAQ,UAAU;AAE1E,MAAI,MAAM,GAAG,GAAG;AACd,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,sBAAsB,SAAS,IAAI,GAAG;AACzC,0BAAsB,KAAK,MAAM,QAAQ,UAAU;AAAA,EACrD;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-color-scale.ts"],
|
|
4
|
-
"sourcesContent": ["import { ScaleOrdinal, ScaleQuantize, ScaleThreshold } from 'd3-scale';\nimport { isUndefined } from 'lodash-es';\nimport React from 'react';\n\nimport { useMapConfig } from './use-map-config.js';\nimport { ColorScaleContext } from '../contexts/color-scale.context.js';\nimport {\n isSequentialLegend,\n isThresholdLegend,\n} from '../functions/build-scale-from-legend-config.js';\n\nexport function useColorScale():\n | ScaleQuantize<string>\n | ScaleThreshold<number, string>\n | ScaleOrdinal<string, string>\n | undefined {\n const context = React.useContext<\n | ScaleQuantize<string>\n | ScaleThreshold<number, string>\n | ScaleOrdinal<string, string>\n | undefined\n >(ColorScaleContext);\n const { legend } = useMapConfig();\n\n if (isUndefined(legend) || isUndefined(context)) {\n return undefined;\n }\n\n if (isSequentialLegend(legend)) {\n return context as ScaleQuantize<string>;\n } else if (isThresholdLegend(legend)) {\n return context as ScaleThreshold<number, string>;\n } else {\n return context as ScaleOrdinal<string, string>;\n }\n}\n"],
|
|
4
|
+
"sourcesContent": ["import type { ScaleOrdinal, ScaleQuantize, ScaleThreshold } from 'd3-scale';\nimport { isUndefined } from 'lodash-es';\nimport React from 'react';\n\nimport { useMapConfig } from './use-map-config.js';\nimport { ColorScaleContext } from '../contexts/color-scale.context.js';\nimport {\n isSequentialLegend,\n isThresholdLegend,\n} from '../functions/build-scale-from-legend-config.js';\n\nexport function useColorScale():\n | ScaleQuantize<string>\n | ScaleThreshold<number, string>\n | ScaleOrdinal<string, string>\n | undefined {\n const context = React.useContext<\n | ScaleQuantize<string>\n | ScaleThreshold<number, string>\n | ScaleOrdinal<string, string>\n | undefined\n >(ColorScaleContext);\n const { legend } = useMapConfig();\n\n if (isUndefined(legend) || isUndefined(context)) {\n return undefined;\n }\n\n if (isSequentialLegend(legend)) {\n return context as ScaleQuantize<string>;\n } else if (isThresholdLegend(legend)) {\n return context as ScaleThreshold<number, string>;\n } else {\n return context as ScaleOrdinal<string, string>;\n }\n}\n"],
|
|
5
5
|
"mappings": "AACA,SAAS,mBAAmB;AAC5B,OAAO,WAAW;AAElB,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEA,SAAS,gBAIF;AACZ,QAAM,UAAU,MAAM,WAKpB,iBAAiB;AACnB,QAAM,EAAE,OAAO,IAAI,aAAa;AAEhC,MAAI,YAAY,MAAM,KAAK,YAAY,OAAO,GAAG;AAC/C,WAAO;AAAA,EACT;AAEA,MAAI,mBAAmB,MAAM,GAAG;AAC9B,WAAO;AAAA,EACT,WAAW,kBAAkB,MAAM,GAAG;AACpC,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-hover-interaction.ts"],
|
|
4
|
-
"sourcesContent": ["import { isNil, isString, isUndefined } from 'lodash-es';\nimport { MapLayerMouseEvent } from 'maplibre-gl';\nimport { useCallback, useEffect } from 'react';\nimport { MapRef
|
|
5
|
-
"mappings": "AAAA,SAAS,OAAO,UAAU,mBAAmB;AAE7C,SAAS,aAAa,iBAAiB;
|
|
4
|
+
"sourcesContent": ["import { isNil, isString, isUndefined } from 'lodash-es';\nimport type { MapLayerMouseEvent } from 'maplibre-gl';\nimport { useCallback, useEffect } from 'react';\nimport type { MapRef } from 'react-map-gl/maplibre';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { BASE_LAYER_IDS } from '../constants.js';\nimport {\n getAssociatedFeatures,\n hasAssociatedFeatures,\n isAssociatedFeature,\n} from '../functions/associated-features.js';\n\n/**\n * Checks whether a feature exists from a given source\n *\n * @param map -\n * @param source -\n * @param id -\n */\nconst featureExists = (\n map: MapRef,\n source: string,\n id: string | number,\n): boolean => {\n const isSourcePresent = map.getSource(source) !== undefined;\n\n return (\n isSourcePresent &&\n map.getFeatureState({\n source,\n id,\n }) !== undefined\n );\n};\n\n/**\n * Removes hovered state from a feature and its associated features from a given source\n * @param map -\n * @param source -\n * @param id -\n */\nconst blurFeature = (map: MapRef, source: string, id: string | number) => {\n map.setFeatureState({ source, id }, { hover: false });\n\n if (isString(id) && hasAssociatedFeatures(id)) {\n for (const associatedFeature of getAssociatedFeatures('connection')) {\n const associatedSource = `${source}-direction`;\n const associatedId = `${id}-${associatedFeature}`;\n\n if (featureExists(map, associatedSource, associatedId)) {\n map.setFeatureState(\n { source: associatedSource, id: associatedId },\n {\n hover: false,\n },\n );\n }\n }\n }\n};\n\n/**\n * Sets hovered state to a feature and its associated features from a given source\n * @param map -\n * @param source -\n * @param id -\n */\nconst hoverFeature = (map: MapRef, source: string, id: string | number) => {\n map.setFeatureState({ source, id }, { hover: true });\n\n if (isString(id) && hasAssociatedFeatures(id)) {\n for (const associatedFeature of getAssociatedFeatures('connection')) {\n const associatedSource = `${source}-direction`;\n const associatedId = `${id}-${associatedFeature}`;\n\n if (featureExists(map, associatedSource, associatedId)) {\n map.setFeatureState(\n { source: `${source}-direction`, id: `${id}-${associatedFeature}` },\n {\n hover: true,\n },\n );\n }\n }\n }\n};\n\n/**\n * Sets and removes hovered state to the features depending on mouse position\n */\nexport const useHoverInteraction = () => {\n const map = useMap().current;\n\n let featureId: string | number | undefined;\n let sourceId: string | undefined;\n\n const handleMouseOut = useCallback(\n ({ point }: MapLayerMouseEvent) => {\n if (!isNil(map) && !isUndefined(featureId) && !isUndefined(sourceId)) {\n blurFeature(map, sourceId, featureId);\n }\n },\n [featureId, sourceId, map],\n );\n\n const handleMouseMove = useCallback(\n ({ point }: MapLayerMouseEvent) => {\n if (!isNil(map)) {\n const features = map\n .queryRenderedFeatures(point)\n .filter((feature) => !isAssociatedFeature(feature.properties.id)); // associated features should only have hover state when the main feature is hovered\n\n map.getCanvas().style.cursor = 'grab';\n const layerId = features?.[0]?.layer?.id;\n\n const hasHoveredFeatures =\n !isNil(features) && features.length > 0 && !isUndefined(layerId);\n const isBaseLayer = BASE_LAYER_IDS.includes(layerId);\n\n if (hasHoveredFeatures && !isBaseLayer) {\n map.getCanvas().style.cursor = 'pointer';\n if (!isUndefined(featureId) && !isUndefined(sourceId)) {\n // if there's already a hovered feature, remove the hover state\n blurFeature(map, sourceId, featureId);\n }\n\n featureId = features[0].id;\n sourceId = features[0].layer.source;\n\n // add the hover state to the closest feature\n if (!isUndefined(featureId)) {\n hoverFeature(map, sourceId, featureId);\n }\n } else {\n map.getCanvas().style.cursor = 'grab';\n\n if (!isUndefined(featureId) && !isUndefined(sourceId)) {\n // remove the active state from the last hovered feature\n blurFeature(map, sourceId, featureId);\n }\n }\n }\n },\n [featureId, sourceId, map],\n );\n\n useEffect(() => {\n map?.on('mousemove', handleMouseMove);\n map?.on('mouseout', handleMouseOut);\n return () => {\n map?.off('mousemove', handleMouseMove);\n map?.off('mouseout', handleMouseOut);\n };\n }, []);\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-initial-view-state.ts"],
|
|
4
|
-
"sourcesContent": ["import { isUndefined } from 'lodash-es';\n\nimport { useDataBoundingBox } from './use-data-bounding-box.js';\nimport { ViewState } from '../types/map-view.js';\n\nexport const useInitialViewState = (\n initialViewState: ViewState | undefined,\n) => {\n const dataBBox = useDataBoundingBox();\n return isUndefined(initialViewState) ? dataBBox : initialViewState;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import { isUndefined } from 'lodash-es';\n\nimport { useDataBoundingBox } from './use-data-bounding-box.js';\nimport type { ViewState } from '../types/map-view.js';\n\nexport const useInitialViewState = (\n initialViewState: ViewState | undefined,\n) => {\n const dataBBox = useDataBoundingBox();\n return isUndefined(initialViewState) ? dataBBox : initialViewState;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,mBAAmB;AAE5B,SAAS,0BAA0B;AAG5B,MAAM,sBAAsB,CACjC,qBACG;AACH,QAAM,WAAW,mBAAmB;AACpC,SAAO,YAAY,gBAAgB,IAAI,WAAW;AACpD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-legend-interaction-highlighting.ts"],
|
|
4
|
-
"sourcesContent": ["import { isUndefined } from 'lodash-es';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { useMapSelectionState } from '../store/selectors.js';\nimport { BubbleLayerProps } from '../types/bubble-layer.js';\nimport { ChoroplethLayerProps } from '../types/choropleth-layer.js';\nimport { isLegendColoring } from '../types/coloring.js';\nimport { DotLayerProps } from '../types/dot-layer.js';\nimport { Location } from '../types/location.js';\n\nexport const useLegendInteractionHighlighting = <\n L extends Location,\n R extends Record<string, unknown>,\n>(\n props: DotLayerProps<L> | BubbleLayerProps<L> | ChoroplethLayerProps<R>,\n sourceId: string,\n) => {\n const { highlightedSeries } = useMapSelectionState();\n const { current: map } = useMap();\n\n if (isLegendColoring(props) && !isUndefined(map)) {\n // Before highlight, we need to remove previous state (all highlighted symbols)\n const hoveredByLegend = map.querySourceFeatures(sourceId, {\n filter: ['all'],\n });\n hoveredByLegend?.map((ft) =>\n map.setFeatureState(\n { source: sourceId, id: ft.id },\n { legendHover: true },\n ),\n );\n\n if (highlightedSeries) {\n const highlightedSeriesNames = highlightedSeries.map((s) => s.name);\n const hoveredByLegend = map.querySourceFeatures(sourceId, {\n filter: ['!in', props.valueAccessor, ...highlightedSeriesNames],\n });\n hoveredByLegend?.map((ft) =>\n map.setFeatureState(\n { source: sourceId, id: ft.id },\n { legendHover: false },\n ),\n );\n }\n }\n};\n"],
|
|
4
|
+
"sourcesContent": ["import { isUndefined } from 'lodash-es';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { useMapSelectionState } from '../store/selectors.js';\nimport type { BubbleLayerProps } from '../types/bubble-layer.js';\nimport type { ChoroplethLayerProps } from '../types/choropleth-layer.js';\nimport { isLegendColoring } from '../types/coloring.js';\nimport type { DotLayerProps } from '../types/dot-layer.js';\nimport type { Location } from '../types/location.js';\n\nexport const useLegendInteractionHighlighting = <\n L extends Location,\n R extends Record<string, unknown>,\n>(\n props: DotLayerProps<L> | BubbleLayerProps<L> | ChoroplethLayerProps<R>,\n sourceId: string,\n) => {\n const { highlightedSeries } = useMapSelectionState();\n const { current: map } = useMap();\n\n if (isLegendColoring(props) && !isUndefined(map)) {\n // Before highlight, we need to remove previous state (all highlighted symbols)\n const hoveredByLegend = map.querySourceFeatures(sourceId, {\n filter: ['all'],\n });\n hoveredByLegend?.map((ft) =>\n map.setFeatureState(\n { source: sourceId, id: ft.id },\n { legendHover: true },\n ),\n );\n\n if (highlightedSeries) {\n const highlightedSeriesNames = highlightedSeries.map((s) => s.name);\n const hoveredByLegend = map.querySourceFeatures(sourceId, {\n filter: ['!in', props.valueAccessor, ...highlightedSeriesNames],\n });\n hoveredByLegend?.map((ft) =>\n map.setFeatureState(\n { source: sourceId, id: ft.id },\n { legendHover: false },\n ),\n );\n }\n }\n};\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AAEvB,SAAS,4BAA4B;AAGrC,SAAS,wBAAwB;AAI1B,MAAM,mCAAmC,CAI9C,OACA,aACG;AACH,QAAM,EAAE,kBAAkB,IAAI,qBAAqB;AACnD,QAAM,EAAE,SAAS,IAAI,IAAI,OAAO;AAEhC,MAAI,iBAAiB,KAAK,KAAK,CAAC,YAAY,GAAG,GAAG;AAEhD,UAAM,kBAAkB,IAAI,oBAAoB,UAAU;AAAA,MACxD,QAAQ,CAAC,KAAK;AAAA,IAChB,CAAC;AACD,qBAAiB;AAAA,MAAI,CAAC,OACpB,IAAI;AAAA,QACF,EAAE,QAAQ,UAAU,IAAI,GAAG,GAAG;AAAA,QAC9B,EAAE,aAAa,KAAK;AAAA,MACtB;AAAA,IACF;AAEA,QAAI,mBAAmB;AACrB,YAAM,yBAAyB,kBAAkB,IAAI,CAAC,MAAM,EAAE,IAAI;AAClE,YAAMA,mBAAkB,IAAI,oBAAoB,UAAU;AAAA,QACxD,QAAQ,CAAC,OAAO,MAAM,eAAe,GAAG,sBAAsB;AAAA,MAChE,CAAC;AACD,MAAAA,kBAAiB;AAAA,QAAI,CAAC,OACpB,IAAI;AAAA,UACF,EAAE,QAAQ,UAAU,IAAI,GAAG,GAAG;AAAA,UAC9B,EAAE,aAAa,MAAM;AAAA,QACvB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["hoveredByLegend"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-legend-interaction-visibility.ts"],
|
|
4
|
-
"sourcesContent": ["import { isUndefined } from 'lodash-es';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { useMapSelectionState } from '../store/selectors.js';\nimport { BubbleLayerProps } from '../types/bubble-layer.js';\nimport { ChoroplethLayerProps } from '../types/choropleth-layer.js';\nimport { isLegendColoring } from '../types/coloring.js';\nimport { DotLayerProps } from '../types/dot-layer.js';\nimport { Location } from '../types/location.js';\n\nexport const useLegendInteractionVisibility = <\n L extends Location,\n R extends Record<string, unknown>,\n>(\n props: DotLayerProps<L> | BubbleLayerProps<L> | ChoroplethLayerProps<R>,\n layerId: string,\n) => {\n const { visible } = useMapSelectionState();\n const { current: map } = useMap();\n\n if (isLegendColoring(props) && !isUndefined(map)) {\n if (!isUndefined(visible)) {\n const mapInstance = map.getMap();\n const visibleCategoriesNames = visible.map(({ name }) => name);\n mapInstance.setFilter(layerId, [\n 'in',\n props.valueAccessor,\n ...visibleCategoriesNames,\n ]);\n } else {\n const layer = map.getLayer(layerId);\n if (!isUndefined(layer)) {\n const mapInstance = map.getMap();\n mapInstance.setFilter(layerId, null);\n }\n }\n }\n};\n"],
|
|
4
|
+
"sourcesContent": ["import { isUndefined } from 'lodash-es';\nimport { useMap } from 'react-map-gl/maplibre';\n\nimport { useMapSelectionState } from '../store/selectors.js';\nimport type { BubbleLayerProps } from '../types/bubble-layer.js';\nimport type { ChoroplethLayerProps } from '../types/choropleth-layer.js';\nimport { isLegendColoring } from '../types/coloring.js';\nimport type { DotLayerProps } from '../types/dot-layer.js';\nimport type { Location } from '../types/location.js';\n\nexport const useLegendInteractionVisibility = <\n L extends Location,\n R extends Record<string, unknown>,\n>(\n props: DotLayerProps<L> | BubbleLayerProps<L> | ChoroplethLayerProps<R>,\n layerId: string,\n) => {\n const { visible } = useMapSelectionState();\n const { current: map } = useMap();\n\n if (isLegendColoring(props) && !isUndefined(map)) {\n if (!isUndefined(visible)) {\n const mapInstance = map.getMap();\n const visibleCategoriesNames = visible.map(({ name }) => name);\n mapInstance.setFilter(layerId, [\n 'in',\n props.valueAccessor,\n ...visibleCategoriesNames,\n ]);\n } else {\n const layer = map.getLayer(layerId);\n if (!isUndefined(layer)) {\n const mapInstance = map.getMap();\n mapInstance.setFilter(layerId, null);\n }\n }\n }\n};\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AAEvB,SAAS,4BAA4B;AAGrC,SAAS,wBAAwB;AAI1B,MAAM,iCAAiC,CAI5C,OACA,YACG;AACH,QAAM,EAAE,QAAQ,IAAI,qBAAqB;AACzC,QAAM,EAAE,SAAS,IAAI,IAAI,OAAO;AAEhC,MAAI,iBAAiB,KAAK,KAAK,CAAC,YAAY,GAAG,GAAG;AAChD,QAAI,CAAC,YAAY,OAAO,GAAG;AACzB,YAAM,cAAc,IAAI,OAAO;AAC/B,YAAM,yBAAyB,QAAQ,IAAI,CAAC,EAAE,KAAK,MAAM,IAAI;AAC7D,kBAAY,UAAU,SAAS;AAAA,QAC7B;AAAA,QACA,MAAM;AAAA,QACN,GAAG;AAAA,MACL,CAAC;AAAA,IACH,OAAO;AACL,YAAM,QAAQ,IAAI,SAAS,OAAO;AAClC,UAAI,CAAC,YAAY,KAAK,GAAG;AACvB,cAAM,cAAc,IAAI,OAAO;AAC/B,oBAAY,UAAU,SAAS,IAAI;AAAA,MACrC;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-load-symbol-into-map.ts"],
|
|
4
|
-
"sourcesContent": ["import { isString } from 'lodash-es';\nimport { ReactNode } from 'react';\n\nimport { useAttachSymbolToMap } from './use-attach-symbol-to-map.js';\nimport { isValidShape } from '../functions/is-valid-shape.js';\nimport { MapShape, SymbolType } from '../types/shapes.js';\n\nconst getSymbolType = (shape: string | MapShape | ReactNode): SymbolType => {\n if (!isString(shape)) {\n return 'icon';\n } else if (isValidShape(shape)) {\n return 'shape';\n } else {\n return 'emoji';\n }\n};\nconst getSymbolName = (shape: string | MapShape | ReactNode) => {\n if (!isString(shape)) {\n return 'custom-icon';\n } else if (isValidShape(shape)) {\n return shape;\n } else {\n return 'emoji';\n }\n};\nexport const useLoadSymbolIntoMap = (\n shape: string | MapShape | ReactNode,\n layerId: string,\n outputSize?: number,\n) => {\n const symbolType = getSymbolType(shape);\n const symbolName = getSymbolName(shape);\n useAttachSymbolToMap(shape, layerId, outputSize);\n\n return {\n symbolType,\n symbolName: `${symbolName}-${layerId}`,\n };\n};\n"],
|
|
4
|
+
"sourcesContent": ["import { isString } from 'lodash-es';\nimport type { ReactNode } from 'react';\n\nimport { useAttachSymbolToMap } from './use-attach-symbol-to-map.js';\nimport { isValidShape } from '../functions/is-valid-shape.js';\nimport type { MapShape, SymbolType } from '../types/shapes.js';\n\nconst getSymbolType = (shape: string | MapShape | ReactNode): SymbolType => {\n if (!isString(shape)) {\n return 'icon';\n } else if (isValidShape(shape)) {\n return 'shape';\n } else {\n return 'emoji';\n }\n};\nconst getSymbolName = (shape: string | MapShape | ReactNode) => {\n if (!isString(shape)) {\n return 'custom-icon';\n } else if (isValidShape(shape)) {\n return shape;\n } else {\n return 'emoji';\n }\n};\nexport const useLoadSymbolIntoMap = (\n shape: string | MapShape | ReactNode,\n layerId: string,\n outputSize?: number,\n) => {\n const symbolType = getSymbolType(shape);\n const symbolName = getSymbolName(shape);\n useAttachSymbolToMap(shape, layerId, outputSize);\n\n return {\n symbolType,\n symbolName: `${symbolName}-${layerId}`,\n };\n};\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,gBAAgB;AAGzB,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAG7B,MAAM,gBAAgB,CAAC,UAAqD;AAC1E,MAAI,CAAC,SAAS,KAAK,GAAG;AACpB,WAAO;AAAA,EACT,WAAW,aAAa,KAAK,GAAG;AAC9B,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AACA,MAAM,gBAAgB,CAAC,UAAyC;AAC9D,MAAI,CAAC,SAAS,KAAK,GAAG;AACpB,WAAO;AAAA,EACT,WAAW,aAAa,KAAK,GAAG;AAC9B,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AACO,MAAM,uBAAuB,CAClC,OACA,SACA,eACG;AACH,QAAM,aAAa,cAAc,KAAK;AACtC,QAAM,aAAa,cAAc,KAAK;AACtC,uBAAqB,OAAO,SAAS,UAAU;AAE/C,SAAO;AAAA,IACL;AAAA,IACA,YAAY,GAAG,UAAU,IAAI,OAAO;AAAA,EACtC;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Dynatrace LLC
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
1
|
import { useEffect, useRef } from "react";
|
|
17
2
|
const useMapPerformance = (mapContainerRef) => {
|
|
18
3
|
const isDev = true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-map-performance.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "AAAA
|
|
4
|
+
"sourcesContent": ["import { useEffect, useRef } from 'react';\n\nexport const useMapPerformance = (\n mapContainerRef: React.RefObject<HTMLDivElement>,\n) => {\n const isDev = process.env.NODE_ENV === 'development';\n const isRendered = useRef(false);\n let startTime: number | null;\n\n const onRenderHandler = isDev\n ? () => {\n if (!isRendered.current) {\n if (!startTime) {\n startTime = performance.now();\n } else {\n mapContainerRef.current?.setAttribute(\n 'data-render',\n (performance.now() - startTime).toString(),\n );\n }\n }\n }\n : undefined;\n\n const onLoadHandler = isDev\n ? () => {\n startTime = null;\n isRendered.current = true;\n }\n : undefined;\n\n useEffect(\n () => () => {\n if (isDev) {\n isRendered.current = false;\n }\n },\n [isDev],\n );\n\n return {\n onLoadHandler,\n onRenderHandler,\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAW,cAAc;AAE3B,MAAM,oBAAoB,CAC/B,oBACG;AACH,QAAM,QAAQ;AACd,QAAM,aAAa,OAAO,KAAK;AAC/B,MAAI;AAEJ,QAAM,kBAAkB,QACpB,MAAM;AACJ,QAAI,CAAC,WAAW,SAAS;AACvB,UAAI,CAAC,WAAW;AACd,oBAAY,YAAY,IAAI;AAAA,MAC9B,OAAO;AACL,wBAAgB,SAAS;AAAA,UACvB;AAAA,WACC,YAAY,IAAI,IAAI,WAAW,SAAS;AAAA,QAC3C;AAAA,MACF;AAAA,IACF;AAAA,EACF,IACA;AAEJ,QAAM,gBAAgB,QAClB,MAAM;AACJ,gBAAY;AACZ,eAAW,UAAU;AAAA,EACvB,IACA;AAEJ;AAAA,IACE,MAAM,MAAM;AACV,UAAI,OAAO;AACT,mBAAW,UAAU;AAAA,MACvB;AAAA,IACF;AAAA,IACA,CAAC,KAAK;AAAA,EACR;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-overlay-events.ts"],
|
|
4
|
-
"sourcesContent": ["import { MapLayerMouseEvent } from 'maplibre-gl';\n\nimport { parseTooltipData } from '../functions/parse-tooltip-data.js';\nimport {\n useSetStateOverlay,\n useSetStateTooltip,\n useToggleStatePinnedTooltip,\n} from '../store/store.js';\n\nexport const useOverlayEvents = () => {\n const setOverlayState = useSetStateOverlay();\n const setTooltipState = useSetStateTooltip();\n const toggleTooltipPinnedState = useToggleStatePinnedTooltip();\n\n const hideTooltip = () => {\n setTooltipState({ visible: false });\n };\n\n const handleMouseEnter = () => {\n setOverlayState({\n mouseInBounds: true,\n });\n };\n\n const handleMouseMove = (event: MapLayerMouseEvent) => {\n if (event.features && event.features.length) {\n const { clientX, clientY } = event.originalEvent;\n\n const position = {\n x: clientX,\n y: clientY,\n };\n\n const hoveredLayerId = event.features[0].layer.id;\n const hoveredFeatures = event.features.filter(\n (feature) => feature.layer.id === hoveredLayerId,\n );\n\n const data = parseTooltipData(hoveredFeatures);\n\n setTooltipState({\n visible: true,\n hoveredLayerId,\n data,\n position,\n });\n } else {\n hideTooltip();\n }\n };\n\n const handleMouseLeave = () => {\n setOverlayState({\n mouseInBounds: false,\n });\n hideTooltip();\n };\n\n const handleMouseClick = (event: MapLayerMouseEvent) => {\n event.originalEvent.stopPropagation();\n toggleTooltipPinnedState();\n };\n\n const handleDrag = () => {\n hideTooltip();\n };\n const handleZoom = () => {\n hideTooltip();\n };\n\n return {\n handleMouseEnter,\n handleMouseMove,\n handleMouseLeave,\n handleMouseClick,\n handleZoom,\n handleDrag,\n };\n};\n"],
|
|
4
|
+
"sourcesContent": ["import type { MapLayerMouseEvent } from 'maplibre-gl';\n\nimport { parseTooltipData } from '../functions/parse-tooltip-data.js';\nimport {\n useSetStateOverlay,\n useSetStateTooltip,\n useToggleStatePinnedTooltip,\n} from '../store/store.js';\n\nexport const useOverlayEvents = () => {\n const setOverlayState = useSetStateOverlay();\n const setTooltipState = useSetStateTooltip();\n const toggleTooltipPinnedState = useToggleStatePinnedTooltip();\n\n const hideTooltip = () => {\n setTooltipState({ visible: false });\n };\n\n const handleMouseEnter = () => {\n setOverlayState({\n mouseInBounds: true,\n });\n };\n\n const handleMouseMove = (event: MapLayerMouseEvent) => {\n if (event.features && event.features.length) {\n const { clientX, clientY } = event.originalEvent;\n\n const position = {\n x: clientX,\n y: clientY,\n };\n\n const hoveredLayerId = event.features[0].layer.id;\n const hoveredFeatures = event.features.filter(\n (feature) => feature.layer.id === hoveredLayerId,\n );\n\n const data = parseTooltipData(hoveredFeatures);\n\n setTooltipState({\n visible: true,\n hoveredLayerId,\n data,\n position,\n });\n } else {\n hideTooltip();\n }\n };\n\n const handleMouseLeave = () => {\n setOverlayState({\n mouseInBounds: false,\n });\n hideTooltip();\n };\n\n const handleMouseClick = (event: MapLayerMouseEvent) => {\n event.originalEvent.stopPropagation();\n toggleTooltipPinnedState();\n };\n\n const handleDrag = () => {\n hideTooltip();\n };\n const handleZoom = () => {\n hideTooltip();\n };\n\n return {\n handleMouseEnter,\n handleMouseMove,\n handleMouseLeave,\n handleMouseClick,\n handleZoom,\n handleDrag,\n };\n};\n"],
|
|
5
5
|
"mappings": "AAEA,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,mBAAmB,MAAM;AACpC,QAAM,kBAAkB,mBAAmB;AAC3C,QAAM,kBAAkB,mBAAmB;AAC3C,QAAM,2BAA2B,4BAA4B;AAE7D,QAAM,cAAc,MAAM;AACxB,oBAAgB,EAAE,SAAS,MAAM,CAAC;AAAA,EACpC;AAEA,QAAM,mBAAmB,MAAM;AAC7B,oBAAgB;AAAA,MACd,eAAe;AAAA,IACjB,CAAC;AAAA,EACH;AAEA,QAAM,kBAAkB,CAAC,UAA8B;AACrD,QAAI,MAAM,YAAY,MAAM,SAAS,QAAQ;AAC3C,YAAM,EAAE,SAAS,QAAQ,IAAI,MAAM;AAEnC,YAAM,WAAW;AAAA,QACf,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAEA,YAAM,iBAAiB,MAAM,SAAS,CAAC,EAAE,MAAM;AAC/C,YAAM,kBAAkB,MAAM,SAAS;AAAA,QACrC,CAAC,YAAY,QAAQ,MAAM,OAAO;AAAA,MACpC;AAEA,YAAM,OAAO,iBAAiB,eAAe;AAE7C,sBAAgB;AAAA,QACd,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,OAAO;AACL,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,QAAM,mBAAmB,MAAM;AAC7B,oBAAgB;AAAA,MACd,eAAe;AAAA,IACjB,CAAC;AACD,gBAAY;AAAA,EACd;AAEA,QAAM,mBAAmB,CAAC,UAA8B;AACtD,UAAM,cAAc,gBAAgB;AACpC,6BAAyB;AAAA,EAC3B;AAEA,QAAM,aAAa,MAAM;AACvB,gBAAY;AAAA,EACd;AACA,QAAM,aAAa,MAAM;AACvB,gBAAY;AAAA,EACd;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-tooltip-template.tsx"],
|
|
4
|
-
"sourcesContent": ["import { isNil } from 'lodash-es';\nimport React, { Children, ReactNode } from 'react';\nimport { isElement } from 'react-is';\n\nimport { DefaultTooltip } from '../components/DefaultTooltip/DefaultTooltip.js';\nimport {
|
|
5
|
-
"mappings": "AAAA,SAAS,aAAa;AACtB,OAAO,SAAS,
|
|
4
|
+
"sourcesContent": ["import { isNil } from 'lodash-es';\nimport React, { Children, type ReactNode } from 'react';\nimport { isElement } from 'react-is';\n\nimport { DefaultTooltip } from '../components/DefaultTooltip/DefaultTooltip.js';\nimport type {\n LayerTooltipData,\n LayerTooltipHandler,\n} from '../types/tooltip.js';\n\n/**\n * It returns the tooltip template handler or undefined (tooltip disabled).\n *\n * The template will be the custom one if provided, the default template otherwise.\n * @param children\n * @param layerType\n */\nexport function useTooltipTemplate(\n children: ReactNode | undefined,\n layerType: string | React.JSXElementConstructor<unknown>,\n): LayerTooltipHandler | undefined {\n let template: LayerTooltipHandler | undefined = undefined;\n\n Children.forEach(children, (child) => {\n if (isElement(child) && child.type === layerType) {\n const defaultTooltipHandler = (\n closestPoint: LayerTooltipData,\n layerData?: LayerTooltipData[],\n ) => <DefaultTooltip closestPoint={closestPoint} layerData={layerData} />;\n\n template = isNil(child.props.children)\n ? defaultTooltipHandler\n : child.props.children;\n }\n });\n\n return template;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,aAAa;AACtB,OAAO,SAAS,gBAAgC;AAChD,SAAS,iBAAiB;AAE1B,SAAS,sBAAsB;AAaxB,SAAS,mBACd,UACA,WACiC;AACjC,MAAI,WAA4C;AAEhD,WAAS,QAAQ,UAAU,CAAC,UAAU;AACpC,QAAI,UAAU,KAAK,KAAK,MAAM,SAAS,WAAW;AAChD,YAAM,wBAAwB,CAC5B,cACA,cACG,oCAAC,kBAAe,cAA4B,WAAsB;AAEvE,iBAAW,MAAM,MAAM,MAAM,QAAQ,IACjC,wBACA,MAAM,MAAM;AAAA,IAClB;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/providers/color-scale.provider.tsx"],
|
|
4
|
-
"sourcesContent": ["import { isEmpty } from 'lodash-es';\nimport React, { PropsWithChildren } from 'react';\n\nimport { ColorScaleContext } from '../contexts/color-scale.context.js';\nimport { buildScaleFromLegendConfig } from '../functions/build-scale-from-legend-config.js';\nimport { useMapConfig } from '../hooks/use-map-config.js';\n\n/**\n * This provider will hold the scale used to map from a value of the domain\n * to a color in the color palette (range) or undefined in case is out of the\n * domain. This is valid if the consumer set a layer to be colored by the\n * legend, else this provider will be undefined.\n * As we use different scales, the consumer (of this provider) will need to\n * set some type guards to ensure ts compliance.\n * Because of that and to ease the consumption of this provider, we created\n * another one that make use of this scale.\n * @see {@link LayerColorStrategyProvider}\n * @example to build a legend the raw scale could be needed\n * @param children -\n */\nexport const ColorScaleProvider = ({ children }: PropsWithChildren) => {\n const { legend } = useMapConfig();\n if (isEmpty(legend)) {\n return <>{children}</>;\n }\n\n const scale = buildScaleFromLegendConfig(legend);\n\n return (\n <ColorScaleContext.Provider value={scale}>\n {children}\n </ColorScaleContext.Provider>\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,eAAe;AACxB,OAAO,
|
|
4
|
+
"sourcesContent": ["import { isEmpty } from 'lodash-es';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { ColorScaleContext } from '../contexts/color-scale.context.js';\nimport { buildScaleFromLegendConfig } from '../functions/build-scale-from-legend-config.js';\nimport { useMapConfig } from '../hooks/use-map-config.js';\n\n/**\n * This provider will hold the scale used to map from a value of the domain\n * to a color in the color palette (range) or undefined in case is out of the\n * domain. This is valid if the consumer set a layer to be colored by the\n * legend, else this provider will be undefined.\n * As we use different scales, the consumer (of this provider) will need to\n * set some type guards to ensure ts compliance.\n * Because of that and to ease the consumption of this provider, we created\n * another one that make use of this scale.\n * @see {@link LayerColorStrategyProvider}\n * @example to build a legend the raw scale could be needed\n * @param children -\n */\nexport const ColorScaleProvider = ({ children }: PropsWithChildren) => {\n const { legend } = useMapConfig();\n if (isEmpty(legend)) {\n return <>{children}</>;\n }\n\n const scale = buildScaleFromLegendConfig(legend);\n\n return (\n <ColorScaleContext.Provider value={scale}>\n {children}\n </ColorScaleContext.Provider>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAe;AACxB,OAAO,WAAuC;AAE9C,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,oBAAoB;AAetB,MAAM,qBAAqB,CAAC,EAAE,SAAS,MAAyB;AACrE,QAAM,EAAE,OAAO,IAAI,aAAa;AAChC,MAAI,QAAQ,MAAM,GAAG;AACnB,WAAO,0DAAG,QAAS;AAAA,EACrB;AAEA,QAAM,QAAQ,2BAA2B,MAAM;AAE/C,SACE,oCAAC,kBAAkB,UAAlB,EAA2B,OAAO,SAChC,QACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/providers/layer-color-strategy.provider.tsx"],
|
|
4
|
-
"sourcesContent": ["import { extent } from 'd3-array';\nimport { ScaleOrdinal, ScaleQuantize, ScaleThreshold } from 'd3-scale';\nimport { isUndefined } from 'lodash-es';\nimport React, { PropsWithChildren } from 'react';\n\nimport { LayerColoringStrategyContext } from '../contexts/layer-coloring-strategy.context.js';\nimport {\n isSequentialLegend,\n isThresholdLegend,\n} from '../functions/build-scale-from-legend-config.js';\nimport { useColorScale } from '../hooks/use-color-scale.js';\nimport { useMapConfig } from '../hooks/use-map-config.js';\nimport { MapLegendConfig } from '../types/legend.js';\n\nexport function buildCategoricalScale(\n scale: ScaleOrdinal<string, string>,\n): (value: string) => string | undefined {\n return (value: string) => {\n const categories = scale.domain();\n\n if (categories.includes(value)) {\n return scale(value);\n }\n };\n}\n\nexport function buildNumericScale(\n scale: ScaleThreshold<number, string> | ScaleQuantize<string>,\n): (value: number) => string | undefined {\n return (value: number) => {\n const scaleDomain = scale.domain();\n const [min, max] = extent(scaleDomain);\n\n if (value && value >= min && value <= max) {\n return scale(value);\n }\n };\n}\n\nexport function buildClampedScale(\n legend: MapLegendConfig,\n scale:\n | ScaleQuantize<string>\n | ScaleThreshold<number, string>\n | ScaleOrdinal<string, string>,\n): (value: string | number) => string | undefined {\n if (isSequentialLegend(legend)) {\n return buildNumericScale(scale as ScaleQuantize<string>);\n } else if (isThresholdLegend(legend)) {\n return buildNumericScale(scale as ScaleThreshold<number, string>);\n } else {\n return buildCategoricalScale(scale as ScaleOrdinal<string, string>);\n }\n}\n\n/**\n * This provider depends on {@link ColorScaleProvider} and will hold\n * a function to convert a value into a color or undefined in case is out\n * of the domain.\n * @example to get the color needed for the value of a data point based on the legend, the use of the function hold by this provider will be enough.\n *\n * @param children -\n */\nexport const LayerColorStrategyProvider = ({ children }: PropsWithChildren) => {\n const scale = useColorScale();\n\n const { legend } = useMapConfig();\n\n if (isUndefined(legend) || isUndefined(scale)) {\n return <>{children}</>;\n }\n\n const clampedScale = buildClampedScale(legend, scale);\n\n return (\n <LayerColoringStrategyContext.Provider value={clampedScale}>\n {children}\n </LayerColoringStrategyContext.Provider>\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,cAAc;AAEvB,SAAS,mBAAmB;AAC5B,OAAO,
|
|
4
|
+
"sourcesContent": ["import { extent } from 'd3-array';\nimport type { ScaleOrdinal, ScaleQuantize, ScaleThreshold } from 'd3-scale';\nimport { isUndefined } from 'lodash-es';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { LayerColoringStrategyContext } from '../contexts/layer-coloring-strategy.context.js';\nimport {\n isSequentialLegend,\n isThresholdLegend,\n} from '../functions/build-scale-from-legend-config.js';\nimport { useColorScale } from '../hooks/use-color-scale.js';\nimport { useMapConfig } from '../hooks/use-map-config.js';\nimport type { MapLegendConfig } from '../types/legend.js';\n\nexport function buildCategoricalScale(\n scale: ScaleOrdinal<string, string>,\n): (value: string) => string | undefined {\n return (value: string) => {\n const categories = scale.domain();\n\n if (categories.includes(value)) {\n return scale(value);\n }\n };\n}\n\nexport function buildNumericScale(\n scale: ScaleThreshold<number, string> | ScaleQuantize<string>,\n): (value: number) => string | undefined {\n return (value: number) => {\n const scaleDomain = scale.domain();\n const [min, max] = extent(scaleDomain);\n\n if (value && value >= min && value <= max) {\n return scale(value);\n }\n };\n}\n\nexport function buildClampedScale(\n legend: MapLegendConfig,\n scale:\n | ScaleQuantize<string>\n | ScaleThreshold<number, string>\n | ScaleOrdinal<string, string>,\n): (value: string | number) => string | undefined {\n if (isSequentialLegend(legend)) {\n return buildNumericScale(scale as ScaleQuantize<string>);\n } else if (isThresholdLegend(legend)) {\n return buildNumericScale(scale as ScaleThreshold<number, string>);\n } else {\n return buildCategoricalScale(scale as ScaleOrdinal<string, string>);\n }\n}\n\n/**\n * This provider depends on {@link ColorScaleProvider} and will hold\n * a function to convert a value into a color or undefined in case is out\n * of the domain.\n * @example to get the color needed for the value of a data point based on the legend, the use of the function hold by this provider will be enough.\n *\n * @param children -\n */\nexport const LayerColorStrategyProvider = ({ children }: PropsWithChildren) => {\n const scale = useColorScale();\n\n const { legend } = useMapConfig();\n\n if (isUndefined(legend) || isUndefined(scale)) {\n return <>{children}</>;\n }\n\n const clampedScale = buildClampedScale(legend, scale);\n\n return (\n <LayerColoringStrategyContext.Provider value={clampedScale}>\n {children}\n </LayerColoringStrategyContext.Provider>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAc;AAEvB,SAAS,mBAAmB;AAC5B,OAAO,WAAuC;AAE9C,SAAS,oCAAoC;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAGtB,SAAS,sBACd,OACuC;AACvC,SAAO,CAAC,UAAkB;AACxB,UAAM,aAAa,MAAM,OAAO;AAEhC,QAAI,WAAW,SAAS,KAAK,GAAG;AAC9B,aAAO,MAAM,KAAK;AAAA,IACpB;AAAA,EACF;AACF;AAEO,SAAS,kBACd,OACuC;AACvC,SAAO,CAAC,UAAkB;AACxB,UAAM,cAAc,MAAM,OAAO;AACjC,UAAM,CAAC,KAAK,GAAG,IAAI,OAAO,WAAW;AAErC,QAAI,SAAS,SAAS,OAAO,SAAS,KAAK;AACzC,aAAO,MAAM,KAAK;AAAA,IACpB;AAAA,EACF;AACF;AAEO,SAAS,kBACd,QACA,OAIgD;AAChD,MAAI,mBAAmB,MAAM,GAAG;AAC9B,WAAO,kBAAkB,KAA8B;AAAA,EACzD,WAAW,kBAAkB,MAAM,GAAG;AACpC,WAAO,kBAAkB,KAAuC;AAAA,EAClE,OAAO;AACL,WAAO,sBAAsB,KAAqC;AAAA,EACpE;AACF;AAUO,MAAM,6BAA6B,CAAC,EAAE,SAAS,MAAyB;AAC7E,QAAM,QAAQ,cAAc;AAE5B,QAAM,EAAE,OAAO,IAAI,aAAa;AAEhC,MAAI,YAAY,MAAM,KAAK,YAAY,KAAK,GAAG;AAC7C,WAAO,0DAAG,QAAS;AAAA,EACrB;AAEA,QAAM,eAAe,kBAAkB,QAAQ,KAAK;AAEpD,SACE,oCAAC,6BAA6B,UAA7B,EAAsC,OAAO,gBAC3C,QACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/providers/map-initial-view.provider.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, {
|
|
5
|
-
"mappings": "AAAA,OAAO,
|
|
4
|
+
"sourcesContent": ["import React, { useMemo, useRef, type PropsWithChildren } from 'react';\nimport { useMap } from 'react-map-gl';\n\nimport { MapInitialViewContext } from '../contexts/map-initial-view.context.js';\nimport type { ViewState } from '../types/map-view.js';\n\n/**\n * This default center is unreachable in runtime, but useful for testing and type-safety\n */\nconst DEFAULT_CENTER = { lat: 0, lng: 0 };\n\n/**\n *\n * Since the initial view state can be determined in 2 different ways\n * this provider takes care of taking a snapshot of the initial state that was\n * set when the map was initialized and normalize it storing the latitude\n * longitude and zoom to later retrieve it in the Reset Toolbar button.\n *\n * Notice how this Provider is design to not trigger any re-renders and just\n * hold the initial state view.\n */\nexport const MapInitialViewProvider = ({\n children,\n}: PropsWithChildren<ViewState>) => {\n const { current: map } = useMap();\n const boundaries = useRef(map?.getCenter() ?? DEFAULT_CENTER);\n const zoom = useRef(map?.getZoom()).current;\n\n const { lng: longitude, lat: latitude } = boundaries.current;\n\n return (\n <MapInitialViewContext.Provider\n value={useMemo(\n () => ({ latitude, longitude, zoom }),\n [latitude, longitude, zoom],\n )}\n >\n {children}\n </MapInitialViewContext.Provider>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,SAAS,SAAS,cAAsC;AAC/D,SAAS,cAAc;AAEvB,SAAS,6BAA6B;AAMtC,MAAM,iBAAiB,EAAE,KAAK,GAAG,KAAK,EAAE;AAYjC,MAAM,yBAAyB,CAAC;AAAA,EACrC;AACF,MAAoC;AAClC,QAAM,EAAE,SAAS,IAAI,IAAI,OAAO;AAChC,QAAM,aAAa,OAAO,KAAK,UAAU,KAAK,cAAc;AAC5D,QAAM,OAAO,OAAO,KAAK,QAAQ,CAAC,EAAE;AAEpC,QAAM,EAAE,KAAK,WAAW,KAAK,SAAS,IAAI,WAAW;AAErD,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC,OAAO;AAAA,QACL,OAAO,EAAE,UAAU,WAAW,KAAK;AAAA,QACnC,CAAC,UAAU,WAAW,IAAI;AAAA,MAC5B;AAAA;AAAA,IAEC;AAAA,EACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/shapes/shape-picker.ts"],
|
|
4
|
-
"sourcesContent": ["import { circle } from './circle.js';\nimport { cross } from './cross.js';\nimport { diamond } from './diamond.js';\nimport { heart } from './heart.js';\nimport { pin } from './pin.js';\nimport { square } from './square.js';\nimport { star } from './star.js';\nimport { triangle } from './triangle.js';\nimport { MapShape } from '../types/shapes.js';\n\nexport const getShape = (shape: MapShape) => {\n const shapePicker = {\n pin,\n circle,\n square,\n diamond,\n star,\n heart,\n cross,\n triangle,\n };\n\n return shapePicker[shape];\n};\n"],
|
|
4
|
+
"sourcesContent": ["import { circle } from './circle.js';\nimport { cross } from './cross.js';\nimport { diamond } from './diamond.js';\nimport { heart } from './heart.js';\nimport { pin } from './pin.js';\nimport { square } from './square.js';\nimport { star } from './star.js';\nimport { triangle } from './triangle.js';\nimport type { MapShape } from '../types/shapes.js';\n\nexport const getShape = (shape: MapShape) => {\n const shapePicker = {\n pin,\n circle,\n square,\n diamond,\n star,\n heart,\n cross,\n triangle,\n };\n\n return shapePicker[shape];\n};\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAGlB,MAAM,WAAW,CAAC,UAAoB;AAC3C,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,YAAY,KAAK;AAC1B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/BubbleLayer.tsx"],
|
|
4
|
-
"sourcesContent": ["import
|
|
4
|
+
"sourcesContent": ["import type { PropsWithChildren } from 'react';\n\nimport { BubbleLayerTooltip } from './BubbleLayerTooltip.js';\nimport type { BubbleLayerProps } from '../types/bubble-layer.js';\nimport type { Location } from '../types/location.js';\n\n/**\n * The `BubbleLayer` component renders data points as bubbles on a map, accepting an array of data points\n * with required properties like latitude and longitude. It supports customization of bubble size\n * using the radius prop and optional tooltips for displaying additional information.\n */\nexport const BubbleLayer = <T extends Location>(\n _: PropsWithChildren<BubbleLayerProps<T>>,\n) => null;\n\nBubbleLayer.Tooltip = BubbleLayerTooltip;\nBubbleLayer['displayName'] = 'BubbleLayerSlot';\n"],
|
|
5
5
|
"mappings": "AAEA,SAAS,0BAA0B;AAS5B,MAAM,cAAc,CACzB,MACG;AAEL,YAAY,UAAU;AACtB,YAAY,aAAa,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/BubbleLayerTooltip.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\n\nimport { BubbleLayerTooltipHandlerProps } from '../types/tooltip.js';\n\nexport const BubbleLayerTooltip = ({\n children,\n}: BubbleLayerTooltipHandlerProps) => <>({children})</>;\n\nBubbleLayerTooltip['displayName'] = 'BubbleLayer.Tooltip';\n"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\n\nimport type { BubbleLayerTooltipHandlerProps } from '../types/tooltip.js';\n\nexport const BubbleLayerTooltip = ({\n children,\n}: BubbleLayerTooltipHandlerProps) => <>({children})</>;\n\nBubbleLayerTooltip['displayName'] = 'BubbleLayer.Tooltip';\n"],
|
|
5
5
|
"mappings": "AAAA,OAAO,WAAW;AAIX,MAAM,qBAAqB,CAAC;AAAA,EACjC;AACF,MAAsC,0DAAE,KAAE,UAAS,GAAC;AAEpD,mBAAmB,aAAa,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/CategoricalLegend.tsx"],
|
|
4
|
-
"sourcesContent": ["import { CategoricalLegendProps } from '../types/legend.js';\n\n/** The categorical legend slot component */\nexport const CategoricalLegend = (props: CategoricalLegendProps) => null;\n\nCategoricalLegend['displayName'] = 'CategoricalLegend';\n"],
|
|
4
|
+
"sourcesContent": ["import type { CategoricalLegendProps } from '../types/legend.js';\n\n/** The categorical legend slot component */\nexport const CategoricalLegend = (props: CategoricalLegendProps) => null;\n\nCategoricalLegend['displayName'] = 'CategoricalLegend';\n"],
|
|
5
5
|
"mappings": "AAGO,MAAM,oBAAoB,CAAC,UAAkC;AAEpE,kBAAkB,aAAa,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/ChartInteractions.tsx"],
|
|
4
|
-
"sourcesContent": ["import { PropsWithChildren } from 'react';\n\nimport { Zoom } from './Zoom.js';\nimport { ZoomToFit } from './ZoomToFit.js';\nimport { ChartInteractionsProps } from '../types/toolbar.js';\n\n/**\n * ChartInteractions slot component.\n */\nconst _ChartInteractions = (props: PropsWithChildren<ChartInteractionsProps>) =>\n null;\n\n_ChartInteractions['displayName'] = 'ChartInteractions';\n\n/** ChartInteractions interactions slot component */\nexport const ChartInteractions = Object.assign(_ChartInteractions, {\n Zoom,\n ZoomToFit,\n});\n"],
|
|
4
|
+
"sourcesContent": ["import type { PropsWithChildren } from 'react';\n\nimport { Zoom } from './Zoom.js';\nimport { ZoomToFit } from './ZoomToFit.js';\nimport type { ChartInteractionsProps } from '../types/toolbar.js';\n\n/**\n * ChartInteractions slot component.\n */\nconst _ChartInteractions = (props: PropsWithChildren<ChartInteractionsProps>) =>\n null;\n\n_ChartInteractions['displayName'] = 'ChartInteractions';\n\n/** ChartInteractions interactions slot component */\nexport const ChartInteractions = Object.assign(_ChartInteractions, {\n Zoom,\n ZoomToFit,\n});\n"],
|
|
5
5
|
"mappings": "AAEA,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAM1B,MAAM,qBAAqB,CAAC,UAC1B;AAEF,mBAAmB,aAAa,IAAI;AAG7B,MAAM,oBAAoB,OAAO,OAAO,oBAAoB;AAAA,EACjE;AAAA,EACA;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/ChoroplethLayer.tsx"],
|
|
4
|
-
"sourcesContent": ["import
|
|
4
|
+
"sourcesContent": ["import type { PropsWithChildren } from 'react';\n\nimport { ChoroplethLayerTooltip } from './ChoroplethLayerTooltip.js';\nimport type { ChoroplethLayerProps } from '../types/choropleth-layer.js';\n\n/**\n * The `ChoroplethLayer` component allows users to display divided geographical\n * areas or regions that are coloured in relation to a given data. It provides an\n * easy way to visualize how a variable varies across a geographic area or show\n * the level of variability within a region.\n */\nexport const ChoroplethLayer = <T extends Record<string, unknown>>(\n _: PropsWithChildren<ChoroplethLayerProps<T>>,\n) => null;\n\nChoroplethLayer.Tooltip = ChoroplethLayerTooltip;\nChoroplethLayer['displayName'] = 'ChoroplethLayerSlot';\n"],
|
|
5
5
|
"mappings": "AAEA,SAAS,8BAA8B;AAShC,MAAM,kBAAkB,CAC7B,MACG;AAEL,gBAAgB,UAAU;AAC1B,gBAAgB,aAAa,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/ChoroplethLayerTooltip.tsx"],
|
|
4
|
-
"sourcesContent": ["import { ChoroplethLayerTooltipHandlerProps } from '../types/tooltip.js';\n\nexport const ChoroplethLayerTooltip = ({\n children,\n}: ChoroplethLayerTooltipHandlerProps) => null;\n\nChoroplethLayerTooltip['displayName'] = 'ChoroplethLayerTooltip.Tooltip';\n"],
|
|
4
|
+
"sourcesContent": ["import type { ChoroplethLayerTooltipHandlerProps } from '../types/tooltip.js';\n\nexport const ChoroplethLayerTooltip = ({\n children,\n}: ChoroplethLayerTooltipHandlerProps) => null;\n\nChoroplethLayerTooltip['displayName'] = 'ChoroplethLayerTooltip.Tooltip';\n"],
|
|
5
5
|
"mappings": "AAEO,MAAM,yBAAyB,CAAC;AAAA,EACrC;AACF,MAA0C;AAE1C,uBAAuB,aAAa,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/ConnectionLayer.tsx"],
|
|
4
|
-
"sourcesContent": ["import
|
|
4
|
+
"sourcesContent": ["import type { PropsWithChildren } from 'react';\n\nimport { ConnectionLayerTooltip } from './ConnectionLayerTooltip.js';\nimport type {\n ConnectionLayerProps,\n Connection,\n} from '../types/connection-layer.js';\n\n/**\n * The `ConnectionLayer` component renders connections between points on a map,\n * accepting an array of `Connection` data points with required properties like\n * latitude and longitude. It supports customization of color, thickness,\n * direction the connection indicators.\n */\nexport const ConnectionLayer = <T extends Connection>(\n _: PropsWithChildren<ConnectionLayerProps<T>>,\n) => null;\n\nConnectionLayer.Tooltip = ConnectionLayerTooltip;\n\nConnectionLayer['displayName'] = 'ConnectionLayerSlot';\n"],
|
|
5
5
|
"mappings": "AAEA,SAAS,8BAA8B;AAYhC,MAAM,kBAAkB,CAC7B,MACG;AAEL,gBAAgB,UAAU;AAE1B,gBAAgB,aAAa,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/ConnectionLayerTooltip.tsx"],
|
|
4
|
-
"sourcesContent": ["import { ConnectionLayerTooltipHandlerProps } from '../types/tooltip.js';\n\nexport const ConnectionLayerTooltip = (_: ConnectionLayerTooltipHandlerProps) =>\n null;\n\nConnectionLayerTooltip['displayName'] = 'ConnectionLayerTooltip.Tooltip';\n"],
|
|
4
|
+
"sourcesContent": ["import type { ConnectionLayerTooltipHandlerProps } from '../types/tooltip.js';\n\nexport const ConnectionLayerTooltip = (_: ConnectionLayerTooltipHandlerProps) =>\n null;\n\nConnectionLayerTooltip['displayName'] = 'ConnectionLayerTooltip.Tooltip';\n"],
|
|
5
5
|
"mappings": "AAEO,MAAM,yBAAyB,CAAC,MACrC;AAEF,uBAAuB,aAAa,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/DotLayer.tsx"],
|
|
4
|
-
"sourcesContent": ["import
|
|
4
|
+
"sourcesContent": ["import type { PropsWithChildren } from 'react';\n\nimport { DotLayerTooltip } from './DotLayerTooltip.js';\nimport type { DotLayerProps } from '../types/dot-layer.js';\nimport type { Location } from '../types/location.js';\n\n/**\n * The `DotLayer` component renders data points on a map, accepting an array of data points\n * with required properties like latitude and longitude. It provides support\n * for various shapes, optional features like custom background for icons, rotation,\n * and tooltips, along with granular color customization and integration with\n * legends for color configuration.\n */\nexport const DotLayer = <T extends Location>(\n _: PropsWithChildren<DotLayerProps<T>>,\n) => null;\n\nDotLayer.Tooltip = DotLayerTooltip;\nDotLayer['displayName'] = 'DotLayerSlot';\n"],
|
|
5
5
|
"mappings": "AAEA,SAAS,uBAAuB;AAWzB,MAAM,WAAW,CACtB,MACG;AAEL,SAAS,UAAU;AACnB,SAAS,aAAa,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/DotLayerTooltip.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\n\nimport { DotLayerTooltipHandlerProps } from '../types/tooltip.js';\n\nexport const DotLayerTooltip = ({ children }: DotLayerTooltipHandlerProps) => (\n <>({children})</>\n);\n\nDotLayerTooltip['displayName'] = 'DotLayer.Tooltip';\n"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\n\nimport type { DotLayerTooltipHandlerProps } from '../types/tooltip.js';\n\nexport const DotLayerTooltip = ({ children }: DotLayerTooltipHandlerProps) => (\n <>({children})</>\n);\n\nDotLayerTooltip['displayName'] = 'DotLayer.Tooltip';\n"],
|
|
5
5
|
"mappings": "AAAA,OAAO,WAAW;AAIX,MAAM,kBAAkB,CAAC,EAAE,SAAS,MACzC,0DAAE,KAAE,UAAS,GAAC;AAGhB,gBAAgB,aAAa,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/SequentialLegend.tsx"],
|
|
4
|
-
"sourcesContent": ["import { SequentialLegendProps } from '../types/legend.js';\n\n/** The sequential legend slot component */\nexport const SequentialLegend = (props: SequentialLegendProps) => null;\n\nSequentialLegend['displayName'] = 'SequentialLegend';\n"],
|
|
4
|
+
"sourcesContent": ["import type { SequentialLegendProps } from '../types/legend.js';\n\n/** The sequential legend slot component */\nexport const SequentialLegend = (props: SequentialLegendProps) => null;\n\nSequentialLegend['displayName'] = 'SequentialLegend';\n"],
|
|
5
5
|
"mappings": "AAGO,MAAM,mBAAmB,CAAC,UAAiC;AAElE,iBAAiB,aAAa,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|