@unovis/ts 1.1.1-beta.7 → 1.1.1-beta.9
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/components/area/config.d.ts +25 -0
- package/components/area/config.js +16 -0
- package/components/area/config.js.map +1 -0
- package/components/area/index.d.ts +19 -0
- package/components/area/index.js +102 -0
- package/components/area/index.js.map +1 -0
- package/components/area/style.d.ts +3 -0
- package/{src/components/area/style.ts → components/area/style.js} +10 -9
- package/components/area/style.js.map +1 -0
- package/components/area/types.d.ts +6 -0
- package/components/axis/config.d.ts +71 -0
- package/components/axis/config.js +32 -0
- package/components/axis/config.js.map +1 -0
- package/components/axis/index.d.ts +44 -0
- package/components/axis/index.js +305 -0
- package/components/axis/index.js.map +1 -0
- package/components/axis/style.d.ts +9 -0
- package/{src/components/axis/style.ts → components/axis/style.js} +22 -27
- package/components/axis/style.js.map +1 -0
- package/components/axis/types.d.ts +4 -0
- package/components/axis/types.js +8 -0
- package/components/axis/types.js.map +1 -0
- package/components/brush/config.d.ts +42 -0
- package/components/brush/config.js +24 -0
- package/components/brush/config.js.map +1 -0
- package/components/brush/index.d.ts +28 -0
- package/components/brush/index.js +199 -0
- package/components/brush/index.js.map +1 -0
- package/components/brush/style.d.ts +5 -0
- package/{src/components/brush/style.ts → components/brush/style.js} +14 -15
- package/components/brush/style.js.map +1 -0
- package/components/brush/types.d.ts +7 -0
- package/components/brush/types.js +8 -0
- package/components/brush/types.js.map +1 -0
- package/components/bullet-legend/config.d.ts +34 -0
- package/components/bullet-legend/config.js +16 -0
- package/components/bullet-legend/config.js.map +1 -0
- package/components/bullet-legend/index.d.ts +19 -0
- package/components/bullet-legend/index.js +79 -0
- package/components/bullet-legend/index.js.map +1 -0
- package/components/bullet-legend/style.d.ts +6 -0
- package/{src/components/bullet-legend/style.ts → components/bullet-legend/style.js} +16 -18
- package/components/bullet-legend/style.js.map +1 -0
- package/components/bullet-legend/types.d.ts +7 -0
- package/components/bullet-legend/types.js +2 -0
- package/components/bullet-legend/types.js.map +1 -0
- package/components/chord-diagram/config.d.ts +44 -0
- package/components/chord-diagram/config.js +25 -0
- package/components/chord-diagram/config.js.map +1 -0
- package/components/chord-diagram/index.d.ts +42 -0
- package/components/chord-diagram/index.js +305 -0
- package/components/chord-diagram/index.js.map +1 -0
- package/components/chord-diagram/modules/label.d.ts +8 -0
- package/components/chord-diagram/modules/label.js +115 -0
- package/components/chord-diagram/modules/label.js.map +1 -0
- package/components/chord-diagram/modules/link.d.ts +21 -0
- package/components/chord-diagram/modules/link.js +63 -0
- package/components/chord-diagram/modules/link.js.map +1 -0
- package/components/chord-diagram/modules/node.d.ts +17 -0
- package/components/chord-diagram/modules/node.js +52 -0
- package/components/chord-diagram/modules/node.js.map +1 -0
- package/components/chord-diagram/style.d.ts +13 -0
- package/{src/components/chord-diagram/style.ts → components/chord-diagram/style.js} +30 -39
- package/components/chord-diagram/style.js.map +1 -0
- package/components/chord-diagram/types.d.ts +58 -0
- package/components/chord-diagram/types.js +8 -0
- package/components/chord-diagram/types.js.map +1 -0
- package/components/crosshair/config.d.ts +43 -0
- package/components/crosshair/config.js +19 -0
- package/components/crosshair/config.js.map +1 -0
- package/components/crosshair/index.d.ts +35 -0
- package/components/crosshair/index.js +183 -0
- package/components/crosshair/index.js.map +1 -0
- package/components/crosshair/style.d.ts +4 -0
- package/{src/components/crosshair/style.ts → components/crosshair/style.js} +12 -12
- package/components/crosshair/style.js.map +1 -0
- package/components/crosshair/types.d.ts +13 -0
- package/components/crosshair/types.js +2 -0
- package/components/crosshair/types.js.map +1 -0
- package/components/donut/config.d.ts +59 -0
- package/components/donut/config.js +28 -0
- package/components/donut/config.js.map +1 -0
- package/components/donut/index.d.ts +21 -0
- package/components/donut/index.js +107 -0
- package/components/donut/index.js.map +1 -0
- package/components/donut/modules/arc.d.ts +10 -0
- package/components/donut/modules/arc.js +59 -0
- package/components/donut/modules/arc.js.map +1 -0
- package/components/donut/style.d.ts +7 -0
- package/{src/components/donut/style.ts → components/donut/style.js} +18 -20
- package/components/donut/style.js.map +1 -0
- package/components/donut/types.d.ts +20 -0
- package/components/flow-legend/config.d.ts +29 -0
- package/components/flow-legend/config.js +18 -0
- package/components/flow-legend/config.js.map +1 -0
- package/components/flow-legend/index.d.ts +16 -0
- package/components/flow-legend/index.js +75 -0
- package/components/flow-legend/index.js.map +1 -0
- package/components/flow-legend/style.d.ts +8 -0
- package/{src/components/flow-legend/style.ts → components/flow-legend/style.js} +21 -25
- package/components/flow-legend/style.js.map +1 -0
- package/components/flow-legend/types.d.ts +9 -0
- package/components/flow-legend/types.js +8 -0
- package/components/flow-legend/types.js.map +1 -0
- package/components/free-brush/config.d.ts +45 -0
- package/components/free-brush/config.js +24 -0
- package/components/free-brush/config.js.map +1 -0
- package/components/free-brush/index.d.ts +20 -0
- package/components/free-brush/index.js +192 -0
- package/components/free-brush/index.js.map +1 -0
- package/components/free-brush/style.d.ts +4 -0
- package/{src/components/free-brush/style.ts → components/free-brush/style.js} +12 -12
- package/components/free-brush/style.js.map +1 -0
- package/components/free-brush/types.d.ts +7 -0
- package/components/free-brush/types.js +9 -0
- package/components/free-brush/types.js.map +1 -0
- package/components/graph/config.d.ts +238 -0
- package/components/graph/config.js +84 -0
- package/components/graph/config.js.map +1 -0
- package/components/graph/index.d.ts +126 -0
- package/components/graph/index.js +656 -0
- package/components/graph/index.js.map +1 -0
- package/components/graph/modules/layout-helpers.d.ts +21 -0
- package/components/graph/modules/layout-helpers.js +69 -0
- package/components/graph/modules/layout-helpers.js.map +1 -0
- package/components/graph/modules/layout.d.ts +10 -0
- package/components/graph/modules/layout.js +399 -0
- package/components/graph/modules/layout.js.map +1 -0
- package/components/graph/modules/link/helper.d.ts +25 -0
- package/components/graph/modules/link/helper.js +74 -0
- package/components/graph/modules/link/helper.js.map +1 -0
- package/components/graph/modules/link/index.d.ts +11 -0
- package/components/graph/modules/link/index.js +212 -0
- package/components/graph/modules/link/index.js.map +1 -0
- package/components/graph/modules/link/style.d.ts +15 -0
- package/{src/components/graph/modules/link/style.ts → components/graph/modules/link/style.js} +34 -45
- package/components/graph/modules/link/style.js.map +1 -0
- package/components/graph/modules/node/helper.d.ts +21 -0
- package/components/graph/modules/node/helper.js +126 -0
- package/components/graph/modules/node/helper.js.map +1 -0
- package/components/graph/modules/node/index.d.ts +11 -0
- package/components/graph/modules/node/index.js +252 -0
- package/components/graph/modules/node/index.js.map +1 -0
- package/components/graph/modules/node/style.d.ts +24 -0
- package/{src/components/graph/modules/node/style.ts → components/graph/modules/node/style.js} +52 -72
- package/components/graph/modules/node/style.js.map +1 -0
- package/components/graph/modules/panel/helper.d.ts +18 -0
- package/components/graph/modules/panel/helper.js +111 -0
- package/components/graph/modules/panel/helper.js.map +1 -0
- package/components/graph/modules/panel/index.d.ts +7 -0
- package/components/graph/modules/panel/index.js +98 -0
- package/components/graph/modules/panel/index.js.map +1 -0
- package/components/graph/modules/panel/style.d.ts +14 -0
- package/{src/components/graph/modules/panel/style.ts → components/graph/modules/panel/style.js} +32 -42
- package/components/graph/modules/panel/style.js.map +1 -0
- package/components/graph/modules/shape.d.ts +6 -0
- package/components/graph/modules/shape.js +80 -0
- package/components/graph/modules/shape.js.map +1 -0
- package/components/graph/modules/zoom-levels.d.ts +6 -0
- package/components/graph/modules/zoom-levels.js +10 -0
- package/components/graph/modules/zoom-levels.js.map +1 -0
- package/components/graph/style.d.ts +6 -0
- package/components/graph/style.js +66 -0
- package/components/graph/style.js.map +1 -0
- package/components/graph/types.d.ts +125 -0
- package/components/graph/types.js +30 -0
- package/components/graph/types.js.map +1 -0
- package/components/grouped-bar/config.d.ts +36 -0
- package/components/grouped-bar/config.js +20 -0
- package/components/grouped-bar/config.js.map +1 -0
- package/components/grouped-bar/index.d.ts +32 -0
- package/components/grouped-bar/index.js +249 -0
- package/components/grouped-bar/index.js.map +1 -0
- package/components/grouped-bar/style.d.ts +5 -0
- package/{src/components/grouped-bar/style.ts → components/grouped-bar/style.js} +14 -15
- package/components/grouped-bar/style.js.map +1 -0
- package/components/leaflet-flow-map/config.d.ts +46 -0
- package/components/leaflet-flow-map/config.js +25 -0
- package/components/leaflet-flow-map/config.js.map +1 -0
- package/components/leaflet-flow-map/index.d.ts +52 -0
- package/components/leaflet-flow-map/index.js +220 -0
- package/components/leaflet-flow-map/index.js.map +1 -0
- package/components/leaflet-flow-map/renderer-utils.d.ts +5 -0
- package/components/leaflet-flow-map/renderer-utils.js +15 -0
- package/components/leaflet-flow-map/renderer-utils.js.map +1 -0
- package/components/leaflet-flow-map/renderer.d.ts +26 -0
- package/components/leaflet-flow-map/renderer.js +117 -0
- package/components/leaflet-flow-map/renderer.js.map +1 -0
- package/components/leaflet-flow-map/shaders.d.ts +2 -0
- package/{src/components/leaflet-flow-map/shaders.ts → components/leaflet-flow-map/shaders.js} +7 -4
- package/components/leaflet-flow-map/shaders.js.map +1 -0
- package/components/leaflet-flow-map/types.d.ts +23 -0
- package/components/leaflet-map/config.d.ts +193 -0
- package/components/leaflet-map/config.js +71 -0
- package/components/leaflet-map/config.js.map +1 -0
- package/components/leaflet-map/index.d.ts +130 -0
- package/components/leaflet-map/index.js +690 -0
- package/components/leaflet-map/index.js.map +1 -0
- package/components/leaflet-map/leaflet.css.js +5 -0
- package/components/leaflet-map/leaflet.css.js.map +1 -0
- package/components/leaflet-map/modules/clusterBackground.d.ts +5 -0
- package/components/leaflet-map/modules/clusterBackground.js +27 -0
- package/components/leaflet-map/modules/clusterBackground.js.map +1 -0
- package/components/leaflet-map/modules/donut.d.ts +3 -0
- package/components/leaflet-map/modules/donut.js +25 -0
- package/components/leaflet-map/modules/donut.js.map +1 -0
- package/components/leaflet-map/modules/map.d.ts +14 -0
- package/components/leaflet-map/modules/map.js +154 -0
- package/components/leaflet-map/modules/map.js.map +1 -0
- package/components/leaflet-map/modules/node.d.ts +9 -0
- package/components/leaflet-map/modules/node.js +162 -0
- package/components/leaflet-map/modules/node.js.map +1 -0
- package/components/leaflet-map/modules/selectionRing.d.ts +7 -0
- package/components/leaflet-map/modules/selectionRing.js +41 -0
- package/components/leaflet-map/modules/selectionRing.js.map +1 -0
- package/components/leaflet-map/modules/utils.d.ts +50 -0
- package/components/leaflet-map/modules/utils.js +210 -0
- package/components/leaflet-map/modules/utils.js.map +1 -0
- package/{src/components → components}/leaflet-map/renderer/leaflet-maplibre-gl.js +78 -76
- package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +1 -0
- package/components/leaflet-map/renderer/map-style.d.ts +4 -0
- package/components/leaflet-map/renderer/map-style.js +15 -0
- package/components/leaflet-map/renderer/map-style.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js +40 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js +40 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js +4981 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +8 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.js +27 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +4 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.js +39 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -0
- package/{src/components → components}/leaflet-map/renderer/maplibre-gl.css.js +4 -2
- package/components/leaflet-map/renderer/maplibre-gl.css.js.map +1 -0
- package/components/leaflet-map/style.d.ts +52 -0
- package/components/leaflet-map/style.js +183 -0
- package/components/leaflet-map/style.js.map +1 -0
- package/components/leaflet-map/types.d.ts +75 -0
- package/components/leaflet-map/types.js +15 -0
- package/components/leaflet-map/types.js.map +1 -0
- package/components/line/config.d.ts +30 -0
- package/components/line/config.js +17 -0
- package/components/line/config.js.map +1 -0
- package/components/line/index.d.ts +27 -0
- package/components/line/index.js +152 -0
- package/components/line/index.js.map +1 -0
- package/components/line/style.d.ts +6 -0
- package/{src/components/line/style.ts → components/line/style.js} +16 -18
- package/components/line/style.js.map +1 -0
- package/components/line/types.d.ts +12 -0
- package/components/nested-donut/config.d.ts +59 -0
- package/components/nested-donut/config.js +19 -0
- package/components/nested-donut/config.js.map +1 -0
- package/components/nested-donut/index.d.ts +38 -0
- package/components/nested-donut/index.js +133 -0
- package/components/nested-donut/index.js.map +1 -0
- package/components/nested-donut/modules/arc.d.ts +17 -0
- package/components/nested-donut/modules/arc.js +50 -0
- package/components/nested-donut/modules/arc.js.map +1 -0
- package/components/nested-donut/modules/label.d.ts +7 -0
- package/components/nested-donut/modules/label.js +34 -0
- package/components/nested-donut/modules/label.js.map +1 -0
- package/components/nested-donut/style.d.ts +26 -0
- package/components/nested-donut/style.js +70 -0
- package/components/nested-donut/style.js.map +1 -0
- package/components/nested-donut/types.d.ts +24 -0
- package/components/nested-donut/types.js +11 -0
- package/components/nested-donut/types.js.map +1 -0
- package/components/sankey/config.d.ts +162 -0
- package/components/sankey/config.js +65 -0
- package/components/sankey/config.js.map +1 -0
- package/components/sankey/index.d.ts +59 -0
- package/components/sankey/index.js +306 -0
- package/components/sankey/index.js.map +1 -0
- package/components/sankey/modules/label.d.ts +23 -0
- package/components/sankey/modules/label.js +168 -0
- package/components/sankey/modules/label.js.map +1 -0
- package/components/sankey/modules/link.d.ts +14 -0
- package/components/sankey/modules/link.js +108 -0
- package/components/sankey/modules/link.js.map +1 -0
- package/components/sankey/modules/node.d.ts +10 -0
- package/components/sankey/modules/node.js +156 -0
- package/components/sankey/modules/node.js.map +1 -0
- package/components/sankey/style.d.ts +20 -0
- package/{src/components/sankey/style.ts → components/sankey/style.js} +44 -60
- package/components/sankey/style.js.map +1 -0
- package/components/sankey/types.d.ts +84 -0
- package/components/sankey/types.js +34 -0
- package/components/sankey/types.js.map +1 -0
- package/components/scatter/config.d.ts +44 -0
- package/components/scatter/config.js +23 -0
- package/components/scatter/config.js.map +1 -0
- package/components/scatter/index.d.ts +28 -0
- package/components/scatter/index.js +167 -0
- package/components/scatter/index.js.map +1 -0
- package/components/scatter/modules/point.d.ts +7 -0
- package/components/scatter/modules/point.js +86 -0
- package/components/scatter/modules/point.js.map +1 -0
- package/components/scatter/modules/utils.d.ts +11 -0
- package/components/scatter/modules/utils.js +112 -0
- package/components/scatter/modules/utils.js.map +1 -0
- package/components/scatter/style.d.ts +5 -0
- package/{src/components/scatter/style.ts → components/scatter/style.js} +14 -15
- package/components/scatter/style.js.map +1 -0
- package/components/scatter/types.d.ts +19 -0
- package/components/stacked-bar/config.d.ts +38 -0
- package/components/stacked-bar/config.js +20 -0
- package/components/stacked-bar/config.js.map +1 -0
- package/components/stacked-bar/index.d.ts +28 -0
- package/components/stacked-bar/index.js +208 -0
- package/components/stacked-bar/index.js.map +1 -0
- package/components/stacked-bar/style.d.ts +5 -0
- package/{src/components/stacked-bar/style.ts → components/stacked-bar/style.js} +14 -15
- package/components/stacked-bar/style.js.map +1 -0
- package/components/stacked-bar/types.d.ts +5 -0
- package/components/timeline/config.d.ts +43 -0
- package/components/timeline/config.js +24 -0
- package/components/timeline/config.js.map +1 -0
- package/components/timeline/index.d.ts +41 -0
- package/components/timeline/index.js +244 -0
- package/components/timeline/index.js.map +1 -0
- package/components/timeline/style.d.ts +13 -0
- package/{src/components/timeline/style.ts → components/timeline/style.js} +30 -39
- package/components/timeline/style.js.map +1 -0
- package/components/tooltip/config.d.ts +68 -0
- package/components/tooltip/config.js +20 -0
- package/components/tooltip/config.js.map +1 -0
- package/components/tooltip/index.d.ts +36 -0
- package/components/tooltip/index.js +184 -0
- package/components/tooltip/index.js.map +1 -0
- package/{src/components → components}/tooltip/style.js +14 -11
- package/components/tooltip/style.js.map +1 -0
- package/components/topojson-map/config.d.ts +99 -0
- package/components/topojson-map/config.js +42 -0
- package/components/topojson-map/config.js.map +1 -0
- package/components/topojson-map/index.d.ts +52 -0
- package/components/topojson-map/index.js +355 -0
- package/components/topojson-map/index.js.map +1 -0
- package/components/topojson-map/style.d.ts +11 -0
- package/{src/components/topojson-map/style.ts → components/topojson-map/style.js} +26 -33
- package/components/topojson-map/style.js.map +1 -0
- package/components/topojson-map/types.d.ts +78 -0
- package/components/topojson-map/types.js +80 -0
- package/components/topojson-map/types.js.map +1 -0
- package/components/topojson-map/utils.d.ts +3 -0
- package/components/topojson-map/utils.js +30 -0
- package/components/topojson-map/utils.js.map +1 -0
- package/components/vis-controls/config.d.ts +12 -0
- package/components/vis-controls/config.js +13 -0
- package/components/vis-controls/config.js.map +1 -0
- package/components/vis-controls/index.d.ts +14 -0
- package/components/vis-controls/index.js +52 -0
- package/components/vis-controls/index.js.map +1 -0
- package/components/vis-controls/style.d.ts +11 -0
- package/{src/components/vis-controls/style.ts → components/vis-controls/style.js} +27 -34
- package/components/vis-controls/style.js.map +1 -0
- package/components/vis-controls/types.d.ts +13 -0
- package/components/vis-controls/types.js +8 -0
- package/components/vis-controls/types.js.map +1 -0
- package/components/xy-labels/config.d.ts +48 -0
- package/components/xy-labels/config.js +25 -0
- package/components/xy-labels/config.js.map +1 -0
- package/components/xy-labels/index.d.ts +15 -0
- package/components/xy-labels/index.js +87 -0
- package/components/xy-labels/index.js.map +1 -0
- package/components/xy-labels/modules/label.d.ts +9 -0
- package/components/xy-labels/modules/label.js +107 -0
- package/components/xy-labels/modules/label.js.map +1 -0
- package/components/xy-labels/style.d.ts +5 -0
- package/{src/components/xy-labels/style.ts → components/xy-labels/style.js} +14 -15
- package/components/xy-labels/style.js.map +1 -0
- package/components/xy-labels/types.d.ts +23 -0
- package/components/xy-labels/types.js +9 -0
- package/components/xy-labels/types.js.map +1 -0
- package/components.d.ts +51 -0
- package/components.js +29 -0
- package/components.js.map +1 -0
- package/containers/single-container/config.d.ts +12 -0
- package/containers/single-container/config.js +12 -0
- package/containers/single-container/config.js.map +1 -0
- package/containers/single-container/index.d.ts +19 -0
- package/containers/single-container/index.js +128 -0
- package/containers/single-container/index.js.map +1 -0
- package/containers/xy-container/config.d.ts +99 -0
- package/containers/xy-container/config.js +30 -0
- package/containers/xy-container/config.js.map +1 -0
- package/containers/xy-container/index.d.ts +34 -0
- package/containers/xy-container/index.js +330 -0
- package/containers/xy-container/index.js.map +1 -0
- package/containers.d.ts +6 -0
- package/containers.js +4 -0
- package/containers.js.map +1 -0
- package/core/component/config.d.ts +58 -0
- package/core/component/config.js +14 -0
- package/core/component/config.js.map +1 -0
- package/core/component/index.d.ts +43 -0
- package/core/component/index.js +118 -0
- package/core/component/index.js.map +1 -0
- package/core/component/types.d.ts +2 -0
- package/core/component/types.js +2 -0
- package/core/component/types.js.map +1 -0
- package/core/config/index.d.ts +3 -0
- package/core/config/index.js +16 -0
- package/core/config/index.js.map +1 -0
- package/core/container/config.d.ts +48 -0
- package/core/container/config.js +29 -0
- package/core/container/config.js.map +1 -0
- package/core/container/index.d.ts +26 -0
- package/core/container/index.js +106 -0
- package/core/container/index.js.map +1 -0
- package/core/xy-component/config.d.ts +38 -0
- package/core/xy-component/config.js +20 -0
- package/core/xy-component/config.js.map +1 -0
- package/core/xy-component/index.d.ts +27 -0
- package/core/xy-component/index.js +74 -0
- package/core/xy-component/index.js.map +1 -0
- package/data-models/core.d.ts +6 -0
- package/data-models/core.js +14 -0
- package/data-models/core.js.map +1 -0
- package/data-models/graph.d.ts +24 -0
- package/data-models/graph.js +107 -0
- package/data-models/graph.js.map +1 -0
- package/data-models/map-graph.d.ts +21 -0
- package/data-models/map-graph.js +62 -0
- package/data-models/map-graph.js.map +1 -0
- package/data-models/map.d.ts +5 -0
- package/data-models/map.js +12 -0
- package/data-models/map.js.map +1 -0
- package/data-models/series.d.ts +6 -0
- package/data-models/series.js +19 -0
- package/data-models/series.js.map +1 -0
- package/index.d.ts +7 -0
- package/index.js +55 -0
- package/index.js.map +1 -0
- package/maps/china-provinces.json.js +140373 -0
- package/maps/fr-regions.json.js +14162 -0
- package/maps/germany-regions.json.js +35760 -0
- package/maps/ind-regions.json.js +290584 -0
- package/maps/uk-regions.json.js +96233 -0
- package/maps/us-counties.json.js +206318 -0
- package/maps/us-states.json.js +16345 -0
- package/maps/world-110m-alpha.json.js +251366 -0
- package/maps/world-simple.json.js +89428 -0
- package/maps/world-simplest.json.js +28175 -0
- package/maps.d.ts +60 -0
- package/maps.js +23 -0
- package/package.json +1 -1
- package/styles/colors.d.ts +7 -0
- package/styles/colors.js +24 -0
- package/styles/colors.js.map +1 -0
- package/styles/index.d.ts +7 -0
- package/styles/index.js +38 -0
- package/styles/index.js.map +1 -0
- package/styles/sizes.d.ts +2 -0
- package/{src/styles/sizes.ts → styles/sizes.js} +8 -6
- package/styles/sizes.js.map +1 -0
- package/types/accessor.d.ts +5 -0
- package/types/accessor.js +2 -0
- package/types/accessor.js.map +1 -0
- package/types/component.d.ts +13 -0
- package/types/component.js +14 -0
- package/types/component.js.map +1 -0
- package/types/curve.d.ts +40 -0
- package/types/curve.js +46 -0
- package/types/curve.js.map +1 -0
- package/types/data.d.ts +7 -0
- package/types/data.js +2 -0
- package/types/data.js.map +1 -0
- package/types/direction.d.ts +6 -0
- package/types/direction.js +10 -0
- package/types/direction.js.map +1 -0
- package/types/graph.d.ts +35 -0
- package/types/graph.js +2 -0
- package/types/graph.js.map +1 -0
- package/types/map.d.ts +4 -0
- package/types/map.js +2 -0
- package/types/map.js.map +1 -0
- package/types/misc.d.ts +8 -0
- package/types/position.d.ts +20 -0
- package/types/position.js +27 -0
- package/types/position.js.map +1 -0
- package/types/scale.d.ts +23 -0
- package/types/scale.js +27 -0
- package/types/scale.js.map +1 -0
- package/types/shape.d.ts +7 -0
- package/types/shape.js +11 -0
- package/types/shape.js.map +1 -0
- package/types/spacing.d.ts +6 -0
- package/types/spacing.js +2 -0
- package/types/spacing.js.map +1 -0
- package/types/svg.d.ts +18 -0
- package/types/svg.js +22 -0
- package/types/svg.js.map +1 -0
- package/types/symbol.d.ts +18 -0
- package/types/symbol.js +24 -0
- package/types/symbol.js.map +1 -0
- package/types/text.d.ts +47 -0
- package/types/text.js +26 -0
- package/types/text.js.map +1 -0
- package/types.d.ts +27 -0
- package/types.js +30 -0
- package/types.js.map +1 -0
- package/utils/color.d.ts +10 -0
- package/utils/color.js +32 -0
- package/utils/color.js.map +1 -0
- package/utils/d3.d.ts +3 -0
- package/utils/d3.js +16 -0
- package/utils/d3.js.map +1 -0
- package/utils/data.d.ts +45 -0
- package/utils/data.js +274 -0
- package/utils/data.js.map +1 -0
- package/utils/html.d.ts +1 -0
- package/utils/html.js +16 -0
- package/utils/html.js.map +1 -0
- package/utils/map.d.ts +2 -0
- package/utils/map.js +20 -0
- package/utils/map.js.map +1 -0
- package/utils/misc.d.ts +9 -0
- package/utils/misc.js +47 -0
- package/utils/misc.js.map +1 -0
- package/utils/path.d.ts +23 -0
- package/utils/path.js +144 -0
- package/utils/path.js.map +1 -0
- package/utils/scale.d.ts +1 -0
- package/utils/style.d.ts +6 -0
- package/utils/style.js +24 -0
- package/utils/style.js.map +1 -0
- package/utils/svg.d.ts +3 -0
- package/utils/text.d.ts +139 -0
- package/utils/text.js +443 -0
- package/utils/text.js.map +1 -0
- package/utils/type.d.ts +5 -0
- package/declaration.d.ts +0 -1
- package/index.ts +0 -1
- package/licences.txt +0 -43
- package/maps.ts +0 -1
- package/rollup.config.js +0 -71
- package/rules/ts-getter-setter.js +0 -35
- package/src/components/area/config.ts +0 -29
- package/src/components/area/index.ts +0 -133
- package/src/components/area/types.ts +0 -2
- package/src/components/axis/config.ts +0 -76
- package/src/components/axis/index.ts +0 -363
- package/src/components/axis/types.ts +0 -4
- package/src/components/brush/config.ts +0 -51
- package/src/components/brush/index.ts +0 -233
- package/src/components/brush/types.ts +0 -8
- package/src/components/bullet-legend/config.ts +0 -38
- package/src/components/bullet-legend/index.ts +0 -104
- package/src/components/bullet-legend/types.ts +0 -7
- package/src/components/chord-diagram/config.ts +0 -53
- package/src/components/chord-diagram/index.ts +0 -401
- package/src/components/chord-diagram/modules/label.ts +0 -155
- package/src/components/chord-diagram/modules/link.ts +0 -91
- package/src/components/chord-diagram/modules/node.ts +0 -80
- package/src/components/chord-diagram/types.ts +0 -68
- package/src/components/crosshair/config.ts +0 -48
- package/src/components/crosshair/index.ts +0 -220
- package/src/components/crosshair/types.ts +0 -15
- package/src/components/donut/config.ts +0 -65
- package/src/components/donut/index.ts +0 -148
- package/src/components/donut/modules/arc.ts +0 -86
- package/src/components/donut/types.ts +0 -17
- package/src/components/flow-legend/config.ts +0 -31
- package/src/components/flow-legend/index.ts +0 -103
- package/src/components/flow-legend/types.ts +0 -10
- package/src/components/free-brush/config.ts +0 -54
- package/src/components/free-brush/index.ts +0 -207
- package/src/components/free-brush/types.ts +0 -8
- package/src/components/graph/config.ts +0 -280
- package/src/components/graph/index.ts +0 -809
- package/src/components/graph/modules/layout-helpers.ts +0 -96
- package/src/components/graph/modules/layout.ts +0 -502
- package/src/components/graph/modules/link/helper.ts +0 -105
- package/src/components/graph/modules/link/index.ts +0 -302
- package/src/components/graph/modules/node/helper.ts +0 -162
- package/src/components/graph/modules/node/index.ts +0 -343
- package/src/components/graph/modules/panel/helper.ts +0 -160
- package/src/components/graph/modules/panel/index.ts +0 -137
- package/src/components/graph/modules/shape.ts +0 -108
- package/src/components/graph/modules/zoom-levels.ts +0 -6
- package/src/components/graph/style.ts +0 -72
- package/src/components/graph/types.ts +0 -152
- package/src/components/grouped-bar/config.ts +0 -40
- package/src/components/grouped-bar/index.ts +0 -325
- package/src/components/leaflet-flow-map/config.ts +0 -60
- package/src/components/leaflet-flow-map/index.ts +0 -279
- package/src/components/leaflet-flow-map/renderer-utils.ts +0 -14
- package/src/components/leaflet-flow-map/renderer.ts +0 -146
- package/src/components/leaflet-flow-map/types.ts +0 -18
- package/src/components/leaflet-map/config.ts +0 -234
- package/src/components/leaflet-map/index.ts +0 -808
- package/src/components/leaflet-map/leaflet.css +0 -625
- package/src/components/leaflet-map/modules/clusterBackground.ts +0 -34
- package/src/components/leaflet-map/modules/donut.ts +0 -37
- package/src/components/leaflet-map/modules/map.ts +0 -178
- package/src/components/leaflet-map/modules/node.ts +0 -208
- package/src/components/leaflet-map/modules/selectionRing.ts +0 -63
- package/src/components/leaflet-map/modules/utils.ts +0 -290
- package/src/components/leaflet-map/renderer/map-style.ts +0 -24
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json +0 -35
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json +0 -35
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json +0 -2185
- package/src/components/leaflet-map/renderer/mapboxgl-layer.ts +0 -43
- package/src/components/leaflet-map/renderer/mapboxgl-utils.ts +0 -40
- package/src/components/leaflet-map/style.ts +0 -217
- package/src/components/leaflet-map/types.ts +0 -75
- package/src/components/line/config.ts +0 -34
- package/src/components/line/index.ts +0 -188
- package/src/components/line/types.ts +0 -3
- package/src/components/nested-donut/config.ts +0 -75
- package/src/components/nested-donut/index.ts +0 -176
- package/src/components/nested-donut/modules/arc.ts +0 -78
- package/src/components/nested-donut/modules/label.ts +0 -63
- package/src/components/nested-donut/style.ts +0 -82
- package/src/components/nested-donut/types.ts +0 -29
- package/src/components/sankey/config.ts +0 -195
- package/src/components/sankey/index.ts +0 -387
- package/src/components/sankey/modules/label.ts +0 -228
- package/src/components/sankey/modules/link.ts +0 -141
- package/src/components/sankey/modules/node.ts +0 -221
- package/src/components/sankey/types.ts +0 -95
- package/src/components/scatter/config.ts +0 -49
- package/src/components/scatter/index.ts +0 -220
- package/src/components/scatter/modules/point.ts +0 -123
- package/src/components/scatter/modules/utils.ts +0 -150
- package/src/components/scatter/types.ts +0 -21
- package/src/components/stacked-bar/config.ts +0 -42
- package/src/components/stacked-bar/index.ts +0 -267
- package/src/components/stacked-bar/types.ts +0 -5
- package/src/components/timeline/config.ts +0 -49
- package/src/components/timeline/index.ts +0 -302
- package/src/components/tooltip/config.ts +0 -69
- package/src/components/tooltip/index.ts +0 -220
- package/src/components/topojson-map/config.ts +0 -124
- package/src/components/topojson-map/index.ts +0 -436
- package/src/components/topojson-map/types.ts +0 -123
- package/src/components/topojson-map/utils.ts +0 -29
- package/src/components/vis-controls/config.ts +0 -16
- package/src/components/vis-controls/index.ts +0 -68
- package/src/components/vis-controls/types.ts +0 -14
- package/src/components/xy-labels/config.ts +0 -56
- package/src/components/xy-labels/index.ts +0 -109
- package/src/components/xy-labels/modules/label.ts +0 -140
- package/src/components/xy-labels/types.ts +0 -26
- package/src/components.ts +0 -56
- package/src/containers/single-container/config.ts +0 -15
- package/src/containers/single-container/index.ts +0 -150
- package/src/containers/xy-container/config.ts +0 -112
- package/src/containers/xy-container/index.ts +0 -407
- package/src/containers.ts +0 -6
- package/src/core/component/config.ts +0 -61
- package/src/core/component/index.ts +0 -154
- package/src/core/component/types.ts +0 -9
- package/src/core/config/index.ts +0 -12
- package/src/core/container/config.ts +0 -56
- package/src/core/container/index.ts +0 -136
- package/src/core/xy-component/config.ts +0 -46
- package/src/core/xy-component/index.ts +0 -90
- package/src/data-models/core.ts +0 -15
- package/src/data-models/graph.ts +0 -138
- package/src/data-models/map-graph.ts +0 -72
- package/src/data-models/map.ts +0 -18
- package/src/data-models/series.ts +0 -16
- package/src/index.ts +0 -7
- package/src/maps/china-provinces.json +0 -1
- package/src/maps/fr-regions.json +0 -1
- package/src/maps/germany-regions.json +0 -1
- package/src/maps/ind-regions.json +0 -1
- package/src/maps/uk-regions.json +0 -1
- package/src/maps/us-counties.json +0 -1
- package/src/maps/us-states.json +0 -1
- package/src/maps/world-110m-alpha.json +0 -1
- package/src/maps/world-simple.json +0 -1
- package/src/maps/world-simplest.json +0 -1
- package/src/maps.ts +0 -34
- package/src/styles/colors.ts +0 -28
- package/src/styles/index.ts +0 -38
- package/src/types/accessor.ts +0 -5
- package/src/types/component.ts +0 -15
- package/src/types/curve.ts +0 -62
- package/src/types/data.ts +0 -5
- package/src/types/direction.ts +0 -6
- package/src/types/graph.ts +0 -40
- package/src/types/map.ts +0 -5
- package/src/types/misc.ts +0 -10
- package/src/types/position.ts +0 -23
- package/src/types/scale.ts +0 -47
- package/src/types/shape.ts +0 -7
- package/src/types/spacing.ts +0 -6
- package/src/types/svg.ts +0 -32
- package/src/types/symbol.ts +0 -21
- package/src/types/text.ts +0 -71
- package/src/types.ts +0 -31
- package/src/utils/color.ts +0 -41
- package/src/utils/d3.ts +0 -15
- package/src/utils/data.ts +0 -328
- package/src/utils/html.ts +0 -13
- package/src/utils/map.ts +0 -29
- package/src/utils/misc.ts +0 -54
- package/src/utils/path.ts +0 -196
- package/src/utils/scale.ts +0 -1
- package/src/utils/style.ts +0 -37
- package/src/utils/svg.ts +0 -49
- package/src/utils/text.ts +0 -529
- package/src/utils/type.ts +0 -9
- package/tsconfig.json +0 -29
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { select } from 'd3-selection';
|
|
2
|
+
import { color } from 'd3-color';
|
|
3
|
+
import { smartTransition } from '../../../utils/d3.js';
|
|
4
|
+
import { trimStringMiddle, estimateTextSize } from '../../../utils/text.js';
|
|
5
|
+
import { getString, clamp } from '../../../utils/data.js';
|
|
6
|
+
import { getCSSVariableValueInPixels, rectIntersect } from '../../../utils/misc.js';
|
|
7
|
+
import { hexToBrightness } from '../../../utils/color.js';
|
|
8
|
+
import { cssvar } from '../../../utils/style.js';
|
|
9
|
+
import { getPointPos } from './utils.js';
|
|
10
|
+
import { LeafletMapPointShape } from '../types.js';
|
|
11
|
+
import { updateDonut } from './donut.js';
|
|
12
|
+
import { pointPath, donutCluster, innerLabel, innerLabelCluster, bottomLabel, pointPathCluster, pointPathRing, variables } from '../style.js';
|
|
13
|
+
|
|
14
|
+
const BOTTOM_LABEL_TOP_MARGIN = 10;
|
|
15
|
+
function createNodes(selection) {
|
|
16
|
+
selection.append('path')
|
|
17
|
+
.attr('class', pointPath)
|
|
18
|
+
.attr('id', d => `point-${d.id}`)
|
|
19
|
+
.style('opacity', 0);
|
|
20
|
+
selection.append('g')
|
|
21
|
+
.attr('class', donutCluster);
|
|
22
|
+
selection.append('text')
|
|
23
|
+
.attr('class', innerLabel)
|
|
24
|
+
.classed(innerLabelCluster, d => d.properties.cluster)
|
|
25
|
+
.attr('id', d => `label-${d.id}`)
|
|
26
|
+
.attr('dy', '0.32em');
|
|
27
|
+
selection.append('text')
|
|
28
|
+
.attr('class', bottomLabel)
|
|
29
|
+
.attr('dy', '0.32em')
|
|
30
|
+
.attr('opacity', 1);
|
|
31
|
+
}
|
|
32
|
+
function updateNodes(selection, config, leafletMap, mapMoveZoomUpdateOnly) {
|
|
33
|
+
selection.each((d, i, elements) => {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
const group = select(elements[i]);
|
|
36
|
+
const node = group.select(`.${pointPath}`);
|
|
37
|
+
const innerLabel$1 = group.select(`.${innerLabel}`);
|
|
38
|
+
const bottomLabel$1 = group.select(`.${bottomLabel}`);
|
|
39
|
+
const { x, y } = getPointPos(d, leafletMap);
|
|
40
|
+
const donutData = d.donutData;
|
|
41
|
+
const isCluster = d.properties.cluster;
|
|
42
|
+
const fromExpandedCluster = !!d.properties.expandedClusterPoint;
|
|
43
|
+
const innerLabelText = (_a = (isCluster
|
|
44
|
+
? getString(d.properties, config.clusterLabel)
|
|
45
|
+
: getString(d.properties, config.pointLabel))) !== null && _a !== void 0 ? _a : '';
|
|
46
|
+
const innerLabelColor = (_b = (isCluster
|
|
47
|
+
? getString(d.properties, config.clusterLabelColor)
|
|
48
|
+
: getString(d.properties, config.pointLabelColor))) !== null && _b !== void 0 ? _b : null;
|
|
49
|
+
const bottomLabelText = (_c = (isCluster
|
|
50
|
+
? getString(d.properties, config.clusterBottomLabel)
|
|
51
|
+
: getString(d.properties, config.pointBottomLabel))) !== null && _c !== void 0 ? _c : '';
|
|
52
|
+
const pointCursor = getString(d.properties, config.pointCursor);
|
|
53
|
+
const pointShape = getString(d.properties, config.pointShape);
|
|
54
|
+
const isRing = pointShape === LeafletMapPointShape.Ring;
|
|
55
|
+
const isCircular = (pointShape === LeafletMapPointShape.Circle) || isRing || isCluster || !pointShape;
|
|
56
|
+
// To get updated on every render call
|
|
57
|
+
const ringWidth = (isCluster && config.clusterRingWidth) || (isRing && config.pointRingWidth) || 0;
|
|
58
|
+
group.attr('transform', `translate(${x},${y})`);
|
|
59
|
+
group.select(`.${donutCluster}`)
|
|
60
|
+
.call(updateDonut, donutData, isCircular ? d.radius : 0, ringWidth);
|
|
61
|
+
node.attr('d', d.path);
|
|
62
|
+
node.style('cursor', isCluster ? 'pointer' : pointCursor);
|
|
63
|
+
bottomLabel$1.attr('transform', `translate(0,${d.radius + BOTTOM_LABEL_TOP_MARGIN})`);
|
|
64
|
+
innerLabel$1.attr('font-size', () => {
|
|
65
|
+
const fontSize = d.radius / Math.pow(innerLabelText.length, 0.4);
|
|
66
|
+
return clamp(fontSize, fontSize, 16);
|
|
67
|
+
});
|
|
68
|
+
if (mapMoveZoomUpdateOnly)
|
|
69
|
+
return;
|
|
70
|
+
// Updates required only when data changes
|
|
71
|
+
node
|
|
72
|
+
.classed(pointPathCluster, isCluster)
|
|
73
|
+
.classed(pointPathRing, isRing)
|
|
74
|
+
.style('fill', d.color)
|
|
75
|
+
.style('stroke', d.color) // being used for hover
|
|
76
|
+
.style('stroke-width', ringWidth)
|
|
77
|
+
.style('opacity', 1);
|
|
78
|
+
innerLabel$1
|
|
79
|
+
.text(innerLabelText || null)
|
|
80
|
+
.attr('visibility', innerLabelText ? null : 'hidden')
|
|
81
|
+
.style('fill', () => {
|
|
82
|
+
var _a;
|
|
83
|
+
if (innerLabelColor)
|
|
84
|
+
return innerLabelColor;
|
|
85
|
+
// Determine the label color based on the point brightness
|
|
86
|
+
const c = getComputedStyle(node.node()).fill;
|
|
87
|
+
const hex = (_a = color(c)) === null || _a === void 0 ? void 0 : _a.hex();
|
|
88
|
+
if (!hex)
|
|
89
|
+
return null;
|
|
90
|
+
const brightness = hexToBrightness(hex);
|
|
91
|
+
return brightness > 0.5
|
|
92
|
+
? (isCluster ? cssvar(variables.mapClusterInnerLabelTextColorDark) : cssvar(variables.mapPointInnerLabelTextColorDark))
|
|
93
|
+
: (isCluster ? cssvar(variables.mapClusterInnerLabelTextColorLight) : cssvar(variables.mapPointInnerLabelTextColorLight));
|
|
94
|
+
});
|
|
95
|
+
const bottomLabelTextTrimmed = trimStringMiddle(bottomLabelText, 15);
|
|
96
|
+
bottomLabel$1
|
|
97
|
+
.text(bottomLabelTextTrimmed)
|
|
98
|
+
.attr('font-size', getCSSVariableValueInPixels(cssvar(variables.mapPointBottomLabelFontSize), selection.node()))
|
|
99
|
+
.attr('visibility', fromExpandedCluster ? 'hidden' : null);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function collideLabels(selection, leafletMap) {
|
|
103
|
+
selection.each((datum1, i, elements) => {
|
|
104
|
+
const group1HTMLNode = elements[i];
|
|
105
|
+
const group1 = select(group1HTMLNode);
|
|
106
|
+
const label1 = group1.select(`.${bottomLabel}`);
|
|
107
|
+
// eslint-disable-next-line dot-notation
|
|
108
|
+
group1HTMLNode['labelVisible'] = true;
|
|
109
|
+
// Calculate bounding rect of point's bottom label
|
|
110
|
+
const bottomLabelFontSizePx = getCSSVariableValueInPixels(cssvar(variables.mapPointBottomLabelFontSize), selection.node());
|
|
111
|
+
const p1Pos = getPointPos(datum1, leafletMap);
|
|
112
|
+
const label1Size = estimateTextSize(label1, bottomLabelFontSizePx, 0.32, true, 0.6);
|
|
113
|
+
const label1BoundingRect = {
|
|
114
|
+
x: p1Pos.x - label1Size.width / 2,
|
|
115
|
+
y: p1Pos.y - label1Size.height / 2 + datum1.radius + BOTTOM_LABEL_TOP_MARGIN,
|
|
116
|
+
width: label1Size.width,
|
|
117
|
+
height: label1Size.height,
|
|
118
|
+
};
|
|
119
|
+
for (let j = 0; j < elements.length; j += 1) {
|
|
120
|
+
if (i === j)
|
|
121
|
+
continue;
|
|
122
|
+
const group2HTMLNode = elements[j];
|
|
123
|
+
const group2 = select(group2HTMLNode);
|
|
124
|
+
const label2 = group2.select(`.${bottomLabel}`);
|
|
125
|
+
const datum2 = group2.datum();
|
|
126
|
+
// Calculate bounding rect of the second point's circle
|
|
127
|
+
const p2Pos = getPointPos(datum2, leafletMap);
|
|
128
|
+
const point2BoundingRect = {
|
|
129
|
+
x: p2Pos.x - datum2.radius,
|
|
130
|
+
y: p2Pos.y - datum2.radius,
|
|
131
|
+
width: 2 * datum2.radius,
|
|
132
|
+
height: 2 * datum2.radius,
|
|
133
|
+
};
|
|
134
|
+
let intersect = rectIntersect(label1BoundingRect, point2BoundingRect);
|
|
135
|
+
// If there's not intersection, check a collision with the second point's label
|
|
136
|
+
// eslint-disable-next-line dot-notation
|
|
137
|
+
const label2Visible = group2HTMLNode['labelVisible'];
|
|
138
|
+
if (!intersect && label2Visible) {
|
|
139
|
+
const label2Size = estimateTextSize(label2, bottomLabelFontSizePx, 0.32, true, 0.6);
|
|
140
|
+
intersect = rectIntersect(label1BoundingRect, {
|
|
141
|
+
x: p2Pos.x - label2Size.width / 2,
|
|
142
|
+
y: p2Pos.y + datum2.radius + BOTTOM_LABEL_TOP_MARGIN - label2Size.height / 2,
|
|
143
|
+
width: label2Size.width,
|
|
144
|
+
height: label2Size.height,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (intersect) {
|
|
148
|
+
// eslint-disable-next-line dot-notation
|
|
149
|
+
group1HTMLNode['labelVisible'] = false;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// eslint-disable-next-line dot-notation
|
|
154
|
+
smartTransition(label1, 0).attr('opacity', group1HTMLNode['labelVisible'] ? 1 : 0);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function removeNodes(selection) {
|
|
158
|
+
selection.remove();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export { collideLabels, createNodes, removeNodes, updateNodes };
|
|
162
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sources":["../../../../src/components/leaflet-map/modules/node.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { color } from 'd3-color'\nimport type L from 'leaflet'\n\n// Types\nimport { Rect } from 'types/misc'\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\nimport { estimateTextSize, trimStringMiddle } from 'utils/text'\nimport { clamp, getString } from 'utils/data'\nimport { getCSSVariableValueInPixels, rectIntersect } from 'utils/misc'\nimport { hexToBrightness } from 'utils/color'\nimport { cssvar } from 'utils/style'\nimport { getPointPos } from './utils'\n\n\n// Local Types\nimport { LeafletMapPointDatum, LeafletMapClusterDatum, LeafletMapPoint, LeafletMapPointShape } from '../types'\n\n// Modules\nimport { updateDonut } from './donut'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\nimport * as s from '../style'\n\nconst BOTTOM_LABEL_TOP_MARGIN = 10\n\nexport function createNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>\n): void {\n selection.append('path')\n .attr('class', s.pointPath)\n .attr('id', d => `point-${d.id}`)\n .style('opacity', 0)\n\n selection.append('g')\n .attr('class', s.donutCluster)\n\n selection.append('text')\n .attr('class', s.innerLabel)\n .classed(s.innerLabelCluster, d => (d.properties as LeafletMapClusterDatum<D>).cluster)\n .attr('id', d => `label-${d.id}`)\n .attr('dy', '0.32em')\n\n selection.append('text')\n .attr('class', s.bottomLabel)\n .attr('dy', '0.32em')\n .attr('opacity', 1)\n}\n\nexport function updateNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>,\n config: LeafletMapConfigInterface<D>,\n leafletMap: L.Map,\n mapMoveZoomUpdateOnly: boolean\n): void {\n selection.each((d, i, elements) => {\n const group = select(elements[i])\n const node: Selection<SVGPathElement, any, SVGGElement, any> = group.select(`.${s.pointPath}`)\n const innerLabel: Selection<SVGTextElement, any, SVGElement, any> = group.select(`.${s.innerLabel}`)\n const bottomLabel: Selection<SVGTextElement, any, SVGElement, any> = group.select(`.${s.bottomLabel}`)\n\n const { x, y } = getPointPos(d, leafletMap)\n const donutData = d.donutData\n const isCluster = (d.properties as LeafletMapClusterDatum<D>).cluster\n const fromExpandedCluster = !!(d.properties as LeafletMapPointDatum<D>).expandedClusterPoint\n\n const innerLabelText = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterLabel)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointLabel)\n ) ?? ''\n const innerLabelColor = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterLabelColor)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointLabelColor)\n ) ?? null\n const bottomLabelText = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterBottomLabel)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointBottomLabel)\n ) ?? ''\n const pointCursor = getString(d.properties as LeafletMapPointDatum<D>, config.pointCursor)\n const pointShape = getString(d.properties as LeafletMapPointDatum<D>, config.pointShape)\n const isRing = pointShape === LeafletMapPointShape.Ring\n const isCircular = (pointShape === LeafletMapPointShape.Circle) || isRing || isCluster || !pointShape\n\n // To get updated on every render call\n const ringWidth = (isCluster && config.clusterRingWidth) || (isRing && config.pointRingWidth) || 0\n group.attr('transform', `translate(${x},${y})`)\n group.select<SVGGElement>(`.${s.donutCluster}`)\n .call(updateDonut, donutData, isCircular ? d.radius : 0, ringWidth)\n\n node.attr('d', d.path)\n node.style('cursor', isCluster ? 'pointer' : pointCursor)\n bottomLabel.attr('transform', `translate(0,${d.radius + BOTTOM_LABEL_TOP_MARGIN})`)\n innerLabel.attr('font-size', () => {\n const fontSize = d.radius / Math.pow(innerLabelText.length, 0.4)\n return clamp(fontSize, fontSize, 16)\n })\n\n if (mapMoveZoomUpdateOnly) return\n\n // Updates required only when data changes\n node\n .classed(s.pointPathCluster, isCluster)\n .classed(s.pointPathRing, isRing)\n .style('fill', d.color)\n .style('stroke', d.color) // being used for hover\n .style('stroke-width', ringWidth)\n .style('opacity', 1)\n\n innerLabel\n .text(innerLabelText || null)\n .attr('visibility', innerLabelText ? null : 'hidden')\n .style('fill', () => {\n if (innerLabelColor) return innerLabelColor\n\n // Determine the label color based on the point brightness\n const c = getComputedStyle(node.node()).fill\n const hex = color(c)?.hex()\n if (!hex) return null\n\n const brightness = hexToBrightness(hex)\n return brightness > 0.5\n ? (isCluster ? cssvar(s.variables.mapClusterInnerLabelTextColorDark) : cssvar(s.variables.mapPointInnerLabelTextColorDark))\n : (isCluster ? cssvar(s.variables.mapClusterInnerLabelTextColorLight) : cssvar(s.variables.mapPointInnerLabelTextColorLight))\n })\n\n const bottomLabelTextTrimmed = trimStringMiddle(bottomLabelText, 15)\n bottomLabel\n .text(bottomLabelTextTrimmed)\n .attr('font-size', getCSSVariableValueInPixels(cssvar(s.variables.mapPointBottomLabelFontSize), selection.node()))\n .attr('visibility', fromExpandedCluster ? 'hidden' : null)\n })\n}\n\nexport function collideLabels<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>,\n leafletMap: L.Map\n): void {\n selection.each((datum1: LeafletMapPoint<D>, i, elements) => {\n const group1HTMLNode = elements[i]\n const group1 = select(group1HTMLNode)\n const label1: Selection<SVGTextElement, any, SVGElement, any> = group1.select(`.${s.bottomLabel}`)\n // eslint-disable-next-line dot-notation\n group1HTMLNode['labelVisible'] = true\n\n // Calculate bounding rect of point's bottom label\n const bottomLabelFontSizePx = getCSSVariableValueInPixels(cssvar(s.variables.mapPointBottomLabelFontSize), selection.node())\n const p1Pos = getPointPos(datum1, leafletMap)\n const label1Size = estimateTextSize(label1, bottomLabelFontSizePx, 0.32, true, 0.6)\n const label1BoundingRect: Rect = {\n x: p1Pos.x - label1Size.width / 2,\n y: p1Pos.y - label1Size.height / 2 + datum1.radius + BOTTOM_LABEL_TOP_MARGIN,\n width: label1Size.width,\n height: label1Size.height,\n }\n\n for (let j = 0; j < elements.length; j += 1) {\n if (i === j) continue\n const group2HTMLNode = elements[j]\n const group2 = select(group2HTMLNode)\n const label2: Selection<SVGTextElement, any, SVGElement, any> = group2.select(`.${s.bottomLabel}`)\n const datum2 = group2.datum() as LeafletMapPoint<D>\n\n // Calculate bounding rect of the second point's circle\n const p2Pos = getPointPos(datum2, leafletMap)\n const point2BoundingRect = {\n x: p2Pos.x - datum2.radius,\n y: p2Pos.y - datum2.radius,\n width: 2 * datum2.radius,\n height: 2 * datum2.radius,\n }\n\n let intersect = rectIntersect(label1BoundingRect, point2BoundingRect)\n\n // If there's not intersection, check a collision with the second point's label\n // eslint-disable-next-line dot-notation\n const label2Visible = group2HTMLNode['labelVisible']\n if (!intersect && label2Visible) {\n const label2Size = estimateTextSize(label2, bottomLabelFontSizePx, 0.32, true, 0.6)\n intersect = rectIntersect(label1BoundingRect, {\n x: p2Pos.x - label2Size.width / 2,\n y: p2Pos.y + datum2.radius + BOTTOM_LABEL_TOP_MARGIN - label2Size.height / 2,\n width: label2Size.width,\n height: label2Size.height,\n })\n }\n\n if (intersect) {\n // eslint-disable-next-line dot-notation\n group1HTMLNode['labelVisible'] = false\n break\n }\n }\n\n // eslint-disable-next-line dot-notation\n smartTransition(label1, 0).attr('opacity', group1HTMLNode['labelVisible'] ? 1 : 0)\n })\n}\n\nexport function removeNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>\n): void {\n selection.remove()\n}\n"],"names":["s.pointPath","s.donutCluster","s.innerLabel","s.innerLabelCluster","s.bottomLabel","innerLabel","bottomLabel","s.pointPathCluster","s.pointPathRing","s.variables"],"mappings":";;;;;;;;;;;;;AA6BA,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAE5B,SAAU,WAAW,CACzB,SAA2E,EAAA;AAE3E,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEA,SA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,kBAAkB,CAAC,CAAA;;;AAIrE,YAAA,MAAM,aAAa,GAAG,cAAc,CAAC,cAAc,CAAC,CAAA;AACpD,YAAA,IAAI,CAAC,SAAS,IAAI,aAAa,EAAE;AAC/B,gBAAA,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;AACnF,gBAAA,SAAS,GAAG,aAAa,CAAC,kBAAkB,EAAE;oBAC5C,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,GAAG,CAAC;AACjC,oBAAA,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,uBAAuB,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC;oBAC5E,KAAK,EAAE,UAAU,CAAC,KAAK;oBACvB,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,iBAAA,CAAC,CAAA;AACH,aAAA;AAED,YAAA,IAAI,SAAS,EAAE;;AAEb,gBAAA,cAAc,CAAC,cAAc,CAAC,GAAG,KAAK,CAAA;gBACtC,MAAK;AACN,aAAA;AACF,SAAA;;QAGD,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;AACpF,KAAC,CAAC,CAAA;AACJ,CAAC;AAEK,SAAU,WAAW,CACzB,SAA2E,EAAA;IAE3E,SAAS,CAAC,MAAM,EAAE,CAAA;AACpB;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type L from 'leaflet';
|
|
2
|
+
import { Selection } from 'd3-selection';
|
|
3
|
+
import { GenericDataRecord } from "../../../types/data";
|
|
4
|
+
import { LeafletMapPoint } from '../types';
|
|
5
|
+
import { LeafletMapConfigInterface } from '../config';
|
|
6
|
+
export declare function createNodeSelectionRing(selection: Selection<SVGGElement, unknown, SVGElement, undefined>): void;
|
|
7
|
+
export declare function updateNodeSelectionRing<D extends GenericDataRecord>(selection: Selection<SVGGElement, unknown, SVGElement, undefined>, selectedPoint: LeafletMapPoint<D>, pointData: LeafletMapPoint<D>[], config: LeafletMapConfigInterface<D>, leafletMap: L.Map): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { getString } from '../../../utils/data.js';
|
|
2
|
+
import { getPointPos } from './utils.js';
|
|
3
|
+
import { pointSelection, pointSelectionRing } from '../style.js';
|
|
4
|
+
|
|
5
|
+
// Utils
|
|
6
|
+
function createNodeSelectionRing(selection) {
|
|
7
|
+
selection.datum({ _zIndex: 3 });
|
|
8
|
+
selection.append('path').attr('class', pointSelection);
|
|
9
|
+
}
|
|
10
|
+
function updateNodeSelectionRing(selection, selectedPoint, pointData, config, leafletMap) {
|
|
11
|
+
selection.attr('class', pointSelectionRing);
|
|
12
|
+
const pointSelection$1 = selection.select(`.${pointSelection}`);
|
|
13
|
+
if (selectedPoint) {
|
|
14
|
+
const isCluster = selectedPoint.isCluster;
|
|
15
|
+
const selectedPointId = getString(selectedPoint.properties, config.pointId);
|
|
16
|
+
const foundPoint = pointData.find(d => isCluster
|
|
17
|
+
? (d.id === selectedPoint.id)
|
|
18
|
+
: (selectedPointId && (getString(d.properties, config.pointId) === selectedPointId)));
|
|
19
|
+
selection
|
|
20
|
+
.attr('transform', d => {
|
|
21
|
+
const { x, y } = getPointPos(foundPoint !== null && foundPoint !== void 0 ? foundPoint : selectedPoint, leafletMap);
|
|
22
|
+
return `translate(${x},${y})`;
|
|
23
|
+
})
|
|
24
|
+
.classed(`${selectedPoint.properties.shape}`, true);
|
|
25
|
+
pointSelection$1
|
|
26
|
+
.classed('active', Boolean(foundPoint))
|
|
27
|
+
.attr('d', foundPoint ? foundPoint.path : null)
|
|
28
|
+
.style('fill', 'transparent')
|
|
29
|
+
.style('stroke-width', 1)
|
|
30
|
+
.style('stroke', d => {
|
|
31
|
+
const node = foundPoint || selectedPoint;
|
|
32
|
+
return node === null || node === void 0 ? void 0 : node.color;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
pointSelection$1.classed('active', false);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { createNodeSelectionRing, updateNodeSelectionRing };
|
|
41
|
+
//# sourceMappingURL=selectionRing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectionRing.js","sources":["../../../../src/components/leaflet-map/modules/selectionRing.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { Selection } from 'd3-selection'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { getString } from 'utils/data'\nimport { getPointPos } from './utils'\n\n// Local Types\nimport { LeafletMapPoint, LeafletMapPointDatum } from '../types'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\nimport * as s from '../style'\n\n\nexport function createNodeSelectionRing (\n selection: Selection<SVGGElement, unknown, SVGElement, undefined>\n): void {\n selection.datum({ _zIndex: 3 })\n selection.append('path').attr('class', s.pointSelection)\n}\n\nexport function updateNodeSelectionRing<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, unknown, SVGElement, undefined>,\n selectedPoint: LeafletMapPoint<D>,\n pointData: LeafletMapPoint<D>[],\n config: LeafletMapConfigInterface<D>,\n leafletMap: L.Map\n): void {\n selection.attr('class', s.pointSelectionRing)\n const pointSelection = selection.select(`.${s.pointSelection}`)\n if (selectedPoint) {\n const isCluster = selectedPoint.isCluster\n const selectedPointId: string | undefined = getString(selectedPoint.properties as LeafletMapPointDatum<D>, config.pointId)\n const foundPoint = pointData.find(d =>\n isCluster\n ? (d.id === selectedPoint.id)\n : (selectedPointId && (getString(d.properties as LeafletMapPointDatum<D>, config.pointId) === selectedPointId))\n )\n selection\n .attr('transform', d => {\n const { x, y } = getPointPos<D>(foundPoint ?? selectedPoint, leafletMap)\n return `translate(${x},${y})`\n })\n .classed(`${(selectedPoint.properties as LeafletMapPointDatum<D>).shape}`, true)\n\n pointSelection\n .classed('active', Boolean(foundPoint))\n .attr('d', foundPoint ? foundPoint.path : null)\n .style('fill', 'transparent')\n .style('stroke-width', 1)\n .style('stroke', d => {\n const node = foundPoint || selectedPoint\n return node?.color\n })\n } else {\n pointSelection.classed('active', false)\n }\n}\n"],"names":["s.pointSelection","s.pointSelectionRing","pointSelection"],"mappings":";;;;AAMA;AAaM,SAAU,uBAAuB,CACrC,SAAiE,EAAA;IAEjE,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;AAC/B,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,EAAEA,cAAgB,CAAC,CAAA;AAC1D,CAAC;AAEK,SAAU,uBAAuB,CACrC,SAAiE,EACjE,aAAiC,EACjC,SAA+B,EAC/B,MAAoC,EACpC,UAAiB,EAAA;IAEjB,SAAS,CAAC,IAAI,CAAC,OAAO,EAAEC,kBAAoB,CAAC,CAAA;AAC7C,IAAA,MAAMC,gBAAc,GAAG,SAAS,CAAC,MAAM,CAAC,CAAI,CAAA,EAAAF,cAAgB,CAAE,CAAA,CAAC,CAAA;AAC/D,IAAA,IAAI,aAAa,EAAE;AACjB,QAAA,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,CAAA;AACzC,QAAA,MAAM,eAAe,GAAuB,SAAS,CAAC,aAAa,CAAC,UAAqC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;QAC1H,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,IACjC,SAAS;eACJ,CAAC,CAAC,EAAE,KAAK,aAAa,CAAC,EAAE;eACzB,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,UAAqC,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,eAAe,CAAC,CAAC,CAClH,CAAA;QACD,SAAS;AACN,aAAA,IAAI,CAAC,WAAW,EAAE,CAAC,IAAG;AACrB,YAAA,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,WAAW,CAAI,UAAU,KAAV,IAAA,IAAA,UAAU,cAAV,UAAU,GAAI,aAAa,EAAE,UAAU,CAAC,CAAA;AACxE,YAAA,OAAO,CAAa,UAAA,EAAA,CAAC,CAAI,CAAA,EAAA,CAAC,GAAG,CAAA;AAC/B,SAAC,CAAC;aACD,OAAO,CAAC,CAAI,EAAA,aAAa,CAAC,UAAsC,CAAC,KAAK,CAAE,CAAA,EAAE,IAAI,CAAC,CAAA;QAElFE,gBAAc;AACX,aAAA,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,aAAA,IAAI,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;AAC9C,aAAA,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC;AAC5B,aAAA,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;AACxB,aAAA,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAG;AACnB,YAAA,MAAM,IAAI,GAAG,UAAU,IAAI,aAAa,CAAA;AACxC,YAAA,OAAO,IAAI,KAAJ,IAAA,IAAA,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAA;AACpB,SAAC,CAAC,CAAA;AACL,KAAA;AAAM,SAAA;AACL,QAAAA,gBAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AACxC,KAAA;AACH;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type L from 'leaflet';
|
|
2
|
+
import Supercluster, { ClusterFeature, PointFeature } from 'supercluster';
|
|
3
|
+
import { NumericAccessor, StringAccessor } from "../../../types/accessor";
|
|
4
|
+
import { GenericDataRecord } from "../../../types/data";
|
|
5
|
+
import { LeafletMapPoint, LeafletMapPointShape, LeafletMapPieDatum, LeafletMapPointStyles, PointExpandedClusterProperties, LeafletMapPointDatum, LeafletMapClusterDatum } from '../types';
|
|
6
|
+
import { LeafletMapConfig } from '../config';
|
|
7
|
+
export declare function bBoxMerge(bBoxArray: ({
|
|
8
|
+
x1: number;
|
|
9
|
+
x2: number;
|
|
10
|
+
y1: number;
|
|
11
|
+
y2: number;
|
|
12
|
+
})[]): {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
export declare const getNextZoomLevelOnClusterClick: (level: number) => number;
|
|
19
|
+
export declare function projectPoint<D extends GenericDataRecord>(geoJSONPoint: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, leafletMap: L.Map): {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function getPointRadius<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>> | PointFeature<PointExpandedClusterProperties<D>>, pointRadius: NumericAccessor<D>, zoomLevel: number): number;
|
|
24
|
+
export declare function getPointPos<D extends GenericDataRecord>(point: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, leafletMap: L.Map): {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
export declare function getPointDisplayOrder<D extends GenericDataRecord>(d: LeafletMapPoint<D>, pointStatus: StringAccessor<LeafletMapPointDatum<D> | LeafletMapClusterDatum<D>>, colorMap: LeafletMapPointStyles<D>): number;
|
|
29
|
+
export declare function toGeoJSONPoint<D extends GenericDataRecord>(d: D, pointLatitude: NumericAccessor<D>, pointLongitude: NumericAccessor<D>): PointFeature<D>;
|
|
30
|
+
export declare function calculateClusterIndex<D extends GenericDataRecord>(data: D[], config: LeafletMapConfig<D>, maxClusterZoomLevel?: number): Supercluster<D>;
|
|
31
|
+
export declare function getNodePathData({ x, y }: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
}, radius: number, shape: LeafletMapPointShape): string;
|
|
35
|
+
export declare function getDonutData<D extends GenericDataRecord>(d: LeafletMapClusterDatum<D> | LeafletMapPointDatum<D>, colorMap: LeafletMapPointStyles<D>): LeafletMapPieDatum[];
|
|
36
|
+
export declare function geoJsonPointToScreenPoint<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, i: number, leafletMap: L.Map, config: LeafletMapConfig<D>): LeafletMapPoint<D>;
|
|
37
|
+
export declare function shouldClusterExpand<D extends GenericDataRecord>(cluster: LeafletMapPoint<D>, zoomLevel: number, midLevel?: number, maxLevel?: number, maxClusterZoomLevel?: number): boolean;
|
|
38
|
+
export declare function findPointAndClusterByPointId<D extends GenericDataRecord>(points: LeafletMapPoint<D>[], id: string, pointId: StringAccessor<D>): {
|
|
39
|
+
point: PointFeature<D> | undefined;
|
|
40
|
+
cluster: LeafletMapPoint<D> | undefined;
|
|
41
|
+
};
|
|
42
|
+
export declare function getNodeRelativePosition<D extends GenericDataRecord>(d: LeafletMapPoint<D>, leafletMap: L.Map): {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
};
|
|
46
|
+
export declare function getClusterRadius<D extends GenericDataRecord>(cluster: {
|
|
47
|
+
points: PointFeature<PointExpandedClusterProperties<D>>[];
|
|
48
|
+
cluster: LeafletMapPoint<D>;
|
|
49
|
+
}): number;
|
|
50
|
+
export declare function getClustersAndPoints<D extends GenericDataRecord>(clusterIndex: Supercluster<D>, leafletMap: L.Map, customBounds?: [number, number, number, number]): (ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<D>)[];
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { max, min } from 'd3-array';
|
|
2
|
+
import Supercluster from 'supercluster';
|
|
3
|
+
import { clamp, getNumber, getString } from '../../../utils/data.js';
|
|
4
|
+
import { getColor } from '../../../utils/color.js';
|
|
5
|
+
import { circlePath, polygon } from '../../../utils/path.js';
|
|
6
|
+
import { getHTMLTransform } from '../../../utils/html.js';
|
|
7
|
+
import { LeafletMapPointShape } from '../types.js';
|
|
8
|
+
|
|
9
|
+
function bBoxMerge(bBoxArray) {
|
|
10
|
+
let box = { x1: 0, x2: 0, y1: 0, y2: 0 };
|
|
11
|
+
bBoxArray.forEach(coords => {
|
|
12
|
+
if (!box) {
|
|
13
|
+
box = Object.assign({}, coords);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
if (box.x1 > coords.x1)
|
|
17
|
+
box.x1 = coords.x1;
|
|
18
|
+
if (box.y1 > coords.y1)
|
|
19
|
+
box.y1 = coords.y1;
|
|
20
|
+
if (box.x2 < coords.x2)
|
|
21
|
+
box.x2 = coords.x2;
|
|
22
|
+
if (box.y2 < coords.y2)
|
|
23
|
+
box.y2 = coords.y2;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
x: box.x1,
|
|
28
|
+
y: box.y1,
|
|
29
|
+
width: box.x2 - box.x1,
|
|
30
|
+
height: box.y2 - box.y1,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const getNextZoomLevelOnClusterClick = (level) => clamp(1 + level * 1.5, level, 12);
|
|
34
|
+
function projectPoint(geoJSONPoint, leafletMap) {
|
|
35
|
+
const lat = geoJSONPoint.geometry.coordinates[1];
|
|
36
|
+
const lon = geoJSONPoint.geometry.coordinates[0];
|
|
37
|
+
const projected = leafletMap.latLngToLayerPoint([lat, lon]);
|
|
38
|
+
return projected;
|
|
39
|
+
}
|
|
40
|
+
function getPointRadius(geoPoint, pointRadius, zoomLevel) {
|
|
41
|
+
const isDynamic = !pointRadius;
|
|
42
|
+
const radius = isDynamic ? 1 + 2 * Math.pow(zoomLevel, 0.80) : getNumber(geoPoint.properties, pointRadius);
|
|
43
|
+
const isCluster = geoPoint.properties.cluster;
|
|
44
|
+
return (isCluster && isDynamic)
|
|
45
|
+
? clamp(Math.pow(geoPoint.properties.point_count, 0.35) * radius, radius * 1.1, radius * 3)
|
|
46
|
+
: radius;
|
|
47
|
+
}
|
|
48
|
+
function getPointPos(point, leafletMap) {
|
|
49
|
+
const properties = point.properties;
|
|
50
|
+
const isFromCluster = !!(properties).expandedClusterPoint;
|
|
51
|
+
if (isFromCluster) {
|
|
52
|
+
const { x, y } = projectPoint(properties.expandedClusterPoint, leafletMap);
|
|
53
|
+
return {
|
|
54
|
+
x: x + properties.dx,
|
|
55
|
+
y: y + properties.dy,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return projectPoint(point, leafletMap);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function getPointDisplayOrder(d, pointStatus, colorMap) {
|
|
63
|
+
const status = getString(d.properties, pointStatus);
|
|
64
|
+
const statusList = Object.keys(colorMap);
|
|
65
|
+
return Object.keys(statusList).indexOf(status);
|
|
66
|
+
}
|
|
67
|
+
function toGeoJSONPoint(d, pointLatitude, pointLongitude) {
|
|
68
|
+
const lat = getNumber(d, pointLatitude);
|
|
69
|
+
const lon = getNumber(d, pointLongitude);
|
|
70
|
+
return {
|
|
71
|
+
type: 'Feature',
|
|
72
|
+
properties: Object.assign({}, d),
|
|
73
|
+
geometry: {
|
|
74
|
+
type: 'Point',
|
|
75
|
+
coordinates: [lon, lat],
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function calculateClusterIndex(data, config, maxClusterZoomLevel = 23) {
|
|
80
|
+
const { colorMap, pointShape, pointLatitude, pointLongitude, clusteringDistance } = config;
|
|
81
|
+
return new Supercluster({
|
|
82
|
+
radius: clusteringDistance,
|
|
83
|
+
maxZoom: maxClusterZoomLevel,
|
|
84
|
+
map: (d) => {
|
|
85
|
+
const shape = getString(d, pointShape);
|
|
86
|
+
const clusterPoint = { shape };
|
|
87
|
+
for (const key of Object.keys(colorMap)) {
|
|
88
|
+
clusterPoint[key] = d[key] || 0;
|
|
89
|
+
}
|
|
90
|
+
return clusterPoint;
|
|
91
|
+
},
|
|
92
|
+
reduce: (acc, clusterPoint) => {
|
|
93
|
+
var _a, _b;
|
|
94
|
+
acc.shape = acc.shape === clusterPoint.shape ? acc.shape : LeafletMapPointShape.Circle;
|
|
95
|
+
acc.value = ((_a = acc.value) !== null && _a !== void 0 ? _a : 0) + ((_b = clusterPoint.value) !== null && _b !== void 0 ? _b : 0);
|
|
96
|
+
for (const key of Object.keys(colorMap)) {
|
|
97
|
+
acc[key] += clusterPoint[key];
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
}).load(data.map(d => toGeoJSONPoint(d, pointLatitude, pointLongitude)));
|
|
101
|
+
}
|
|
102
|
+
function getNodePathData({ x, y }, radius, shape) {
|
|
103
|
+
switch (shape) {
|
|
104
|
+
case LeafletMapPointShape.Triangle:
|
|
105
|
+
return polygon(radius * 2, 3);
|
|
106
|
+
case LeafletMapPointShape.Square:
|
|
107
|
+
return polygon(radius * 2, 4);
|
|
108
|
+
case LeafletMapPointShape.Circle:
|
|
109
|
+
case LeafletMapPointShape.Ring:
|
|
110
|
+
default:
|
|
111
|
+
return circlePath(x, y, radius);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function getDonutData(d, colorMap) {
|
|
115
|
+
return Object.keys(colorMap).map(key => ({
|
|
116
|
+
name: key,
|
|
117
|
+
value: d[key],
|
|
118
|
+
color: colorMap[key].color,
|
|
119
|
+
className: colorMap[key].className,
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
function geoJsonPointToScreenPoint(geoPoint, i, leafletMap, config) {
|
|
123
|
+
var _a;
|
|
124
|
+
const zoomLevel = leafletMap.getZoom();
|
|
125
|
+
const isCluster = geoPoint.properties.cluster;
|
|
126
|
+
const clusterIndex = geoPoint.properties.clusterIndex;
|
|
127
|
+
const clusterPoints = isCluster ? clusterIndex.getLeaves(geoPoint.properties.cluster_id, Infinity).map(d => d.properties) : undefined;
|
|
128
|
+
const { x, y } = getPointPos(geoPoint, leafletMap);
|
|
129
|
+
const id = isCluster ? `cluster-${geoPoint.id}` : ((_a = getString(geoPoint.properties, config.pointId)) !== null && _a !== void 0 ? _a : geoPoint.geometry.coordinates.join(''));
|
|
130
|
+
const pointColor = getColor(geoPoint.properties, isCluster ? config.clusterColor : config.pointColor);
|
|
131
|
+
const radius = getPointRadius(geoPoint, isCluster ? config.clusterRadius : config.pointRadius, zoomLevel);
|
|
132
|
+
const shape = isCluster ? LeafletMapPointShape.Circle : getString(geoPoint.properties, config.pointShape);
|
|
133
|
+
const isRing = shape === LeafletMapPointShape.Ring;
|
|
134
|
+
const donutData = getDonutData(geoPoint.properties, config.colorMap);
|
|
135
|
+
const maxValue = max(donutData, d => d.value);
|
|
136
|
+
const maxValueIndex = donutData.map(d => d.value).indexOf(maxValue);
|
|
137
|
+
const biggestDatum = donutData[maxValueIndex !== null && maxValueIndex !== void 0 ? maxValueIndex : 0];
|
|
138
|
+
const color = isCluster ? pointColor
|
|
139
|
+
: (isRing ? null : (pointColor !== null && pointColor !== void 0 ? pointColor : biggestDatum === null || biggestDatum === void 0 ? void 0 : biggestDatum.color));
|
|
140
|
+
const bbox = { x1: x - radius, y1: y - radius, x2: x + radius, y2: y + radius };
|
|
141
|
+
const path = getNodePathData({ x: 0, y: 0 }, radius, shape);
|
|
142
|
+
const _zIndex = 0;
|
|
143
|
+
const screenPoint = Object.assign(Object.assign({}, geoPoint), { id,
|
|
144
|
+
bbox,
|
|
145
|
+
radius,
|
|
146
|
+
donutData,
|
|
147
|
+
path,
|
|
148
|
+
color,
|
|
149
|
+
isCluster,
|
|
150
|
+
clusterIndex,
|
|
151
|
+
clusterPoints,
|
|
152
|
+
_zIndex });
|
|
153
|
+
return screenPoint;
|
|
154
|
+
}
|
|
155
|
+
function shouldClusterExpand(cluster, zoomLevel, midLevel = 4, maxLevel = 8, maxClusterZoomLevel = 23) {
|
|
156
|
+
if (!cluster)
|
|
157
|
+
return false;
|
|
158
|
+
const clusterExpansionZoomLevel = cluster.clusterIndex.getClusterExpansionZoom(cluster.properties.cluster_id);
|
|
159
|
+
return zoomLevel >= maxLevel ||
|
|
160
|
+
(zoomLevel >= midLevel && (cluster.properties.point_count < 20 || clusterExpansionZoomLevel >= maxClusterZoomLevel));
|
|
161
|
+
}
|
|
162
|
+
function findPointAndClusterByPointId(points, id, pointId) {
|
|
163
|
+
let point;
|
|
164
|
+
let cluster;
|
|
165
|
+
points.forEach(p => {
|
|
166
|
+
var _a;
|
|
167
|
+
if (p.isCluster) {
|
|
168
|
+
const leaves = (_a = p.clusterIndex.getLeaves(p.properties.cluster_id, Infinity)) !== null && _a !== void 0 ? _a : [];
|
|
169
|
+
const foundPoint = leaves.find(d => getString(d.properties, pointId) === id);
|
|
170
|
+
if (foundPoint) {
|
|
171
|
+
point = foundPoint;
|
|
172
|
+
cluster = p;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
return { point, cluster };
|
|
177
|
+
}
|
|
178
|
+
function getNodeRelativePosition(d, leafletMap) {
|
|
179
|
+
const paneTransform = getHTMLTransform(leafletMap.getPane('mapPane'));
|
|
180
|
+
const { x, y } = getPointPos(d, leafletMap);
|
|
181
|
+
return { x: x + paneTransform[0], y: y + paneTransform[1] };
|
|
182
|
+
}
|
|
183
|
+
function getClusterRadius(cluster) {
|
|
184
|
+
const { points } = cluster;
|
|
185
|
+
const minX = min(points.map(d => d.properties.dx - d.properties.r));
|
|
186
|
+
const maxX = max(points.map(d => d.properties.dx + d.properties.r));
|
|
187
|
+
const minY = min(points.map(d => d.properties.dy - d.properties.r));
|
|
188
|
+
const maxY = max(points.map(d => d.properties.dy + d.properties.r));
|
|
189
|
+
return Math.sqrt(Math.pow((maxX - minX), 2) + Math.pow((maxY - minY), 2)) * 0.5;
|
|
190
|
+
}
|
|
191
|
+
function getClustersAndPoints(clusterIndex, leafletMap, customBounds) {
|
|
192
|
+
const leafletBounds = leafletMap.getBounds();
|
|
193
|
+
const southWest = leafletBounds.getSouthWest();
|
|
194
|
+
const northEast = leafletBounds.getNorthEast();
|
|
195
|
+
const bounds = customBounds || [southWest.lng, southWest.lat, northEast.lng, northEast.lat];
|
|
196
|
+
const zoom = Math.round(leafletMap.getZoom());
|
|
197
|
+
const points = clusterIndex.getClusters(bounds, zoom); // as ClusterFeature<LeafletMapPointDatum<D>>[]
|
|
198
|
+
for (const p of points) {
|
|
199
|
+
const point = p;
|
|
200
|
+
const isCluster = point.properties.cluster;
|
|
201
|
+
if (isCluster) {
|
|
202
|
+
point.properties.clusterIndex = clusterIndex;
|
|
203
|
+
point.properties.clusterPoints = clusterIndex.getLeaves(point.properties.cluster_id, Infinity).map(d => d.properties);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return points;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export { bBoxMerge, calculateClusterIndex, findPointAndClusterByPointId, geoJsonPointToScreenPoint, getClusterRadius, getClustersAndPoints, getDonutData, getNextZoomLevelOnClusterClick, getNodePathData, getNodeRelativePosition, getPointDisplayOrder, getPointPos, getPointRadius, projectPoint, shouldClusterExpand, toGeoJSONPoint };
|
|
210
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/components/leaflet-map/modules/utils.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { min, max } from 'd3-array'\nimport Supercluster, { ClusterFeature, PointFeature } from 'supercluster'\n\n// Utils\nimport { clamp, getString, getNumber } from 'utils/data'\nimport { getColor } from 'utils/color'\nimport { polygon, circlePath } from 'utils/path'\nimport { getHTMLTransform } from 'utils/html'\n\n// Types\nimport { NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n LeafletMapPoint,\n LeafletMapPointShape,\n LeafletMapPieDatum,\n LeafletMapPointStyles,\n PointExpandedClusterProperties,\n LeafletMapPointDatum,\n LeafletMapClusterDatum,\n} from '../types'\n\n// Config\nimport { LeafletMapConfig } from '../config'\n\nexport function bBoxMerge (\n bBoxArray: ({x1: number; x2: number; y1: number; y2: number})[]):\n { x: number; y: number; width: number; height: number } {\n let box = { x1: 0, x2: 0, y1: 0, y2: 0 }\n bBoxArray.forEach(coords => {\n if (!box) {\n box = { ...coords }\n } else {\n if (box.x1 > coords.x1) box.x1 = coords.x1\n if (box.y1 > coords.y1) box.y1 = coords.y1\n if (box.x2 < coords.x2) box.x2 = coords.x2\n if (box.y2 < coords.y2) box.y2 = coords.y2\n }\n })\n\n return {\n x: box.x1,\n y: box.y1,\n width: box.x2 - box.x1,\n height: box.y2 - box.y1,\n }\n}\n\nexport const getNextZoomLevelOnClusterClick = (level: number): number => clamp(1 + level * 1.5, level, 12)\n\nexport function projectPoint<D extends GenericDataRecord> (\n geoJSONPoint: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>,\n leafletMap: L.Map\n): { x: number; y: number } {\n const lat = geoJSONPoint.geometry.coordinates[1]\n const lon = geoJSONPoint.geometry.coordinates[0]\n const projected = leafletMap.latLngToLayerPoint([lat, lon])\n return projected\n}\n\nexport function getPointRadius<D extends GenericDataRecord> (\n geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>> | PointFeature<PointExpandedClusterProperties<D>>,\n pointRadius: NumericAccessor<D>,\n zoomLevel: number\n): number {\n const isDynamic = !pointRadius\n const radius = isDynamic ? 1 + 2 * Math.pow(zoomLevel, 0.80) : getNumber((geoPoint.properties as LeafletMapPointDatum<D>), pointRadius)\n\n const isCluster = (geoPoint as ClusterFeature<D>).properties.cluster\n return (isCluster && isDynamic)\n ? clamp(Math.pow((geoPoint as ClusterFeature<D>).properties.point_count, 0.35) * radius, radius * 1.1, radius * 3)\n : radius\n}\n\nexport function getPointPos<D extends GenericDataRecord> (point: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, leafletMap: L.Map): { x: number; y: number } {\n const properties = point.properties as LeafletMapPointDatum<D>\n const isFromCluster = !!(properties).expandedClusterPoint\n\n if (isFromCluster) {\n const { x, y } = projectPoint(properties.expandedClusterPoint, leafletMap)\n return {\n x: x + properties.dx,\n y: y + properties.dy,\n }\n } else {\n return projectPoint(point, leafletMap)\n }\n}\n\nexport function getPointDisplayOrder<D extends GenericDataRecord> (\n d: LeafletMapPoint<D>,\n pointStatus: StringAccessor<LeafletMapPointDatum<D> | LeafletMapClusterDatum<D>>,\n colorMap: LeafletMapPointStyles<D>\n): number {\n const status = getString(d.properties, pointStatus)\n const statusList = Object.keys(colorMap)\n return Object.keys(statusList).indexOf(status)\n}\n\nexport function toGeoJSONPoint<D extends GenericDataRecord> (d: D, pointLatitude: NumericAccessor<D>, pointLongitude: NumericAccessor<D>): PointFeature<D> {\n const lat = getNumber(d, pointLatitude) as number\n const lon = getNumber(d, pointLongitude) as number\n\n return {\n type: 'Feature',\n properties: {\n ...d,\n },\n geometry: {\n type: 'Point',\n coordinates: [lon, lat],\n },\n }\n}\n\nexport function calculateClusterIndex<D extends GenericDataRecord> (data: D[], config: LeafletMapConfig<D>, maxClusterZoomLevel = 23): Supercluster<D> {\n const { colorMap, pointShape, pointLatitude, pointLongitude, clusteringDistance } = config\n return new Supercluster<D, Supercluster.AnyProps>({\n radius: clusteringDistance,\n maxZoom: maxClusterZoomLevel,\n map: (d): Supercluster.AnyProps => {\n const shape = getString(d, pointShape)\n\n const clusterPoint = { shape }\n for (const key of Object.keys(colorMap)) {\n clusterPoint[key] = d[key] || 0\n }\n\n return clusterPoint\n },\n reduce: (acc, clusterPoint): void => {\n acc.shape = acc.shape === clusterPoint.shape ? acc.shape : LeafletMapPointShape.Circle\n acc.value = (acc.value ?? 0) + (clusterPoint.value ?? 0)\n\n for (const key of Object.keys(colorMap)) {\n acc[key] += clusterPoint[key]\n }\n },\n }).load(data.map(d => toGeoJSONPoint(d, pointLatitude, pointLongitude)))\n}\n\nexport function getNodePathData ({ x, y }: { x: number; y: number }, radius: number, shape: LeafletMapPointShape): string {\n switch (shape) {\n case LeafletMapPointShape.Triangle:\n return polygon(radius * 2, 3)\n case LeafletMapPointShape.Square:\n return polygon(radius * 2, 4)\n case LeafletMapPointShape.Circle:\n case LeafletMapPointShape.Ring:\n default:\n return circlePath(x, y, radius)\n }\n}\n\nexport function getDonutData<D extends GenericDataRecord> (\n d: LeafletMapClusterDatum<D> | LeafletMapPointDatum<D>,\n colorMap: LeafletMapPointStyles<D>\n): LeafletMapPieDatum[] {\n return Object.keys(colorMap).map(key => ({\n name: key,\n value: d[key] as number,\n color: colorMap[key].color,\n className: colorMap[key].className,\n }))\n}\n\nexport function geoJsonPointToScreenPoint<D extends GenericDataRecord> (\n geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>,\n i: number,\n leafletMap: L.Map,\n config: LeafletMapConfig<D>\n): LeafletMapPoint<D> {\n const zoomLevel = leafletMap.getZoom()\n const isCluster = (geoPoint.properties as LeafletMapClusterDatum<D>).cluster\n const clusterIndex = (geoPoint.properties as LeafletMapClusterDatum<D>).clusterIndex\n const clusterPoints = isCluster ? clusterIndex.getLeaves((geoPoint.properties as LeafletMapClusterDatum<D>).cluster_id as number, Infinity).map(d => d.properties) : undefined\n const { x, y } = getPointPos(geoPoint, leafletMap)\n\n const id = isCluster ? `cluster-${geoPoint.id}` : (getString(geoPoint.properties as LeafletMapPointDatum<D>, config.pointId) ?? geoPoint.geometry.coordinates.join(''))\n const pointColor = getColor(geoPoint.properties, isCluster ? config.clusterColor : config.pointColor)\n const radius = getPointRadius(geoPoint, isCluster ? config.clusterRadius : config.pointRadius, zoomLevel)\n const shape = isCluster ? LeafletMapPointShape.Circle : getString(geoPoint.properties as LeafletMapPointDatum<D>, config.pointShape) as LeafletMapPointShape\n const isRing = shape === LeafletMapPointShape.Ring\n\n const donutData = getDonutData(geoPoint.properties, config.colorMap)\n const maxValue = max(donutData, d => d.value)\n const maxValueIndex = donutData.map(d => d.value).indexOf(maxValue)\n const biggestDatum = donutData[maxValueIndex ?? 0]\n\n const color = isCluster ? pointColor\n : (isRing ? null : (pointColor ?? biggestDatum?.color))\n const bbox = { x1: x - radius, y1: y - radius, x2: x + radius, y2: y + radius }\n const path = getNodePathData({ x: 0, y: 0 }, radius, shape)\n const _zIndex = 0\n\n const screenPoint: LeafletMapPoint<D> = {\n ...geoPoint,\n id,\n bbox,\n radius,\n donutData,\n path,\n color,\n isCluster,\n clusterIndex,\n clusterPoints,\n _zIndex,\n }\n\n return screenPoint\n}\n\nexport function shouldClusterExpand<D extends GenericDataRecord> (\n cluster: LeafletMapPoint<D>,\n zoomLevel: number,\n midLevel = 4,\n maxLevel = 8,\n maxClusterZoomLevel = 23\n): boolean {\n if (!cluster) return false\n\n const clusterExpansionZoomLevel = cluster.clusterIndex.getClusterExpansionZoom(cluster.properties.cluster_id as number)\n return zoomLevel >= maxLevel ||\n (zoomLevel >= midLevel && (cluster.properties.point_count < 20 || clusterExpansionZoomLevel >= maxClusterZoomLevel))\n}\n\nexport function findPointAndClusterByPointId<D extends GenericDataRecord> (\n points: LeafletMapPoint<D>[],\n id: string,\n pointId: StringAccessor<D>\n): {\n point: PointFeature<D> | undefined;\n cluster: LeafletMapPoint<D> | undefined;\n } {\n let point\n let cluster\n points.forEach(p => {\n if (p.isCluster) {\n const leaves = p.clusterIndex.getLeaves((p.properties as LeafletMapClusterDatum<D>).cluster_id as number, Infinity) ?? []\n const foundPoint = leaves.find(d => getString(d.properties, pointId) === id)\n if (foundPoint) {\n point = foundPoint\n cluster = p\n }\n }\n })\n return { point, cluster }\n}\n\nexport function getNodeRelativePosition<D extends GenericDataRecord> (d: LeafletMapPoint<D>, leafletMap: L.Map): { x: number; y: number } {\n const paneTransform = getHTMLTransform(leafletMap.getPane('mapPane'))\n const { x, y } = getPointPos(d, leafletMap)\n return { x: x + paneTransform[0], y: y + paneTransform[1] }\n}\n\nexport function getClusterRadius<D extends GenericDataRecord> (cluster: { points: PointFeature<PointExpandedClusterProperties<D>>[]; cluster: LeafletMapPoint<D> }): number {\n const { points } = cluster\n const minX = min<number>(points.map(d => d.properties.dx - d.properties.r))\n const maxX = max<number>(points.map(d => d.properties.dx + d.properties.r))\n const minY = min<number>(points.map(d => d.properties.dy - d.properties.r))\n const maxY = max<number>(points.map(d => d.properties.dy + d.properties.r))\n return Math.sqrt((maxX - minX) ** 2 + (maxY - minY) ** 2) * 0.5\n}\n\nexport function getClustersAndPoints<D extends GenericDataRecord> (\n clusterIndex: Supercluster<D>,\n leafletMap: L.Map,\n customBounds?: [number, number, number, number]\n): (ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<D>)[] {\n const leafletBounds = leafletMap.getBounds()\n const southWest = leafletBounds.getSouthWest()\n const northEast = leafletBounds.getNorthEast()\n const bounds = customBounds || [southWest.lng, southWest.lat, northEast.lng, northEast.lat]\n const zoom = Math.round(leafletMap.getZoom())\n const points = clusterIndex.getClusters(bounds, zoom) // as ClusterFeature<LeafletMapPointDatum<D>>[]\n\n for (const p of points) {\n const point = p as ClusterFeature<LeafletMapClusterDatum<D>>\n const isCluster = point.properties.cluster\n if (isCluster) {\n point.properties.clusterIndex = clusterIndex\n point.properties.clusterPoints = clusterIndex.getLeaves(point.properties.cluster_id, Infinity).map(d => d.properties)\n }\n }\n\n return points as (ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<D>)[]\n}\n"],"names":[],"mappings":";;;;;;;;AA4BM,SAAU,SAAS,CACvB,SAA+D,EAAA;AAE/D,IAAA,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAA;AACxC,IAAA,SAAS,CAAC,OAAO,CAAC,MAAM,IAAG;QACzB,IAAI,CAAC,GAAG,EAAE;YACR,GAAG,GAAA,MAAA,CAAA,M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