@dynatrace/strato-geo 0.6.32
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/LICENSE +174 -0
- package/README.md +15 -0
- package/esm/index.js +16 -0
- package/esm/index.js.map +7 -0
- package/esm/map/MapView.js +16 -0
- package/esm/map/MapView.js.map +7 -0
- package/esm/map/components/BubbleLayer/BubbleCircleLayer.js +16 -0
- package/esm/map/components/BubbleLayer/BubbleCircleLayer.js.map +7 -0
- package/esm/map/components/BubbleLayer/BubbleLayer.js +16 -0
- package/esm/map/components/BubbleLayer/BubbleLayer.js.map +7 -0
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js +16 -0
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js.map +7 -0
- package/esm/map/components/BubbleLayer/BubbleOutlineLayer.js +16 -0
- package/esm/map/components/BubbleLayer/BubbleOutlineLayer.js.map +7 -0
- package/esm/map/components/BubbleLayer/contexts/size-interpolation.context.js +16 -0
- package/esm/map/components/BubbleLayer/contexts/size-interpolation.context.js.map +7 -0
- package/esm/map/components/BubbleLayer/functions/add-outline-size.js +16 -0
- package/esm/map/components/BubbleLayer/functions/add-outline-size.js.map +7 -0
- package/esm/map/components/BubbleLayer/functions/build-radius-scale.js +16 -0
- package/esm/map/components/BubbleLayer/functions/build-radius-scale.js.map +7 -0
- package/esm/map/components/BubbleLayer/functions/build-stick-to-distance-expressions.js +16 -0
- package/esm/map/components/BubbleLayer/functions/build-stick-to-distance-expressions.js.map +7 -0
- package/esm/map/components/BubbleLayer/functions/parse-bubble-data-to-geo-json.js +16 -0
- package/esm/map/components/BubbleLayer/functions/parse-bubble-data-to-geo-json.js.map +7 -0
- package/esm/map/components/BubbleLayer/hooks/use-size-interpolation.js +16 -0
- package/esm/map/components/BubbleLayer/hooks/use-size-interpolation.js.map +7 -0
- package/esm/map/components/ChoroplethLayer.js +16 -0
- package/esm/map/components/ChoroplethLayer.js.map +7 -0
- package/esm/map/components/ChoroplethLayerTooltip.js +16 -0
- package/esm/map/components/ChoroplethLayerTooltip.js.map +7 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js +16 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js.map +7 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayerDirection.js +16 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayerDirection.js.map +7 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js +16 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js.map +7 -0
- package/esm/map/components/ConnectionLayer/functions/get-arc-line-features.js +16 -0
- package/esm/map/components/ConnectionLayer/functions/get-arc-line-features.js.map +7 -0
- package/esm/map/components/ConnectionLayer/functions/get-arrows-angles.js +16 -0
- package/esm/map/components/ConnectionLayer/functions/get-arrows-angles.js.map +7 -0
- package/esm/map/components/ConnectionLayer/functions/get-straight-line-features.js +16 -0
- package/esm/map/components/ConnectionLayer/functions/get-straight-line-features.js.map +7 -0
- package/esm/map/components/ConnectionLayer/functions/parse-connection-data-to-geo-json.js +16 -0
- package/esm/map/components/ConnectionLayer/functions/parse-connection-data-to-geo-json.js.map +7 -0
- package/esm/map/components/ConnectionLayer/functions/parse-direction-data-to-geo-json.js +16 -0
- package/esm/map/components/ConnectionLayer/functions/parse-direction-data-to-geo-json.js.map +7 -0
- package/esm/map/components/DefaultTooltip.js +16 -0
- package/esm/map/components/DefaultTooltip.js.map +7 -0
- package/esm/map/components/DotLayer/BackgroundLayer.js +16 -0
- package/esm/map/components/DotLayer/BackgroundLayer.js.map +7 -0
- package/esm/map/components/DotLayer/DotLayer.js +16 -0
- package/esm/map/components/DotLayer/DotLayer.js.map +7 -0
- package/esm/map/components/DotLayer/DotLayerTooltip.js +16 -0
- package/esm/map/components/DotLayer/DotLayerTooltip.js.map +7 -0
- package/esm/map/components/DotLayer/functions/calculate-circle-translate.js +16 -0
- package/esm/map/components/DotLayer/functions/calculate-circle-translate.js.map +7 -0
- package/esm/map/components/DotLayer/functions/resolve-icon-background.js +16 -0
- package/esm/map/components/DotLayer/functions/resolve-icon-background.js.map +7 -0
- package/esm/map/components/MapContent.js +16 -0
- package/esm/map/components/MapContent.js.map +7 -0
- package/esm/map/components/legend/CategoricalLegendRenderer.js +16 -0
- package/esm/map/components/legend/CategoricalLegendRenderer.js.map +7 -0
- package/esm/map/components/legend/MapLegendRenderer.js +16 -0
- package/esm/map/components/legend/MapLegendRenderer.js.map +7 -0
- package/esm/map/components/legend/SequentialLegendRenderer.js +16 -0
- package/esm/map/components/legend/SequentialLegendRenderer.js.map +7 -0
- package/esm/map/components/legend/ThresholdLegendRenderer.js +16 -0
- package/esm/map/components/legend/ThresholdLegendRenderer.js.map +7 -0
- package/esm/map/components/legend/functions/resolve-color.js +16 -0
- package/esm/map/components/legend/functions/resolve-color.js.map +7 -0
- package/esm/map/components/toolbar/MapToolbar.js +16 -0
- package/esm/map/components/toolbar/MapToolbar.js.map +7 -0
- package/esm/map/components/toolbar/buttons/MapDownloadDataButton.js +16 -0
- package/esm/map/components/toolbar/buttons/MapDownloadDataButton.js.map +7 -0
- package/esm/map/components/toolbar/buttons/MapResetButton.js +16 -0
- package/esm/map/components/toolbar/buttons/MapResetButton.js.map +7 -0
- package/esm/map/components/toolbar/buttons/MapZoomInOutButtons.js +16 -0
- package/esm/map/components/toolbar/buttons/MapZoomInOutButtons.js.map +7 -0
- package/esm/map/components/toolbar/buttons/MapZoomToFitButton.js +16 -0
- package/esm/map/components/toolbar/buttons/MapZoomToFitButton.js.map +7 -0
- package/esm/map/components/toolbar/constants.js +16 -0
- package/esm/map/components/toolbar/constants.js.map +7 -0
- package/esm/map/constants.js +16 -0
- package/esm/map/constants.js.map +7 -0
- package/esm/map/contexts/a11y-toolbar-tab-index.context.js +16 -0
- package/esm/map/contexts/a11y-toolbar-tab-index.context.js.map +7 -0
- package/esm/map/contexts/color-scale.context.js +16 -0
- package/esm/map/contexts/color-scale.context.js.map +7 -0
- package/esm/map/contexts/layer-coloring-strategy.context.js +16 -0
- package/esm/map/contexts/layer-coloring-strategy.context.js.map +7 -0
- package/esm/map/contexts/layer-ids.context.js +16 -0
- package/esm/map/contexts/layer-ids.context.js.map +7 -0
- package/esm/map/contexts/map-configuration.context.js +16 -0
- package/esm/map/contexts/map-configuration.context.js.map +7 -0
- package/esm/map/contexts/map-country-code.context.js +16 -0
- package/esm/map/contexts/map-country-code.context.js.map +7 -0
- package/esm/map/contexts/map-data-bounding-box.context.js +16 -0
- package/esm/map/contexts/map-data-bounding-box.context.js.map +7 -0
- package/esm/map/contexts/map-initial-view.context.js +16 -0
- package/esm/map/contexts/map-initial-view.context.js.map +7 -0
- package/esm/map/contexts/map-raw-data.context.js +16 -0
- package/esm/map/contexts/map-raw-data.context.js.map +7 -0
- package/esm/map/functions/__test__/fixtures/business-locations.js +16 -0
- package/esm/map/functions/__test__/fixtures/business-locations.js.map +7 -0
- package/esm/map/functions/__test__/fixtures/connection-layer.js +16 -0
- package/esm/map/functions/__test__/fixtures/connection-layer.js.map +7 -0
- package/esm/map/functions/__test__/fixtures/countries-stats.js +16 -0
- package/esm/map/functions/__test__/fixtures/countries-stats.js.map +7 -0
- package/esm/map/functions/__test__/fixtures/csv-download-cases.js +16 -0
- package/esm/map/functions/__test__/fixtures/csv-download-cases.js.map +7 -0
- package/esm/map/functions/__test__/fixtures/events-locations.js +16 -0
- package/esm/map/functions/__test__/fixtures/events-locations.js.map +7 -0
- package/esm/map/functions/__test__/fixtures/facilities-locations.js +16 -0
- package/esm/map/functions/__test__/fixtures/facilities-locations.js.map +7 -0
- package/esm/map/functions/__test__/fixtures/flight-connections.js +16 -0
- package/esm/map/functions/__test__/fixtures/flight-connections.js.map +7 -0
- package/esm/map/functions/a11y-toolbar-controls.js +16 -0
- package/esm/map/functions/a11y-toolbar-controls.js.map +7 -0
- package/esm/map/functions/attach-image-from-shape.js +16 -0
- package/esm/map/functions/attach-image-from-shape.js.map +7 -0
- package/esm/map/functions/attach-image-from-string.js +16 -0
- package/esm/map/functions/attach-image-from-string.js.map +7 -0
- package/esm/map/functions/attach-image-from-text.js +16 -0
- package/esm/map/functions/attach-image-from-text.js.map +7 -0
- package/esm/map/functions/attach-image-to-map.js +16 -0
- package/esm/map/functions/attach-image-to-map.js.map +7 -0
- package/esm/map/functions/build-and-download-csv.js +16 -0
- package/esm/map/functions/build-and-download-csv.js.map +7 -0
- package/esm/map/functions/build-categorical-scale.js +16 -0
- package/esm/map/functions/build-categorical-scale.js.map +7 -0
- package/esm/map/functions/build-scale-from-legend-config.js +16 -0
- package/esm/map/functions/build-scale-from-legend-config.js.map +7 -0
- package/esm/map/functions/calculate-hovered-color.js +16 -0
- package/esm/map/functions/calculate-hovered-color.js.map +7 -0
- package/esm/map/functions/create-bitmap-config-options.js +16 -0
- package/esm/map/functions/create-bitmap-config-options.js.map +7 -0
- package/esm/map/functions/define-bearing.js +16 -0
- package/esm/map/functions/define-bearing.js.map +7 -0
- package/esm/map/functions/define-color.js +16 -0
- package/esm/map/functions/define-color.js.map +7 -0
- package/esm/map/functions/define-radius.js +16 -0
- package/esm/map/functions/define-radius.js.map +7 -0
- package/esm/map/functions/extract-layers-data.js +16 -0
- package/esm/map/functions/extract-layers-data.js.map +7 -0
- package/esm/map/functions/get-client-settings.js +16 -0
- package/esm/map/functions/get-client-settings.js.map +7 -0
- package/esm/map/functions/get-color-from-token.js +16 -0
- package/esm/map/functions/get-color-from-token.js.map +7 -0
- package/esm/map/functions/get-countries-geo-code.js +16 -0
- package/esm/map/functions/get-countries-geo-code.js.map +7 -0
- package/esm/map/functions/get-data-layers-bounding-box.js +16 -0
- package/esm/map/functions/get-data-layers-bounding-box.js.map +7 -0
- package/esm/map/functions/get-data-uri.js +16 -0
- package/esm/map/functions/get-data-uri.js.map +7 -0
- package/esm/map/functions/get-map-states-template.js +16 -0
- package/esm/map/functions/get-map-states-template.js.map +7 -0
- package/esm/map/functions/get-scaled-symbol-size.js +16 -0
- package/esm/map/functions/get-scaled-symbol-size.js.map +7 -0
- package/esm/map/functions/get-tenant-country-code.js +16 -0
- package/esm/map/functions/get-tenant-country-code.js.map +7 -0
- package/esm/map/functions/is-valid-shape.js +16 -0
- package/esm/map/functions/is-valid-shape.js.map +7 -0
- package/esm/map/functions/iterate-config-slots.js +16 -0
- package/esm/map/functions/iterate-config-slots.js.map +7 -0
- package/esm/map/functions/parse-dot-data-to-geo-json.js +16 -0
- package/esm/map/functions/parse-dot-data-to-geo-json.js.map +7 -0
- package/esm/map/functions/parse-region-data-to-geo-json.js +16 -0
- package/esm/map/functions/parse-region-data-to-geo-json.js.map +7 -0
- package/esm/map/functions/safe-reactdom-render.js +16 -0
- package/esm/map/functions/safe-reactdom-render.js.map +7 -0
- package/esm/map/functions/set-layers-id.js +16 -0
- package/esm/map/functions/set-layers-id.js.map +7 -0
- package/esm/map/functions/tabularize-layers-data.js +18 -0
- package/esm/map/functions/tabularize-layers-data.js.map +7 -0
- package/esm/map/functions/to-mapbox-initial-view-state.js +16 -0
- package/esm/map/functions/to-mapbox-initial-view-state.js.map +7 -0
- package/esm/map/functions/tooltip-type-guards.js +16 -0
- package/esm/map/functions/tooltip-type-guards.js.map +7 -0
- package/esm/map/hooks/use-a11y-toolbar-tab-index.js +16 -0
- package/esm/map/hooks/use-a11y-toolbar-tab-index.js.map +7 -0
- package/esm/map/hooks/use-active-interaction.js +16 -0
- package/esm/map/hooks/use-active-interaction.js.map +7 -0
- package/esm/map/hooks/use-attach-image-from-icon.js +16 -0
- package/esm/map/hooks/use-attach-image-from-icon.js.map +7 -0
- package/esm/map/hooks/use-attach-symbol-to-map.js +16 -0
- package/esm/map/hooks/use-attach-symbol-to-map.js.map +7 -0
- package/esm/map/hooks/use-color-scale.js +16 -0
- package/esm/map/hooks/use-color-scale.js.map +7 -0
- package/esm/map/hooks/use-connection-direction-interaction-highlighting.js +16 -0
- package/esm/map/hooks/use-connection-direction-interaction-highlighting.js.map +7 -0
- package/esm/map/hooks/use-connection-interaction-highlighting.js +16 -0
- package/esm/map/hooks/use-connection-interaction-highlighting.js.map +7 -0
- package/esm/map/hooks/use-data-bounding-box.js +16 -0
- package/esm/map/hooks/use-data-bounding-box.js.map +7 -0
- package/esm/map/hooks/use-hover-interaction.js +16 -0
- package/esm/map/hooks/use-hover-interaction.js.map +7 -0
- package/esm/map/hooks/use-initial-view-context.js +16 -0
- package/esm/map/hooks/use-initial-view-context.js.map +7 -0
- package/esm/map/hooks/use-initial-view-state.js +16 -0
- package/esm/map/hooks/use-initial-view-state.js.map +7 -0
- package/esm/map/hooks/use-layer-coloring-strategy.js +16 -0
- package/esm/map/hooks/use-layer-coloring-strategy.js.map +7 -0
- package/esm/map/hooks/use-legend-interaction-highlighting.js +16 -0
- package/esm/map/hooks/use-legend-interaction-highlighting.js.map +7 -0
- package/esm/map/hooks/use-legend-interaction-visibility.js +16 -0
- package/esm/map/hooks/use-legend-interaction-visibility.js.map +7 -0
- package/esm/map/hooks/use-load-symbol-into-map.js +16 -0
- package/esm/map/hooks/use-load-symbol-into-map.js.map +7 -0
- package/esm/map/hooks/use-map-config.js +16 -0
- package/esm/map/hooks/use-map-config.js.map +7 -0
- package/esm/map/hooks/use-map-country-code.js +16 -0
- package/esm/map/hooks/use-map-country-code.js.map +7 -0
- package/esm/map/hooks/use-map-raw-data.js +16 -0
- package/esm/map/hooks/use-map-raw-data.js.map +7 -0
- package/esm/map/hooks/use-map-settings.js +16 -0
- package/esm/map/hooks/use-map-settings.js.map +7 -0
- package/esm/map/hooks/use-map-source.js +16 -0
- package/esm/map/hooks/use-map-source.js.map +7 -0
- package/esm/map/hooks/use-overlay-events.js +16 -0
- package/esm/map/hooks/use-overlay-events.js.map +7 -0
- package/esm/map/hooks/use-resolve-color.js +16 -0
- package/esm/map/hooks/use-resolve-color.js.map +7 -0
- package/esm/map/hooks/use-safe-svg-parser.js +16 -0
- package/esm/map/hooks/use-safe-svg-parser.js.map +7 -0
- package/esm/map/hooks/use-tooltip-event-listeners.js +16 -0
- package/esm/map/hooks/use-tooltip-event-listeners.js.map +7 -0
- package/esm/map/hooks/use-tooltip-template.js +16 -0
- package/esm/map/hooks/use-tooltip-template.js.map +7 -0
- package/esm/map/hooks/useDefaultTooltipActions.js +16 -0
- package/esm/map/hooks/useDefaultTooltipActions.js.map +7 -0
- package/esm/map/map-styles/default-style.js +16 -0
- package/esm/map/map-styles/default-style.js.map +7 -0
- package/esm/map/providers/color-scale.provider.js +16 -0
- package/esm/map/providers/color-scale.provider.js.map +7 -0
- package/esm/map/providers/layer-color-strategy.provider.js +16 -0
- package/esm/map/providers/layer-color-strategy.provider.js.map +7 -0
- package/esm/map/providers/map-initial-view.provider.js +16 -0
- package/esm/map/providers/map-initial-view.provider.js.map +7 -0
- package/esm/map/shapes/circle.js +33 -0
- package/esm/map/shapes/circle.js.map +7 -0
- package/esm/map/shapes/cross.js +28 -0
- package/esm/map/shapes/cross.js.map +7 -0
- package/esm/map/shapes/diamond.js +21 -0
- package/esm/map/shapes/diamond.js.map +7 -0
- package/esm/map/shapes/heart.js +28 -0
- package/esm/map/shapes/heart.js.map +7 -0
- package/esm/map/shapes/pin.js +22 -0
- package/esm/map/shapes/pin.js.map +7 -0
- package/esm/map/shapes/shape-picker.js +16 -0
- package/esm/map/shapes/shape-picker.js.map +7 -0
- package/esm/map/shapes/square.js +19 -0
- package/esm/map/shapes/square.js.map +7 -0
- package/esm/map/shapes/star.js +33 -0
- package/esm/map/shapes/star.js.map +7 -0
- package/esm/map/shapes/triangle.js +28 -0
- package/esm/map/shapes/triangle.js.map +7 -0
- package/esm/map/slots/BubbleLayer.js +16 -0
- package/esm/map/slots/BubbleLayer.js.map +7 -0
- package/esm/map/slots/BubbleLayerTooltip.js +16 -0
- package/esm/map/slots/BubbleLayerTooltip.js.map +7 -0
- package/esm/map/slots/CategoricalLegend.js +16 -0
- package/esm/map/slots/CategoricalLegend.js.map +7 -0
- package/esm/map/slots/ChartInteractions.js +16 -0
- package/esm/map/slots/ChartInteractions.js.map +7 -0
- package/esm/map/slots/ChoroplethLayer.js +16 -0
- package/esm/map/slots/ChoroplethLayer.js.map +7 -0
- package/esm/map/slots/ChoroplethLayerTooltip.js +16 -0
- package/esm/map/slots/ChoroplethLayerTooltip.js.map +7 -0
- package/esm/map/slots/ConnectionLayer.js +16 -0
- package/esm/map/slots/ConnectionLayer.js.map +7 -0
- package/esm/map/slots/ConnectionLayerTooltip.js +16 -0
- package/esm/map/slots/ConnectionLayerTooltip.js.map +7 -0
- package/esm/map/slots/DotLayer.js +16 -0
- package/esm/map/slots/DotLayer.js.map +7 -0
- package/esm/map/slots/DotLayerTooltip.js +16 -0
- package/esm/map/slots/DotLayerTooltip.js.map +7 -0
- package/esm/map/slots/SequentialLegend.js +16 -0
- package/esm/map/slots/SequentialLegend.js.map +7 -0
- package/esm/map/slots/ThresholdLegend.js +16 -0
- package/esm/map/slots/ThresholdLegend.js.map +7 -0
- package/esm/map/slots/Tooltip.js +16 -0
- package/esm/map/slots/Tooltip.js.map +7 -0
- package/esm/map/slots/Zoom.js +16 -0
- package/esm/map/slots/Zoom.js.map +7 -0
- package/esm/map/slots/ZoomToFit.js +16 -0
- package/esm/map/slots/ZoomToFit.js.map +7 -0
- package/esm/map/slots/states/DisabledState.js +16 -0
- package/esm/map/slots/states/DisabledState.js.map +7 -0
- package/esm/map/slots/states/ErrorStateSlot.js +16 -0
- package/esm/map/slots/states/ErrorStateSlot.js.map +7 -0
- package/esm/map/sources/CN.js +16 -0
- package/esm/map/sources/CN.js.map +7 -0
- package/esm/map/sources/IL.js +16 -0
- package/esm/map/sources/IL.js.map +7 -0
- package/esm/map/sources/IN.js +16 -0
- package/esm/map/sources/IN.js.map +7 -0
- package/esm/map/sources/countries.js +16 -0
- package/esm/map/sources/countries.js.map +7 -0
- package/esm/map/store/map-store.context.js +16 -0
- package/esm/map/store/map-store.context.js.map +7 -0
- package/esm/map/store/map-store.provider.js +16 -0
- package/esm/map/store/map-store.provider.js.map +7 -0
- package/esm/map/store/selectors.js +16 -0
- package/esm/map/store/selectors.js.map +7 -0
- package/esm/map/store/store.js +16 -0
- package/esm/map/store/store.js.map +7 -0
- package/esm/map/styles/react-mapgl-styles.css +671 -0
- package/esm/map/types/bubble-layer.js +16 -0
- package/esm/map/types/bubble-layer.js.map +7 -0
- package/esm/map/types/choropleth-layer.js +16 -0
- package/esm/map/types/choropleth-layer.js.map +7 -0
- package/esm/map/types/coloring.js +16 -0
- package/esm/map/types/coloring.js.map +7 -0
- package/esm/map/types/configuration.js +16 -0
- package/esm/map/types/configuration.js.map +7 -0
- package/esm/map/types/connection-layer.js +16 -0
- package/esm/map/types/connection-layer.js.map +7 -0
- package/esm/map/types/dot-layer.js +16 -0
- package/esm/map/types/dot-layer.js.map +7 -0
- package/esm/map/types/legend.js +16 -0
- package/esm/map/types/legend.js.map +7 -0
- package/esm/map/types/location.js +16 -0
- package/esm/map/types/location.js.map +7 -0
- package/esm/map/types/map-view.js +16 -0
- package/esm/map/types/map-view.js.map +7 -0
- package/esm/map/types/shapes.js +16 -0
- package/esm/map/types/shapes.js.map +7 -0
- package/esm/map/types/state.js +16 -0
- package/esm/map/types/state.js.map +7 -0
- package/esm/map/types/toolbar.js +16 -0
- package/esm/map/types/toolbar.js.map +7 -0
- package/esm/map/types/tooltip.js +16 -0
- package/esm/map/types/tooltip.js.map +7 -0
- package/index.d.ts +37 -0
- package/index.js +15 -0
- package/map/MapView.d.ts +25 -0
- package/map/MapView.js +15 -0
- package/map/components/BubbleLayer/BubbleCircleLayer.d.ts +20 -0
- package/map/components/BubbleLayer/BubbleCircleLayer.js +15 -0
- package/map/components/BubbleLayer/BubbleLayer.d.ts +22 -0
- package/map/components/BubbleLayer/BubbleLayer.js +15 -0
- package/map/components/BubbleLayer/BubbleLayerTooltip.d.ts +26 -0
- package/map/components/BubbleLayer/BubbleLayerTooltip.js +15 -0
- package/map/components/BubbleLayer/BubbleOutlineLayer.d.ts +5 -0
- package/map/components/BubbleLayer/BubbleOutlineLayer.js +15 -0
- package/map/components/BubbleLayer/contexts/size-interpolation.context.d.ts +2 -0
- package/map/components/BubbleLayer/contexts/size-interpolation.context.js +15 -0
- package/map/components/BubbleLayer/functions/add-outline-size.d.ts +21 -0
- package/map/components/BubbleLayer/functions/add-outline-size.js +15 -0
- package/map/components/BubbleLayer/functions/build-radius-scale.d.ts +18 -0
- package/map/components/BubbleLayer/functions/build-radius-scale.js +15 -0
- package/map/components/BubbleLayer/functions/build-stick-to-distance-expressions.d.ts +28 -0
- package/map/components/BubbleLayer/functions/build-stick-to-distance-expressions.js +15 -0
- package/map/components/BubbleLayer/functions/parse-bubble-data-to-geo-json.d.ts +35 -0
- package/map/components/BubbleLayer/functions/parse-bubble-data-to-geo-json.js +15 -0
- package/map/components/BubbleLayer/hooks/use-size-interpolation.d.ts +1 -0
- package/map/components/BubbleLayer/hooks/use-size-interpolation.js +15 -0
- package/map/components/ChoroplethLayer.d.ts +21 -0
- package/map/components/ChoroplethLayer.js +15 -0
- package/map/components/ChoroplethLayerTooltip.d.ts +25 -0
- package/map/components/ChoroplethLayerTooltip.js +15 -0
- package/map/components/ConnectionLayer/ConnectionLayer.d.ts +22 -0
- package/map/components/ConnectionLayer/ConnectionLayer.js +15 -0
- package/map/components/ConnectionLayer/ConnectionLayerDirection.d.ts +26 -0
- package/map/components/ConnectionLayer/ConnectionLayerDirection.js +15 -0
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.d.ts +26 -0
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.js +15 -0
- package/map/components/ConnectionLayer/functions/get-arc-line-features.d.ts +18 -0
- package/map/components/ConnectionLayer/functions/get-arc-line-features.js +15 -0
- package/map/components/ConnectionLayer/functions/get-arrows-angles.d.ts +4 -0
- package/map/components/ConnectionLayer/functions/get-arrows-angles.js +15 -0
- package/map/components/ConnectionLayer/functions/get-straight-line-features.d.ts +18 -0
- package/map/components/ConnectionLayer/functions/get-straight-line-features.js +15 -0
- package/map/components/ConnectionLayer/functions/parse-connection-data-to-geo-json.d.ts +18 -0
- package/map/components/ConnectionLayer/functions/parse-connection-data-to-geo-json.js +15 -0
- package/map/components/ConnectionLayer/functions/parse-direction-data-to-geo-json.d.ts +7 -0
- package/map/components/ConnectionLayer/functions/parse-direction-data-to-geo-json.js +15 -0
- package/map/components/DefaultTooltip.d.ts +26 -0
- package/map/components/DefaultTooltip.js +15 -0
- package/map/components/DotLayer/BackgroundLayer.d.ts +25 -0
- package/map/components/DotLayer/BackgroundLayer.js +15 -0
- package/map/components/DotLayer/DotLayer.d.ts +25 -0
- package/map/components/DotLayer/DotLayer.js +15 -0
- package/map/components/DotLayer/DotLayerTooltip.d.ts +26 -0
- package/map/components/DotLayer/DotLayerTooltip.js +15 -0
- package/map/components/DotLayer/functions/calculate-circle-translate.d.ts +16 -0
- package/map/components/DotLayer/functions/calculate-circle-translate.js +15 -0
- package/map/components/DotLayer/functions/resolve-icon-background.d.ts +19 -0
- package/map/components/DotLayer/functions/resolve-icon-background.js +15 -0
- package/map/components/MapContent.d.ts +18 -0
- package/map/components/MapContent.js +15 -0
- package/map/components/legend/CategoricalLegendRenderer.d.ts +2 -0
- package/map/components/legend/CategoricalLegendRenderer.js +15 -0
- package/map/components/legend/MapLegendRenderer.d.ts +17 -0
- package/map/components/legend/MapLegendRenderer.js +15 -0
- package/map/components/legend/SequentialLegendRenderer.d.ts +17 -0
- package/map/components/legend/SequentialLegendRenderer.js +15 -0
- package/map/components/legend/ThresholdLegendRenderer.d.ts +17 -0
- package/map/components/legend/ThresholdLegendRenderer.js +15 -0
- package/map/components/legend/functions/resolve-color.d.ts +23 -0
- package/map/components/legend/functions/resolve-color.js +15 -0
- package/map/components/toolbar/MapToolbar.d.ts +20 -0
- package/map/components/toolbar/MapToolbar.js +15 -0
- package/map/components/toolbar/buttons/MapDownloadDataButton.d.ts +17 -0
- package/map/components/toolbar/buttons/MapDownloadDataButton.js +15 -0
- package/map/components/toolbar/buttons/MapResetButton.d.ts +17 -0
- package/map/components/toolbar/buttons/MapResetButton.js +15 -0
- package/map/components/toolbar/buttons/MapZoomInOutButtons.d.ts +17 -0
- package/map/components/toolbar/buttons/MapZoomInOutButtons.js +15 -0
- package/map/components/toolbar/buttons/MapZoomToFitButton.d.ts +20 -0
- package/map/components/toolbar/buttons/MapZoomToFitButton.js +15 -0
- package/map/components/toolbar/constants.d.ts +19 -0
- package/map/components/toolbar/constants.js +15 -0
- package/map/constants.d.ts +73 -0
- package/map/constants.js +15 -0
- package/map/contexts/a11y-toolbar-tab-index.context.d.ts +18 -0
- package/map/contexts/a11y-toolbar-tab-index.context.js +15 -0
- package/map/contexts/color-scale.context.d.ts +19 -0
- package/map/contexts/color-scale.context.js +15 -0
- package/map/contexts/layer-coloring-strategy.context.d.ts +2 -0
- package/map/contexts/layer-coloring-strategy.context.js +15 -0
- package/map/contexts/layer-ids.context.d.ts +17 -0
- package/map/contexts/layer-ids.context.js +15 -0
- package/map/contexts/map-configuration.context.d.ts +18 -0
- package/map/contexts/map-configuration.context.js +15 -0
- package/map/contexts/map-country-code.context.d.ts +17 -0
- package/map/contexts/map-country-code.context.js +15 -0
- package/map/contexts/map-data-bounding-box.context.d.ts +17 -0
- package/map/contexts/map-data-bounding-box.context.js +15 -0
- package/map/contexts/map-initial-view.context.d.ts +18 -0
- package/map/contexts/map-initial-view.context.js +15 -0
- package/map/contexts/map-raw-data.context.d.ts +17 -0
- package/map/contexts/map-raw-data.context.js +15 -0
- package/map/functions/__test__/fixtures/business-locations.d.ts +31 -0
- package/map/functions/__test__/fixtures/business-locations.js +15 -0
- package/map/functions/__test__/fixtures/connection-layer.d.ts +28 -0
- package/map/functions/__test__/fixtures/connection-layer.js +15 -0
- package/map/functions/__test__/fixtures/countries-stats.d.ts +31 -0
- package/map/functions/__test__/fixtures/countries-stats.js +15 -0
- package/map/functions/__test__/fixtures/csv-download-cases.d.ts +59 -0
- package/map/functions/__test__/fixtures/csv-download-cases.js +15 -0
- package/map/functions/__test__/fixtures/events-locations.d.ts +31 -0
- package/map/functions/__test__/fixtures/events-locations.js +15 -0
- package/map/functions/__test__/fixtures/facilities-locations.d.ts +40 -0
- package/map/functions/__test__/fixtures/facilities-locations.js +15 -0
- package/map/functions/__test__/fixtures/flight-connections.d.ts +26 -0
- package/map/functions/__test__/fixtures/flight-connections.js +15 -0
- package/map/functions/a11y-toolbar-controls.d.ts +22 -0
- package/map/functions/a11y-toolbar-controls.js +15 -0
- package/map/functions/attach-image-from-shape.d.ts +18 -0
- package/map/functions/attach-image-from-shape.js +15 -0
- package/map/functions/attach-image-from-string.d.ts +18 -0
- package/map/functions/attach-image-from-string.js +15 -0
- package/map/functions/attach-image-from-text.d.ts +17 -0
- package/map/functions/attach-image-from-text.js +15 -0
- package/map/functions/attach-image-to-map.d.ts +17 -0
- package/map/functions/attach-image-to-map.js +15 -0
- package/map/functions/build-and-download-csv.d.ts +6 -0
- package/map/functions/build-and-download-csv.js +15 -0
- package/map/functions/build-categorical-scale.d.ts +2 -0
- package/map/functions/build-categorical-scale.js +15 -0
- package/map/functions/build-scale-from-legend-config.d.ts +23 -0
- package/map/functions/build-scale-from-legend-config.js +15 -0
- package/map/functions/calculate-hovered-color.d.ts +1 -0
- package/map/functions/calculate-hovered-color.js +15 -0
- package/map/functions/create-bitmap-config-options.d.ts +16 -0
- package/map/functions/create-bitmap-config-options.js +15 -0
- package/map/functions/define-bearing.d.ts +17 -0
- package/map/functions/define-bearing.js +15 -0
- package/map/functions/define-color.d.ts +16 -0
- package/map/functions/define-color.js +15 -0
- package/map/functions/define-radius.d.ts +17 -0
- package/map/functions/define-radius.js +15 -0
- package/map/functions/extract-layers-data.d.ts +7 -0
- package/map/functions/extract-layers-data.js +15 -0
- package/map/functions/get-client-settings.d.ts +16 -0
- package/map/functions/get-client-settings.js +15 -0
- package/map/functions/get-color-from-token.d.ts +1 -0
- package/map/functions/get-color-from-token.js +15 -0
- package/map/functions/get-countries-geo-code.d.ts +16 -0
- package/map/functions/get-countries-geo-code.js +15 -0
- package/map/functions/get-data-layers-bounding-box.d.ts +17 -0
- package/map/functions/get-data-layers-bounding-box.js +15 -0
- package/map/functions/get-data-uri.d.ts +16 -0
- package/map/functions/get-data-uri.js +15 -0
- package/map/functions/get-map-states-template.d.ts +19 -0
- package/map/functions/get-map-states-template.js +15 -0
- package/map/functions/get-scaled-symbol-size.d.ts +17 -0
- package/map/functions/get-scaled-symbol-size.js +15 -0
- package/map/functions/get-tenant-country-code.d.ts +16 -0
- package/map/functions/get-tenant-country-code.js +15 -0
- package/map/functions/is-valid-shape.d.ts +18 -0
- package/map/functions/is-valid-shape.js +15 -0
- package/map/functions/iterate-config-slots.d.ts +23 -0
- package/map/functions/iterate-config-slots.js +15 -0
- package/map/functions/parse-dot-data-to-geo-json.d.ts +31 -0
- package/map/functions/parse-dot-data-to-geo-json.js +15 -0
- package/map/functions/parse-region-data-to-geo-json.d.ts +17 -0
- package/map/functions/parse-region-data-to-geo-json.js +15 -0
- package/map/functions/safe-reactdom-render.d.ts +22 -0
- package/map/functions/safe-reactdom-render.js +15 -0
- package/map/functions/set-layers-id.d.ts +25 -0
- package/map/functions/set-layers-id.js +15 -0
- package/map/functions/tabularize-layers-data.d.ts +27 -0
- package/map/functions/tabularize-layers-data.js +17 -0
- package/map/functions/to-mapbox-initial-view-state.d.ts +1 -0
- package/map/functions/to-mapbox-initial-view-state.js +15 -0
- package/map/functions/tooltip-type-guards.d.ts +32 -0
- package/map/functions/tooltip-type-guards.js +15 -0
- package/map/hooks/use-a11y-toolbar-tab-index.d.ts +22 -0
- package/map/hooks/use-a11y-toolbar-tab-index.js +15 -0
- package/map/hooks/use-active-interaction.d.ts +1 -0
- package/map/hooks/use-active-interaction.js +15 -0
- package/map/hooks/use-attach-image-from-icon.d.ts +18 -0
- package/map/hooks/use-attach-image-from-icon.js +15 -0
- package/map/hooks/use-attach-symbol-to-map.d.ts +18 -0
- package/map/hooks/use-attach-symbol-to-map.js +15 -0
- package/map/hooks/use-color-scale.d.ts +17 -0
- package/map/hooks/use-color-scale.js +15 -0
- package/map/hooks/use-connection-direction-interaction-highlighting.d.ts +1 -0
- package/map/hooks/use-connection-direction-interaction-highlighting.js +15 -0
- package/map/hooks/use-connection-interaction-highlighting.d.ts +1 -0
- package/map/hooks/use-connection-interaction-highlighting.js +15 -0
- package/map/hooks/use-data-bounding-box.d.ts +1 -0
- package/map/hooks/use-data-bounding-box.js +15 -0
- package/map/hooks/use-hover-interaction.d.ts +1 -0
- package/map/hooks/use-hover-interaction.js +15 -0
- package/map/hooks/use-initial-view-context.d.ts +1 -0
- package/map/hooks/use-initial-view-context.js +15 -0
- package/map/hooks/use-initial-view-state.d.ts +2 -0
- package/map/hooks/use-initial-view-state.js +15 -0
- package/map/hooks/use-layer-coloring-strategy.d.ts +1 -0
- package/map/hooks/use-layer-coloring-strategy.js +15 -0
- package/map/hooks/use-legend-interaction-highlighting.d.ts +5 -0
- package/map/hooks/use-legend-interaction-highlighting.js +15 -0
- package/map/hooks/use-legend-interaction-visibility.d.ts +5 -0
- package/map/hooks/use-legend-interaction-visibility.js +15 -0
- package/map/hooks/use-load-symbol-into-map.d.ts +21 -0
- package/map/hooks/use-load-symbol-into-map.js +15 -0
- package/map/hooks/use-map-config.d.ts +1 -0
- package/map/hooks/use-map-config.js +15 -0
- package/map/hooks/use-map-country-code.d.ts +1 -0
- package/map/hooks/use-map-country-code.js +15 -0
- package/map/hooks/use-map-raw-data.d.ts +1 -0
- package/map/hooks/use-map-raw-data.js +15 -0
- package/map/hooks/use-map-settings.d.ts +5 -0
- package/map/hooks/use-map-settings.js +15 -0
- package/map/hooks/use-map-source.d.ts +1 -0
- package/map/hooks/use-map-source.js +15 -0
- package/map/hooks/use-overlay-events.d.ts +24 -0
- package/map/hooks/use-overlay-events.js +15 -0
- package/map/hooks/use-resolve-color.d.ts +16 -0
- package/map/hooks/use-resolve-color.js +15 -0
- package/map/hooks/use-safe-svg-parser.d.ts +23 -0
- package/map/hooks/use-safe-svg-parser.js +15 -0
- package/map/hooks/use-tooltip-event-listeners.d.ts +16 -0
- package/map/hooks/use-tooltip-event-listeners.js +15 -0
- package/map/hooks/use-tooltip-template.d.ts +11 -0
- package/map/hooks/use-tooltip-template.js +15 -0
- package/map/hooks/useDefaultTooltipActions.d.ts +18 -0
- package/map/hooks/useDefaultTooltipActions.js +15 -0
- package/map/map-styles/default-style.d.ts +17 -0
- package/map/map-styles/default-style.js +15 -0
- package/map/providers/color-scale.provider.d.ts +15 -0
- package/map/providers/color-scale.provider.js +15 -0
- package/map/providers/layer-color-strategy.provider.d.ts +30 -0
- package/map/providers/layer-color-strategy.provider.js +15 -0
- package/map/providers/map-initial-view.provider.d.ts +28 -0
- package/map/providers/map-initial-view.provider.js +15 -0
- package/map/shapes/circle.d.ts +16 -0
- package/map/shapes/circle.js +32 -0
- package/map/shapes/cross.d.ts +16 -0
- package/map/shapes/cross.js +27 -0
- package/map/shapes/diamond.d.ts +16 -0
- package/map/shapes/diamond.js +20 -0
- package/map/shapes/heart.d.ts +16 -0
- package/map/shapes/heart.js +27 -0
- package/map/shapes/pin.d.ts +16 -0
- package/map/shapes/pin.js +21 -0
- package/map/shapes/shape-picker.d.ts +2 -0
- package/map/shapes/shape-picker.js +15 -0
- package/map/shapes/square.d.ts +16 -0
- package/map/shapes/square.js +18 -0
- package/map/shapes/star.d.ts +16 -0
- package/map/shapes/star.js +32 -0
- package/map/shapes/triangle.d.ts +16 -0
- package/map/shapes/triangle.js +27 -0
- package/map/slots/BubbleLayer.d.ts +31 -0
- package/map/slots/BubbleLayer.js +15 -0
- package/map/slots/BubbleLayerTooltip.d.ts +22 -0
- package/map/slots/BubbleLayerTooltip.js +15 -0
- package/map/slots/CategoricalLegend.d.ts +21 -0
- package/map/slots/CategoricalLegend.js +15 -0
- package/map/slots/ChartInteractions.d.ts +31 -0
- package/map/slots/ChartInteractions.js +15 -0
- package/map/slots/ChoroplethLayer.d.ts +31 -0
- package/map/slots/ChoroplethLayer.js +15 -0
- package/map/slots/ChoroplethLayerTooltip.d.ts +20 -0
- package/map/slots/ChoroplethLayerTooltip.js +15 -0
- package/map/slots/ConnectionLayer.d.ts +32 -0
- package/map/slots/ConnectionLayer.js +15 -0
- package/map/slots/ConnectionLayerTooltip.d.ts +21 -0
- package/map/slots/ConnectionLayerTooltip.js +15 -0
- package/map/slots/DotLayer.d.ts +33 -0
- package/map/slots/DotLayer.js +15 -0
- package/map/slots/DotLayerTooltip.d.ts +22 -0
- package/map/slots/DotLayerTooltip.js +15 -0
- package/map/slots/SequentialLegend.d.ts +21 -0
- package/map/slots/SequentialLegend.js +15 -0
- package/map/slots/ThresholdLegend.d.ts +21 -0
- package/map/slots/ThresholdLegend.js +15 -0
- package/map/slots/Tooltip.d.ts +29 -0
- package/map/slots/Tooltip.js +15 -0
- package/map/slots/Zoom.d.ts +22 -0
- package/map/slots/Zoom.js +15 -0
- package/map/slots/ZoomToFit.d.ts +22 -0
- package/map/slots/ZoomToFit.js +15 -0
- package/map/slots/states/DisabledState.d.ts +29 -0
- package/map/slots/states/DisabledState.js +15 -0
- package/map/slots/states/ErrorStateSlot.d.ts +20 -0
- package/map/slots/states/ErrorStateSlot.js +15 -0
- package/map/sources/CN.d.ts +16 -0
- package/map/sources/CN.js +15 -0
- package/map/sources/IL.d.ts +16 -0
- package/map/sources/IL.js +15 -0
- package/map/sources/IN.d.ts +16 -0
- package/map/sources/IN.js +15 -0
- package/map/sources/countries.d.ts +41 -0
- package/map/sources/countries.js +15 -0
- package/map/store/map-store.context.d.ts +20 -0
- package/map/store/map-store.context.js +15 -0
- package/map/store/map-store.provider.d.ts +17 -0
- package/map/store/map-store.provider.js +15 -0
- package/map/store/selectors.d.ts +30 -0
- package/map/store/selectors.js +15 -0
- package/map/store/store.d.ts +7 -0
- package/map/store/store.js +15 -0
- package/map/styles/react-mapgl-styles.css +671 -0
- package/map/types/bubble-layer.d.ts +85 -0
- package/map/types/bubble-layer.js +15 -0
- package/map/types/choropleth-layer.d.ts +40 -0
- package/map/types/choropleth-layer.js +15 -0
- package/map/types/coloring.d.ts +46 -0
- package/map/types/coloring.js +15 -0
- package/map/types/configuration.d.ts +25 -0
- package/map/types/configuration.js +15 -0
- package/map/types/connection-layer.d.ts +77 -0
- package/map/types/connection-layer.js +15 -0
- package/map/types/dot-layer.d.ts +62 -0
- package/map/types/dot-layer.js +15 -0
- package/map/types/legend.d.ts +85 -0
- package/map/types/legend.js +15 -0
- package/map/types/location.d.ts +22 -0
- package/map/types/location.js +15 -0
- package/map/types/map-view.d.ts +97 -0
- package/map/types/map-view.js +15 -0
- package/map/types/shapes.d.ts +18 -0
- package/map/types/shapes.js +15 -0
- package/map/types/state.d.ts +39 -0
- package/map/types/state.js +15 -0
- package/map/types/toolbar.d.ts +47 -0
- package/map/types/toolbar.js +15 -0
- package/map/types/tooltip.d.ts +77 -0
- package/map/types/tooltip.js +15 -0
- package/package.json +59 -0
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{isUndefined as o}from"lodash-es";import{useDataBoundingBox as n}from"./use-data-bounding-box.js";const m=t=>{const e=n();return o(t)?e:t};export{m as useInitialViewState};
|
|
16
|
+
//# sourceMappingURL=use-initial-view-state.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-initial-view-state.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { 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"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,eAAAA,MAAmB,YAE5B,OAAS,sBAAAC,MAA0B,6BAG5B,MAAMC,EACXC,GACG,CACH,MAAMC,EAAWH,EAAmB,EACpC,OAAOD,EAAYG,CAAgB,EAAIC,EAAWD,CACpD",
|
|
6
|
+
"names": ["isUndefined", "useDataBoundingBox", "useInitialViewState", "initialViewState", "dataBBox"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{useContext as o}from"react";import{LayerColoringStrategyContext as t}from"../contexts/layer-coloring-strategy.context.js";const n=()=>o(t);export{n as useLayerColoringStrategy};
|
|
16
|
+
//# sourceMappingURL=use-layer-coloring-strategy.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-layer-coloring-strategy.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext } from 'react';\n\nimport { LayerColoringStrategyContext } from '../contexts/layer-coloring-strategy.context.js';\n\nexport const useLayerColoringStrategy = () =>\n useContext(LayerColoringStrategyContext);\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,cAAAA,MAAkB,QAE3B,OAAS,gCAAAC,MAAoC,iDAEtC,MAAMC,EAA2B,IACtCF,EAAWC,CAA4B",
|
|
6
|
+
"names": ["useContext", "LayerColoringStrategyContext", "useLayerColoringStrategy"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{isUndefined as s}from"lodash-es";import{useMap as a}from"react-map-gl/maplibre";import{useMapSelectionState as m}from"../store/selectors.js";import{isLegendColoring as p}from"../types/coloring.js";const F=(i,r)=>{const{highlightedSeries:n}=m(),{current:e}=a();if(p(i)&&!s(e)&&(e.querySourceFeatures(r,{filter:["all"]})?.map(o=>e.setFeatureState({source:r,id:o.id},{legendHover:!0})),n)){const o=n.map(t=>t.name);e.querySourceFeatures(r,{filter:["!in",i.valueAccessor,...o]})?.map(t=>e.setFeatureState({source:r,id:t.id},{legendHover:!1}))}};export{F as useLegendInteractionHighlighting};
|
|
16
|
+
//# sourceMappingURL=use-legend-interaction-highlighting.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-legend-interaction-highlighting.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { 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"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,eAAAA,MAAmB,YAC5B,OAAS,UAAAC,MAAc,wBAEvB,OAAS,wBAAAC,MAA4B,wBAGrC,OAAS,oBAAAC,MAAwB,uBAI1B,MAAMC,EAAmC,CAI9CC,EACAC,IACG,CACH,KAAM,CAAE,kBAAAC,CAAkB,EAAIL,EAAqB,EAC7C,CAAE,QAASM,CAAI,EAAIP,EAAO,EAEhC,GAAIE,EAAiBE,CAAK,GAAK,CAACL,EAAYQ,CAAG,IAErBA,EAAI,oBAAoBF,EAAU,CACxD,OAAQ,CAAC,KAAK,CAChB,CAAC,GACgB,IAAKG,GACpBD,EAAI,gBACF,CAAE,OAAQF,EAAU,GAAIG,EAAG,EAAG,EAC9B,CAAE,YAAa,EAAK,CACtB,CACF,EAEIF,GAAmB,CACrB,MAAMG,EAAyBH,EAAkB,IAAKI,GAAMA,EAAE,IAAI,EAC1CH,EAAI,oBAAoBF,EAAU,CACxD,OAAQ,CAAC,MAAOD,EAAM,cAAe,GAAGK,CAAsB,CAChE,CAAC,GACgB,IAAKD,GACpBD,EAAI,gBACF,CAAE,OAAQF,EAAU,GAAIG,EAAG,EAAG,EAC9B,CAAE,YAAa,EAAM,CACvB,CACF,CACF,CAEJ",
|
|
6
|
+
"names": ["isUndefined", "useMap", "useMapSelectionState", "isLegendColoring", "useLegendInteractionHighlighting", "props", "sourceId", "highlightedSeries", "map", "ft", "highlightedSeriesNames", "s"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{isUndefined as r}from"lodash-es";import{useMap as p}from"react-map-gl/maplibre";import{useMapSelectionState as m}from"../store/selectors.js";import{isLegendColoring as c}from"../types/coloring.js";const v=(s,o)=>{const{visible:i}=m(),{current:e}=p();if(c(s)&&!r(e))if(r(i)){const t=e.getLayer(o);r(t)||e.getMap().setFilter(o,null)}else{const t=e.getMap(),n=i.map(({name:a})=>a);t.setFilter(o,["in",s.valueAccessor,...n])}};export{v as useLegendInteractionVisibility};
|
|
16
|
+
//# sourceMappingURL=use-legend-interaction-visibility.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-legend-interaction-visibility.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { 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"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,eAAAA,MAAmB,YAC5B,OAAS,UAAAC,MAAc,wBAEvB,OAAS,wBAAAC,MAA4B,wBAGrC,OAAS,oBAAAC,MAAwB,uBAI1B,MAAMC,EAAiC,CAI5CC,EACAC,IACG,CACH,KAAM,CAAE,QAAAC,CAAQ,EAAIL,EAAqB,EACnC,CAAE,QAASM,CAAI,EAAIP,EAAO,EAEhC,GAAIE,EAAiBE,CAAK,GAAK,CAACL,EAAYQ,CAAG,EAC7C,GAAKR,EAAYO,CAAO,EAQjB,CACL,MAAME,EAAQD,EAAI,SAASF,CAAO,EAC7BN,EAAYS,CAAK,GACAD,EAAI,OAAO,EACnB,UAAUF,EAAS,IAAI,CAEvC,KAd2B,CACzB,MAAMI,EAAcF,EAAI,OAAO,EACzBG,EAAyBJ,EAAQ,IAAI,CAAC,CAAE,KAAAK,CAAK,IAAMA,CAAI,EAC7DF,EAAY,UAAUJ,EAAS,CAC7B,KACAD,EAAM,cACN,GAAGM,CACL,CAAC,CACH,CAQJ",
|
|
6
|
+
"names": ["isUndefined", "useMap", "useMapSelectionState", "isLegendColoring", "useLegendInteractionVisibility", "props", "layerId", "visible", "map", "layer", "mapInstance", "visibleCategoriesNames", "name"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{isString as t}from"lodash-es";import{useAttachSymbolToMap as p}from"./use-attach-symbol-to-map.js";import{isValidShape as r}from"../functions/is-valid-shape.js";const s=e=>t(e)?r(e)?"shape":"emoji":"icon",a=e=>t(e)?r(e)?e:"emoji":"custom-icon",N=(e,o,m)=>{const i=s(e),n=a(e);return p(e,o,m),{symbolType:i,symbolName:`${n}-${o}`}};export{N as useLoadSymbolIntoMap};
|
|
16
|
+
//# sourceMappingURL=use-load-symbol-into-map.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-load-symbol-into-map.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { 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"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAgBA,OAAS,YAAAA,MAAgB,YAGzB,OAAS,wBAAAC,MAA4B,gCACrC,OAAS,gBAAAC,MAAoB,iCAG7B,MAAMC,EAAiBC,GAChBJ,EAASI,CAAK,EAERF,EAAaE,CAAK,EACpB,QAEA,QAJA,OAOLC,EAAiBD,GAChBJ,EAASI,CAAK,EAERF,EAAaE,CAAK,EACpBA,EAEA,QAJA,cAOEE,EAAuB,CAClCF,EACAG,EACAC,IACG,CACH,MAAMC,EAAaN,EAAcC,CAAK,EAChCM,EAAaL,EAAcD,CAAK,EACtC,OAAAH,EAAqBG,EAAOG,EAASC,CAAU,EAExC,CACL,WAAAC,EACA,WAAY,GAAGC,CAAU,IAAIH,CAAO,EACtC,CACF",
|
|
6
|
+
"names": ["isString", "useAttachSymbolToMap", "isValidShape", "getSymbolType", "shape", "getSymbolName", "useLoadSymbolIntoMap", "layerId", "outputSize", "symbolType", "symbolName"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{useContext as o}from"react";import{MapConfigurationContext as t}from"../contexts/map-configuration.context.js";const e=()=>o(t);export{e as useMapConfig};
|
|
16
|
+
//# sourceMappingURL=use-map-config.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-map-config.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext } from 'react';\n\nimport { MapConfigurationContext } from '../contexts/map-configuration.context.js';\n\nexport const useMapConfig = () => useContext(MapConfigurationContext);\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,cAAAA,MAAkB,QAE3B,OAAS,2BAAAC,MAA+B,2CAEjC,MAAMC,EAAe,IAAMF,EAAWC,CAAuB",
|
|
6
|
+
"names": ["useContext", "MapConfigurationContext", "useMapConfig"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{useContext as o}from"react";import{MapCountryCodeContext as t}from"../contexts/map-country-code.context.js";const C=()=>o(t);export{C as useMapCountryCode};
|
|
16
|
+
//# sourceMappingURL=use-map-country-code.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-map-country-code.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext } from 'react';\n\nimport { MapCountryCodeContext } from '../contexts/map-country-code.context.js';\n\nexport const useMapCountryCode = () => useContext(MapCountryCodeContext);\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,cAAAA,MAAkB,QAE3B,OAAS,yBAAAC,MAA6B,0CAE/B,MAAMC,EAAoB,IAAMF,EAAWC,CAAqB",
|
|
6
|
+
"names": ["useContext", "MapCountryCodeContext", "useMapCountryCode"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{useContext as t}from"react";import{MapRawDataContext as a}from"../contexts/map-raw-data.context.js";const p=()=>t(a);export{p as useMapRawData};
|
|
16
|
+
//# sourceMappingURL=use-map-raw-data.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-map-raw-data.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext } from 'react';\n\nimport { MapRawDataContext } from '../contexts/map-raw-data.context.js';\n\nexport const useMapRawData = () => useContext(MapRawDataContext);\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,cAAAA,MAAkB,QAE3B,OAAS,qBAAAC,MAAyB,sCAE3B,MAAMC,EAAgB,IAAMF,EAAWC,CAAiB",
|
|
6
|
+
"names": ["useContext", "MapRawDataContext", "useMapRawData"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{useEffect as f,useState as t}from"react";import{DEFAULT_COUNTRY_CODE as m}from"../constants.js";import{getClientSettings as u}from"../functions/get-client-settings.js";import{getTenantCountryCode as p}from"../functions/get-tenant-country-code.js";const E=()=>{const[o,e]=t(!0),[n,s]=t(!1),[r,a]=t(m);return f(()=>{e(!0),Promise.all([u(),p()]).then(([i,l])=>{s(i),a(l)}).finally(()=>e(!1))},[]),{isLoading:o,isMapEnabled:n,countryCode:r}};export{E as useMapSettings};
|
|
16
|
+
//# sourceMappingURL=use-map-settings.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-map-settings.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useEffect, useState } from 'react';\n\nimport { DEFAULT_COUNTRY_CODE } from '../constants.js';\nimport { getClientSettings } from '../functions/get-client-settings.js';\nimport { getTenantCountryCode } from '../functions/get-tenant-country-code.js';\n\nexport const useMapSettings = () => {\n const [isLoading, setIsLoading] = useState(true);\n const [isMapEnabled, setIsMapEnabled] = useState(false);\n const [countryCode, setCountryCode] = useState(DEFAULT_COUNTRY_CODE);\n\n useEffect(() => {\n setIsLoading(true);\n Promise.all([getClientSettings(), getTenantCountryCode()])\n .then(\n ([isMapEnabledResponse, countryCodeResponse]: [boolean, string]) => {\n setIsMapEnabled(isMapEnabledResponse);\n setCountryCode(countryCodeResponse);\n },\n )\n .finally(() => setIsLoading(false));\n }, []);\n\n return { isLoading, isMapEnabled, countryCode };\n};\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,aAAAA,EAAW,YAAAC,MAAgB,QAEpC,OAAS,wBAAAC,MAA4B,kBACrC,OAAS,qBAAAC,MAAyB,sCAClC,OAAS,wBAAAC,MAA4B,0CAE9B,MAAMC,EAAiB,IAAM,CAClC,KAAM,CAACC,EAAWC,CAAY,EAAIN,EAAS,EAAI,EACzC,CAACO,EAAcC,CAAe,EAAIR,EAAS,EAAK,EAChD,CAACS,EAAaC,CAAc,EAAIV,EAASC,CAAoB,EAEnE,OAAAF,EAAU,IAAM,CACdO,EAAa,EAAI,EACjB,QAAQ,IAAI,CAACJ,EAAkB,EAAGC,EAAqB,CAAC,CAAC,EACtD,KACC,CAAC,CAACQ,EAAsBC,CAAmB,IAAyB,CAClEJ,EAAgBG,CAAoB,EACpCD,EAAeE,CAAmB,CACpC,CACF,EACC,QAAQ,IAAMN,EAAa,EAAK,CAAC,CACtC,EAAG,CAAC,CAAC,EAEE,CAAE,UAAAD,EAAW,aAAAE,EAAc,YAAAE,CAAY,CAChD",
|
|
6
|
+
"names": ["useEffect", "useState", "DEFAULT_COUNTRY_CODE", "getClientSettings", "getTenantCountryCode", "useMapSettings", "isLoading", "setIsLoading", "isMapEnabled", "setIsMapEnabled", "countryCode", "setCountryCode", "isMapEnabledResponse", "countryCodeResponse"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{useMapCountryCode as e}from"./use-map-country-code.js";import{getCountriesWithGeoCode as r}from"../functions/get-countries-geo-code.js";const n=()=>{const o=e();return r(o)};export{n as useMapSource};
|
|
16
|
+
//# sourceMappingURL=use-map-source.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-map-source.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useMapCountryCode } from './use-map-country-code.js';\nimport { getCountriesWithGeoCode } from '../functions/get-countries-geo-code.js';\n\nexport const useMapSource = () => {\n const countryCode = useMapCountryCode();\n\n return getCountriesWithGeoCode(countryCode);\n};\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,qBAAAA,MAAyB,4BAClC,OAAS,2BAAAC,MAA+B,yCAEjC,MAAMC,EAAe,IAAM,CAChC,MAAMC,EAAcH,EAAkB,EAEtC,OAAOC,EAAwBE,CAAW,CAC5C",
|
|
6
|
+
"names": ["useMapCountryCode", "getCountriesWithGeoCode", "useMapSource", "countryCode"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{useSetStateOverlay as p,useSetStateTooltip as c,useToggleStatePinnedTooltip as h}from"../store/store.js";const M=r=>Object.entries(r).reduce((o,[n,e])=>{if(typeof e=="string")try{return{...o,[n]:JSON.parse(e)}}catch{return{...o,[n]:e}}return{...o,[n]:e}},{}),L=()=>{const r=p(),o=c(),n=h(),e=()=>{o({visible:!1})};return{handleMouseEnter:()=>{r({mouseInBounds:!0})},handleMouseMove:t=>{if(t.features&&t.features.length){const{clientX:l,clientY:u}=t.originalEvent,d={x:l,y:u};o({visible:!0,hoveredLayerId:t.features[0].layer.id,data:t.features.reduce((a,s)=>s.layer.id!==t.features[0].layer.id?a:[...a,{...M(s.properties),...s.properties.path&&{path:JSON.parse(s.properties.path)},latitude:s.geometry.coordinates[0],longitude:s.geometry.coordinates[1]}],[]),position:d})}else e()},handleMouseLeave:()=>{r({mouseInBounds:!1})},handleMouseClick:t=>{t.originalEvent.stopPropagation(),n()},handleZoom:()=>{e()},handleDrag:()=>{e()}}};export{L as useOverlayEvents};
|
|
16
|
+
//# sourceMappingURL=use-overlay-events.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-overlay-events.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MapLayerMouseEvent } from 'maplibre-gl';\n\nimport {\n useSetStateOverlay,\n useSetStateTooltip,\n useToggleStatePinnedTooltip,\n} from '../store/store.js';\n\n/**\n * If dataset has a nested object, for instance\n * parentObj = { childObj: { someKey: someValue }};\n * library returns this nested object as JSON.\n * Hence, the JSON.parse is needed in order to use the\n * nested object properties\n *\n * @param featureProperties -\n */\nconst parseFeatureProperties = (featureProperties: Record<string, unknown>) => {\n return Object.entries(featureProperties).reduce((final, [key, value]) => {\n if (typeof value === 'string') {\n try {\n return { ...final, [key]: JSON.parse(value) };\n } catch (_) {\n return { ...final, [key]: value };\n }\n }\n return { ...final, [key]: value };\n }, {});\n};\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 setTooltipState({\n visible: true,\n hoveredLayerId: event.features[0].layer.id,\n data: event.features.reduce((final, curr) => {\n if (curr.layer.id !== event.features![0].layer.id) {\n return final;\n }\n\n return [\n ...final,\n {\n ...parseFeatureProperties(curr.properties),\n ...(curr.properties.path && {\n path: JSON.parse(curr.properties.path),\n }),\n latitude: (curr.geometry as GeoJSON.Point).coordinates[0],\n longitude: (curr.geometry as GeoJSON.Point).coordinates[1],\n },\n ];\n }, []),\n position,\n });\n } else {\n hideTooltip();\n }\n };\n\n const handleMouseLeave = () => {\n setOverlayState({\n mouseInBounds: false,\n });\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
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAiBA,OACE,sBAAAA,EACA,sBAAAC,EACA,+BAAAC,MACK,oBAWP,MAAMC,EAA0BC,GACvB,OAAO,QAAQA,CAAiB,EAAE,OAAO,CAACC,EAAO,CAACC,EAAKC,CAAK,IAAM,CACvE,GAAI,OAAOA,GAAU,SACnB,GAAI,CACF,MAAO,CAAE,GAAGF,EAAO,CAACC,CAAG,EAAG,KAAK,MAAMC,CAAK,CAAE,CAC9C,MAAY,CACV,MAAO,CAAE,GAAGF,EAAO,CAACC,CAAG,EAAGC,CAAM,CAClC,CAEF,MAAO,CAAE,GAAGF,EAAO,CAACC,CAAG,EAAGC,CAAM,CAClC,EAAG,CAAC,CAAC,EAGMC,EAAmB,IAAM,CACpC,MAAMC,EAAkBT,EAAmB,EACrCU,EAAkBT,EAAmB,EACrCU,EAA2BT,EAA4B,EAEvDU,EAAc,IAAM,CACxBF,EAAgB,CAAE,QAAS,EAAM,CAAC,CACpC,EA8DA,MAAO,CACL,iBA7DuB,IAAM,CAC7BD,EAAgB,CACd,cAAe,EACjB,CAAC,CACH,EA0DE,gBAxDuBI,GAA8B,CACrD,GAAIA,EAAM,UAAYA,EAAM,SAAS,OAAQ,CAC3C,KAAM,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAAIF,EAAM,cAE7BG,EAAW,CACf,EAAGF,EACH,EAAGC,CACL,EAEAL,EAAgB,CACd,QAAS,GACT,eAAgBG,EAAM,SAAS,CAAC,EAAE,MAAM,GACxC,KAAMA,EAAM,SAAS,OAAO,CAACR,EAAOY,IAC9BA,EAAK,MAAM,KAAOJ,EAAM,SAAU,CAAC,EAAE,MAAM,GACtCR,EAGF,CACL,GAAGA,EACH,CACE,GAAGF,EAAuBc,EAAK,UAAU,EACzC,GAAIA,EAAK,WAAW,MAAQ,CAC1B,KAAM,KAAK,MAAMA,EAAK,WAAW,IAAI,CACvC,EACA,SAAWA,EAAK,SAA2B,YAAY,CAAC,EACxD,UAAYA,EAAK,SAA2B,YAAY,CAAC,CAC3D,CACF,EACC,CAAC,CAAC,EACL,SAAAD,CACF,CAAC,CACH,MACEJ,EAAY,CAEhB,EAuBE,iBArBuB,IAAM,CAC7BH,EAAgB,CACd,cAAe,EACjB,CAAC,CACH,EAkBE,iBAhBwBI,GAA8B,CACtDA,EAAM,cAAc,gBAAgB,EACpCF,EAAyB,CAC3B,EAcE,WATiB,IAAM,CACvBC,EAAY,CACd,EAQE,WAbiB,IAAM,CACvBA,EAAY,CACd,CAYA,CACF",
|
|
6
|
+
"names": ["useSetStateOverlay", "useSetStateTooltip", "useToggleStatePinnedTooltip", "parseFeatureProperties", "featureProperties", "final", "key", "value", "useOverlayEvents", "setOverlayState", "setTooltipState", "toggleTooltipPinnedState", "hideTooltip", "event", "clientX", "clientY", "position", "curr"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{isUndefined as s}from"lodash-es";import{_accessValue as u}from"@dynatrace/strato-components-preview/core";import{useColorScale as m}from"./use-color-scale.js";import{isLegendColoring as l}from"../types/coloring.js";const L=(n,e,r)=>{const t=l(e),g=m();if(!t)return e.color??n;let i=n;return!s(g)&&r&&(i=c=>{const o=u(c,e.valueAccessor);return s(o)?n:r(o)??n}),i};export{L as useResolveColor};
|
|
16
|
+
//# sourceMappingURL=use-resolve-color.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-resolve-color.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isUndefined } from 'lodash-es';\n\nimport { _accessValue as accessValue } from '@dynatrace/strato-components-preview/core';\n\nimport { useColorScale } from './use-color-scale.js';\nimport { isLegendColoring } from '../types/coloring.js';\n\nexport const useResolveColor = (\n defaultColor: string,\n props,\n colorParser?: (value: string | number) => string | undefined,\n) => {\n const isLegendColor = isLegendColoring(props);\n\n const legendColoring = useColorScale();\n if (!isLegendColor) {\n return props.color ?? defaultColor;\n }\n\n let colorLegend: ((item: unknown) => string) | string = defaultColor;\n\n if (!isUndefined(legendColoring) && colorParser) {\n colorLegend = (item: Record<string, unknown>): string => {\n const value = accessValue<number | string>(item, props.valueAccessor);\n\n if (isUndefined(value)) {\n return defaultColor;\n }\n\n return colorParser(value) ?? defaultColor;\n };\n }\n\n return colorLegend;\n};\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAgBA,OAAS,eAAAA,MAAmB,YAE5B,OAAS,gBAAgBC,MAAmB,4CAE5C,OAAS,iBAAAC,MAAqB,uBAC9B,OAAS,oBAAAC,MAAwB,uBAE1B,MAAMC,EAAkB,CAC7BC,EACAC,EACAC,IACG,CACH,MAAMC,EAAgBL,EAAiBG,CAAK,EAEtCG,EAAiBP,EAAc,EACrC,GAAI,CAACM,EACH,OAAOF,EAAM,OAASD,EAGxB,IAAIK,EAAoDL,EAExD,MAAI,CAACL,EAAYS,CAAc,GAAKF,IAClCG,EAAeC,GAA0C,CACvD,MAAMC,EAAQX,EAA6BU,EAAML,EAAM,aAAa,EAEpE,OAAIN,EAAYY,CAAK,EACZP,EAGFE,EAAYK,CAAK,GAAKP,CAC/B,GAGKK,CACT",
|
|
6
|
+
"names": ["isUndefined", "accessValue", "useColorScale", "isLegendColoring", "useResolveColor", "defaultColor", "props", "colorParser", "isLegendColor", "legendColoring", "colorLegend", "item", "value"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{isUndefined as l}from"lodash-es";import{useCallback as a,useState as g}from"react";const u=()=>{const[n,r]=g(""),s=a(e=>{if(e===null)return;const t=e.getElementsByTagName("svg")[0];if(l(t))return;const i=new XMLSerializer().serializeToString(t),o=encodeURIComponent(i)??"";r(o)},[]);return{elementAsString:n,ref:s}};export{u as useSafeSvgParser};
|
|
16
|
+
//# sourceMappingURL=use-safe-svg-parser.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-safe-svg-parser.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isUndefined } from 'lodash-es';\nimport { useCallback, useState } from 'react';\n\n/**\n * Ref callback to be attached to an element. It'll run when the element is\n * loaded, so we can relly on it to ensure the DomNode is already cached.\n */\nexport const useSafeSvgParser = () => {\n const [elementAsString, setElementAsString] = useState('');\n const ref = useCallback((node) => {\n if (node === null) {\n return;\n }\n\n /*\n * At this moment the parent might be loaded and should be something like\n * \"<div><div ref={callback}><svg>icon</svg></div></div>\" and we are step\n * in the node that has the reference attached.\n * Easy to read from now on.\n */\n const svgElement = node.getElementsByTagName('svg')[0];\n if (isUndefined(svgElement)) {\n return;\n }\n const stringSvg = new XMLSerializer().serializeToString(svgElement);\n const value = encodeURIComponent(stringSvg) ?? '';\n setElementAsString(value);\n }, []);\n return { elementAsString, ref };\n};\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAgBA,OAAS,eAAAA,MAAmB,YAC5B,OAAS,eAAAC,EAAa,YAAAC,MAAgB,QAM/B,MAAMC,EAAmB,IAAM,CACpC,KAAM,CAACC,EAAiBC,CAAkB,EAAIH,EAAS,EAAE,EACnDI,EAAML,EAAaM,GAAS,CAChC,GAAIA,IAAS,KACX,OASF,MAAMC,EAAaD,EAAK,qBAAqB,KAAK,EAAE,CAAC,EACrD,GAAIP,EAAYQ,CAAU,EACxB,OAEF,MAAMC,EAAY,IAAI,cAAc,EAAE,kBAAkBD,CAAU,EAC5DE,EAAQ,mBAAmBD,CAAS,GAAK,GAC/CJ,EAAmBK,CAAK,CAC1B,EAAG,CAAC,CAAC,EACL,MAAO,CAAE,gBAAAN,EAAiB,IAAAE,CAAI,CAChC",
|
|
6
|
+
"names": ["isUndefined", "useCallback", "useState", "useSafeSvgParser", "elementAsString", "setElementAsString", "ref", "node", "svgElement", "stringSvg", "value"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{useCallback as o,useEffect as p}from"react";import{useMapTooltipPinnedState as c,useSetStateTooltip as d}from"../store/store.js";const u=()=>{const r=d(),i=c(),e=o(()=>{i&&r({pinned:!1})},[i]),t=o(s=>{s.key==="Escape"&&e()},[e]),n=o(s=>{e()},[e]);p(()=>(window.addEventListener("click",n),window.addEventListener("keyup",t),()=>{window.removeEventListener("click",n),window.removeEventListener("keyup",t)}),[n,t])};export{u as useTooltipEventListeners};
|
|
16
|
+
//# sourceMappingURL=use-tooltip-event-listeners.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-tooltip-event-listeners.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useEffect } from 'react';\n\nimport {\n useMapTooltipPinnedState,\n useSetStateTooltip,\n} from '../store/store.js';\n\nexport const useTooltipEventListeners = () => {\n const setTooltipState = useSetStateTooltip();\n\n const pinned = useMapTooltipPinnedState();\n\n const unpinTooltip = useCallback(() => {\n if (pinned) {\n setTooltipState({ pinned: false });\n }\n }, [pinned]);\n\n const onEscapeKeyPressedHandler = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n unpinTooltip();\n }\n },\n [unpinTooltip],\n );\n\n const onClick = useCallback(\n (event: MouseEvent) => {\n unpinTooltip();\n },\n [unpinTooltip],\n );\n\n useEffect(() => {\n window.addEventListener('click', onClick);\n window.addEventListener('keyup', onEscapeKeyPressedHandler);\n\n return () => {\n window.removeEventListener('click', onClick);\n window.removeEventListener('keyup', onEscapeKeyPressedHandler);\n };\n }, [onClick, onEscapeKeyPressedHandler]);\n};\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAgBA,OAAS,eAAAA,EAAa,aAAAC,MAAiB,QAEvC,OACE,4BAAAC,EACA,sBAAAC,MACK,oBAEA,MAAMC,EAA2B,IAAM,CAC5C,MAAMC,EAAkBF,EAAmB,EAErCG,EAASJ,EAAyB,EAElCK,EAAeP,EAAY,IAAM,CACjCM,GACFD,EAAgB,CAAE,OAAQ,EAAM,CAAC,CAErC,EAAG,CAACC,CAAM,CAAC,EAELE,EAA4BR,EAC/BS,GAAyB,CACpBA,EAAM,MAAQ,UAChBF,EAAa,CAEjB,EACA,CAACA,CAAY,CACf,EAEMG,EAAUV,EACbS,GAAsB,CACrBF,EAAa,CACf,EACA,CAACA,CAAY,CACf,EAEAN,EAAU,KACR,OAAO,iBAAiB,QAASS,CAAO,EACxC,OAAO,iBAAiB,QAASF,CAAyB,EAEnD,IAAM,CACX,OAAO,oBAAoB,QAASE,CAAO,EAC3C,OAAO,oBAAoB,QAASF,CAAyB,CAC/D,GACC,CAACE,EAASF,CAAyB,CAAC,CACzC",
|
|
6
|
+
"names": ["useCallback", "useEffect", "useMapTooltipPinnedState", "useSetStateTooltip", "useTooltipEventListeners", "setTooltipState", "pinned", "unpinTooltip", "onEscapeKeyPressedHandler", "event", "onClick"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{isNil as a}from"lodash-es";import l,{Children as d}from"react";import{isElement as m}from"react-is";import{DefaultTooltip as f}from"../components/DefaultTooltip.js";function Q(t,r){let o;return d.forEach(t,e=>{if(m(e)&&e.type===r){const i=(n,p)=>l.createElement(f,{closestPoint:n,layerData:p});o=a(e.props.children)?i:e.props.children}}),o}export{Q as useTooltipTemplate};
|
|
16
|
+
//# sourceMappingURL=use-tooltip-template.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-tooltip-template.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isNil } from 'lodash-es';\nimport React, { Children, ReactNode } from 'react';\nimport { isElement } from 'react-is';\n\nimport { DefaultTooltip } from '../components/DefaultTooltip.js';\nimport { Location } from '../types/location.js';\nimport { LayerTooltipHandler } 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 T extends Location,\n Q extends Record<string, string>,\n Z,\n>(\n children: ReactNode | undefined,\n layerType: Z,\n): LayerTooltipHandler<T, Q> | undefined {\n let template: LayerTooltipHandler<T, Q> | undefined;\n\n Children.forEach(children, (child) => {\n if (isElement(child) && child.type === layerType) {\n const defaultTooltipHandler = (closestPoint: T, layerData?: T[]) => (\n <DefaultTooltip closestPoint={closestPoint} layerData={layerData} />\n );\n\n template = isNil(child.props.children)\n ? defaultTooltipHandler\n : child.props.children;\n }\n });\n\n return template;\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,SAAAA,MAAa,YACtB,OAAOC,GAAS,YAAAC,MAA2B,QAC3C,OAAS,aAAAC,MAAiB,WAE1B,OAAS,kBAAAC,MAAsB,kCAWxB,SAASC,EAKdC,EACAC,EACuC,CACvC,IAAIC,EAEJ,OAAAN,EAAS,QAAQI,EAAWG,GAAU,CACpC,GAAIN,EAAUM,CAAK,GAAKA,EAAM,OAASF,EAAW,CAChD,MAAMG,EAAwB,CAACC,EAAiBC,IAC9CX,EAAA,cAACG,EAAA,CAAe,aAAcO,EAAc,UAAWC,EAAW,EAGpEJ,EAAWR,EAAMS,EAAM,MAAM,QAAQ,EACjCC,EACAD,EAAM,MAAM,QAClB,CACF,CAAC,EAEMD,CACT",
|
|
6
|
+
"names": ["isNil", "React", "Children", "isElement", "DefaultTooltip", "useTooltipTemplate", "children", "layerType", "template", "child", "defaultTooltipHandler", "closestPoint", "layerData"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import o from"react";import{FormattedMessage as i}from"react-intl";import{ChartSeriesAction as t}from"@dynatrace/strato-components-preview/charts";import{CopyIcon as n}from"@dynatrace/strato-icons";import{COPY_TO_CLIPBOARD_MESSAGES as m}from"../constants.js";const f=r=>{const e=()=>navigator.clipboard.writeText(`${r.latitude}, ${r.longitude}`);return()=>o.createElement(t,null,o.createElement(t.Item,{key:"default-action",onSelect:()=>e()},o.createElement(t.ItemIcon,null,o.createElement(n,null)),o.createElement(i,{...m.copyActionCoords})))};export{f as useDefaultTooltipActions};
|
|
16
|
+
//# sourceMappingURL=useDefaultTooltipActions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/useDefaultTooltipActions.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { FormattedMessage } from 'react-intl';\n\nimport { ChartSeriesAction } from '@dynatrace/strato-components-preview/charts';\nimport { CopyIcon } from '@dynatrace/strato-icons';\n\nimport { COPY_TO_CLIPBOARD_MESSAGES } from '../constants.js';\nimport { Location } from '../types/location.js';\n\nexport const useDefaultTooltipActions = <T extends Location>(data: T) => {\n const handleCopyToClipboard = () =>\n navigator.clipboard.writeText(`${data.latitude}, ${data.longitude}`);\n\n return () => (\n <ChartSeriesAction>\n <ChartSeriesAction.Item\n key={'default-action'}\n onSelect={() => handleCopyToClipboard()}\n >\n <ChartSeriesAction.ItemIcon>\n <CopyIcon />\n </ChartSeriesAction.ItemIcon>\n <FormattedMessage {...COPY_TO_CLIPBOARD_MESSAGES.copyActionCoords} />\n </ChartSeriesAction.Item>\n </ChartSeriesAction>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAOA,MAAW,QAClB,OAAS,oBAAAC,MAAwB,aAEjC,OAAS,qBAAAC,MAAyB,8CAClC,OAAS,YAAAC,MAAgB,0BAEzB,OAAS,8BAAAC,MAAkC,kBAGpC,MAAMC,EAAgDC,GAAY,CACvE,MAAMC,EAAwB,IAC5B,UAAU,UAAU,UAAU,GAAGD,EAAK,QAAQ,KAAKA,EAAK,SAAS,EAAE,EAErE,MAAO,IACLN,EAAA,cAACE,EAAA,KACCF,EAAA,cAACE,EAAkB,KAAlB,CACC,IAAK,iBACL,SAAU,IAAMK,EAAsB,GAEtCP,EAAA,cAACE,EAAkB,SAAlB,KACCF,EAAA,cAACG,EAAA,IAAS,CACZ,EACAH,EAAA,cAACC,EAAA,CAAkB,GAAGG,EAA2B,iBAAkB,CACrE,CACF,CAEJ",
|
|
6
|
+
"names": ["React", "FormattedMessage", "ChartSeriesAction", "CopyIcon", "COPY_TO_CLIPBOARD_MESSAGES", "useDefaultTooltipActions", "data", "handleCopyToClipboard"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/const e={version:8,name:"default",center:[0,0],zoom:1,bearing:0,pitch:0,sources:{},layers:[{id:"background-layer",type:"background",paint:{"background-color":"transparent"}}],id:"default"};export{e as defaultStyle};
|
|
16
|
+
//# sourceMappingURL=default-style.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/map-styles/default-style.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Style } from 'mapbox-gl';\n\nexport const defaultStyle: Style = {\n version: 8,\n name: 'default',\n center: [0, 0],\n zoom: 1,\n bearing: 0,\n pitch: 0,\n sources: {},\n layers: [\n {\n id: 'background-layer',\n type: 'background',\n paint: {\n 'background-color': 'transparent',\n },\n },\n ],\n id: 'default',\n};\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAkBO,MAAMA,EAAsB,CACjC,QAAS,EACT,KAAM,UACN,OAAQ,CAAC,EAAG,CAAC,EACb,KAAM,EACN,QAAS,EACT,MAAO,EACP,QAAS,CAAC,EACV,OAAQ,CACN,CACE,GAAI,mBACJ,KAAM,aACN,MAAO,CACL,mBAAoB,aACtB,CACF,CACF,EACA,GAAI,SACN",
|
|
6
|
+
"names": ["defaultStyle"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{isEmpty as t}from"lodash-es";import o from"react";import{ColorScaleContext as l}from"../contexts/color-scale.context.js";import{buildScaleFromLegendConfig as m}from"../functions/build-scale-from-legend-config.js";import{useMapConfig as n}from"../hooks/use-map-config.js";const c=({children:r})=>{const{legend:e}=n();if(t(e))return o.createElement(o.Fragment,null,r);const i=m(e);return o.createElement(l.Provider,{value:i},r)};export{c as ColorScaleProvider};
|
|
16
|
+
//# sourceMappingURL=color-scale.provider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/providers/color-scale.provider.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAeA,OAAS,WAAAA,MAAe,YACxB,OAAOC,MAAkC,QAEzC,OAAS,qBAAAC,MAAyB,qCAClC,OAAS,8BAAAC,MAAkC,iDAC3C,OAAS,gBAAAC,MAAoB,6BAetB,MAAMC,EAAqB,CAAC,CAAE,SAAAC,CAAS,IAAyB,CACrE,KAAM,CAAE,OAAAC,CAAO,EAAIH,EAAa,EAChC,GAAIJ,EAAQO,CAAM,EAChB,OAAON,EAAA,cAAAA,EAAA,cAAGK,CAAS,EAGrB,MAAME,EAAQL,EAA2BI,CAAM,EAE/C,OACEN,EAAA,cAACC,EAAkB,SAAlB,CAA2B,MAAOM,GAChCF,CACH,CAEJ",
|
|
6
|
+
"names": ["isEmpty", "React", "ColorScaleContext", "buildScaleFromLegendConfig", "useMapConfig", "ColorScaleProvider", "children", "legend", "scale"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/import{extent as l}from"d3-array";import{isUndefined as o}from"lodash-es";import t from"react";import{LayerColoringStrategyContext as d}from"../contexts/layer-coloring-strategy.context.js";import{isSequentialLegend as g,isThresholdLegend as u}from"../functions/build-scale-from-legend-config.js";import{useColorScale as m}from"../hooks/use-color-scale.js";import{useMapConfig as c}from"../hooks/use-map-config.js";function f(e){return r=>{if(e.domain().includes(r))return e(r)}}function a(e){return r=>{const n=e.domain(),[i,s]=l(n);if(r&&r>=i&&r<=s)return e(r)}}function S(e,r){return g(e)||u(e)?a(r):f(r)}const W=({children:e})=>{const r=m(),{legend:n}=c();if(o(n)||o(r))return t.createElement(t.Fragment,null,e);const i=S(n,r);return t.createElement(d.Provider,{value:i},e)};export{W as LayerColorStrategyProvider,f as buildCategoricalScale,S as buildClampedScale,a as buildNumericScale};
|
|
16
|
+
//# sourceMappingURL=layer-color-strategy.provider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/providers/layer-color-strategy.provider.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2023 Dynatrace LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAgBA,OAAS,UAAAA,MAAc,WAEvB,OAAS,eAAAC,MAAmB,YAC5B,OAAOC,MAAkC,QAEzC,OAAS,gCAAAC,MAAoC,iDAC7C,OACE,sBAAAC,EACA,qBAAAC,MACK,iDACP,OAAS,iBAAAC,MAAqB,8BAC9B,OAAS,gBAAAC,MAAoB,6BAGtB,SAASC,EACdC,EACuC,CACvC,OAAQC,GAAkB,CAGxB,GAFmBD,EAAM,OAAO,EAEjB,SAASC,CAAK,EAC3B,OAAOD,EAAMC,CAAK,CAEtB,CACF,CAEO,SAASC,EACdF,EACuC,CACvC,OAAQC,GAAkB,CACxB,MAAME,EAAcH,EAAM,OAAO,EAC3B,CAACI,EAAKC,CAAG,EAAId,EAAOY,CAAW,EAErC,GAAIF,GAASA,GAASG,GAAOH,GAASI,EACpC,OAAOL,EAAMC,CAAK,CAEtB,CACF,CAEO,SAASK,EACdC,EACAP,EAIgD,CAChD,OAAIL,EAAmBY,CAAM,GAElBX,EAAkBW,CAAM,EAD1BL,EAAkBF,CAA8B,EAIhDD,EAAsBC,CAAqC,CAEtE,CAUO,MAAMQ,EAA6B,CAAC,CAAE,SAAAC,CAAS,IAAyB,CAC7E,MAAMT,EAAQH,EAAc,EAEtB,CAAE,OAAAU,CAAO,EAAIT,EAAa,EAEhC,GAAIN,EAAYe,CAAM,GAAKf,EAAYQ,CAAK,EAC1C,OAAOP,EAAA,cAAAA,EAAA,cAAGgB,CAAS,EAGrB,MAAMC,EAAeJ,EAAkBC,EAAQP,CAAK,EAEpD,OACEP,EAAA,cAACC,EAA6B,SAA7B,CAAsC,MAAOgB,GAC3CD,CACH,CAEJ",
|
|
6
|
+
"names": ["extent", "isUndefined", "React", "LayerColoringStrategyContext", "isSequentialLegend", "isThresholdLegend", "useColorScale", "useMapConfig", "buildCategoricalScale", "scale", "value", "buildNumericScale", "scaleDomain", "min", "max", "buildClampedScale", "legend", "LayerColorStrategyProvider", "children", "clampedScale"]
|
|
7
|
+
}
|