@unovis/ts 1.1.1-beta.7 → 1.1.1-beta.8
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
package/src/types/misc.ts
DELETED
package/src/types/position.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export enum Position {
|
|
2
|
-
Top = 'top',
|
|
3
|
-
Bottom = 'bottom',
|
|
4
|
-
Left = 'left',
|
|
5
|
-
Right = 'right',
|
|
6
|
-
Center = 'center',
|
|
7
|
-
Auto = 'auto',
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export enum PositionStrategy {
|
|
11
|
-
Absolute = 'absolute',
|
|
12
|
-
Fixed = 'fixed',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export enum Arrangement {
|
|
16
|
-
Inside = 'inside',
|
|
17
|
-
Outside = 'outside',
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export enum Orientation {
|
|
21
|
-
Horizontal = 'horizontal',
|
|
22
|
-
Vertical = 'vertical',
|
|
23
|
-
}
|
package/src/types/scale.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
scaleLinear,
|
|
3
|
-
scalePow,
|
|
4
|
-
scaleSqrt,
|
|
5
|
-
scaleLog,
|
|
6
|
-
scaleIdentity,
|
|
7
|
-
scaleTime,
|
|
8
|
-
scaleUtc,
|
|
9
|
-
scaleSequential,
|
|
10
|
-
scaleDiverging,
|
|
11
|
-
scaleQuantize,
|
|
12
|
-
scaleQuantile,
|
|
13
|
-
scaleThreshold,
|
|
14
|
-
scaleOrdinal,
|
|
15
|
-
scaleBand,
|
|
16
|
-
scalePoint,
|
|
17
|
-
ScaleLinear,
|
|
18
|
-
ScalePower,
|
|
19
|
-
ScaleLogarithmic,
|
|
20
|
-
ScaleTime,
|
|
21
|
-
} from 'd3-scale'
|
|
22
|
-
// Todo Ordinal Scales: ScaleOrdinal, ScaleBand, ScalePoint, ScaleThreshold, ScaleQuantile, ScaleQuantize, ScaleDiverging, ScaleSequential
|
|
23
|
-
|
|
24
|
-
export type ContinuousScale = ScaleLinear<number, number> | ScalePower<number, number> | ScaleLogarithmic<number, number> | ScaleTime<number, number>
|
|
25
|
-
|
|
26
|
-
export const Scale = {
|
|
27
|
-
scaleLinear,
|
|
28
|
-
scalePow,
|
|
29
|
-
scaleSqrt,
|
|
30
|
-
scaleLog,
|
|
31
|
-
scaleIdentity,
|
|
32
|
-
scaleTime,
|
|
33
|
-
scaleUtc,
|
|
34
|
-
scaleSequential,
|
|
35
|
-
scaleDiverging,
|
|
36
|
-
scaleQuantize,
|
|
37
|
-
scaleQuantile,
|
|
38
|
-
scaleThreshold,
|
|
39
|
-
scaleOrdinal,
|
|
40
|
-
scaleBand,
|
|
41
|
-
scalePoint,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export enum ScaleDimension {
|
|
45
|
-
X = 'x',
|
|
46
|
-
Y = 'y',
|
|
47
|
-
}
|
package/src/types/shape.ts
DELETED
package/src/types/spacing.ts
DELETED
package/src/types/svg.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { TextAlign } from 'types/text'
|
|
2
|
-
|
|
3
|
-
export type TransformValues = {
|
|
4
|
-
translate: {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
};
|
|
8
|
-
scale: {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Converts a TextAlign value into an SVG text-anchor attribute value.
|
|
16
|
-
*
|
|
17
|
-
* @param {TextAlign | string} textAlign - The TextAlign value to convert.
|
|
18
|
-
* @returns {'start' | 'middle' | 'end'} The corresponding text-anchor attribute value. Defaults to 'start' if an invalid TextAlign value is provided.
|
|
19
|
-
*/
|
|
20
|
-
export function getTextAnchorFromTextAlign (textAlign: TextAlign | string): 'start' | 'middle' | 'end' {
|
|
21
|
-
switch (textAlign) {
|
|
22
|
-
case TextAlign.Center:
|
|
23
|
-
return 'middle'
|
|
24
|
-
case TextAlign.Right:
|
|
25
|
-
return 'end'
|
|
26
|
-
case TextAlign.Left:
|
|
27
|
-
default:
|
|
28
|
-
return 'start'
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
package/src/types/symbol.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye } from 'd3-shape'
|
|
2
|
-
|
|
3
|
-
export enum SymbolType {
|
|
4
|
-
Circle = 'circle',
|
|
5
|
-
Cross = 'cross',
|
|
6
|
-
Diamond = 'diamond',
|
|
7
|
-
Square = 'square',
|
|
8
|
-
Star = 'star',
|
|
9
|
-
Triangle = 'triangle',
|
|
10
|
-
Wye = 'wye',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const Symbol = {
|
|
14
|
-
[SymbolType.Circle]: symbolCircle,
|
|
15
|
-
[SymbolType.Cross]: symbolCross,
|
|
16
|
-
[SymbolType.Diamond]: symbolDiamond,
|
|
17
|
-
[SymbolType.Square]: symbolSquare,
|
|
18
|
-
[SymbolType.Star]: symbolStar,
|
|
19
|
-
[SymbolType.Triangle]: symbolTriangle,
|
|
20
|
-
[SymbolType.Wye]: symbolWye,
|
|
21
|
-
}
|
package/src/types/text.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
export enum TrimMode {
|
|
2
|
-
Start = 'start',
|
|
3
|
-
Middle = 'middle',
|
|
4
|
-
End = 'end',
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export enum VerticalAlign {
|
|
8
|
-
Top = 'top',
|
|
9
|
-
Middle = 'middle',
|
|
10
|
-
Bottom = 'bottom',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export enum FitMode {
|
|
14
|
-
Wrap = 'wrap',
|
|
15
|
-
Trim = 'trim',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export enum TextAlign {
|
|
19
|
-
Left = 'left',
|
|
20
|
-
Center = 'center',
|
|
21
|
-
Right = 'right',
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type UnovisText = {
|
|
25
|
-
// The text content to be displayed.
|
|
26
|
-
text: string;
|
|
27
|
-
// The font size of the text in pixels.
|
|
28
|
-
fontSize: number;
|
|
29
|
-
// The font family of the text (optional). Default: `'var(--vis-font-family)'`.
|
|
30
|
-
fontFamily?: string;
|
|
31
|
-
// The color of the text (optional).
|
|
32
|
-
color?: string;
|
|
33
|
-
// The line height scaling factor for the text (optional).
|
|
34
|
-
lineHeight?: number;
|
|
35
|
-
// The top margin of the text block in pixels (optional).
|
|
36
|
-
marginTop?: number;
|
|
37
|
-
// The bottom margin of the text block in pixels (optional).
|
|
38
|
-
marginBottom?: number;
|
|
39
|
-
// The font width-to-height ratio (optional).
|
|
40
|
-
fontWidthToHeightRatio?: number;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type UnovisWrappedText = UnovisText & {
|
|
44
|
-
// An array of text lines, where each element represents a single line of text.
|
|
45
|
-
_lines: string[];
|
|
46
|
-
// Estimated height of this text block
|
|
47
|
-
_estimatedHeight: number;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export type UnovisTextOptions = {
|
|
51
|
-
// The maximum width of the text in pixels.
|
|
52
|
-
width?: number;
|
|
53
|
-
// The word separator(s) used to split the text into words.
|
|
54
|
-
separator?: string | string[];
|
|
55
|
-
// The vertical alignment of the text ('top', 'middle', or 'bottom').
|
|
56
|
-
verticalAlign?: VerticalAlign | string;
|
|
57
|
-
// The horizontal text alignment ('left', 'center', or 'right').
|
|
58
|
-
textAlign?: TextAlign | string;
|
|
59
|
-
// Whether to use a fast estimation method or a more accurate one for text calculations.
|
|
60
|
-
fastMode?: boolean;
|
|
61
|
-
// Force word break if they don't fit into the width
|
|
62
|
-
wordBreak?: boolean;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export type UnovisTextFrameOptions = UnovisTextOptions & {
|
|
66
|
-
width: number;
|
|
67
|
-
height?: number;
|
|
68
|
-
x?: number;
|
|
69
|
-
y?: number;
|
|
70
|
-
}
|
|
71
|
-
|
package/src/types.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
// Global Types
|
|
3
|
-
export * from 'types/accessor'
|
|
4
|
-
export * from 'types/curve'
|
|
5
|
-
export * from 'types/symbol'
|
|
6
|
-
export * from 'types/scale'
|
|
7
|
-
export * from 'types/position'
|
|
8
|
-
export * from 'types/shape'
|
|
9
|
-
export * from 'types/component'
|
|
10
|
-
export * from 'types/text'
|
|
11
|
-
export * from 'types/map'
|
|
12
|
-
export * from 'types/spacing'
|
|
13
|
-
export * from 'types/graph'
|
|
14
|
-
export * from 'types/data'
|
|
15
|
-
export * from 'types/direction'
|
|
16
|
-
|
|
17
|
-
// Component Types
|
|
18
|
-
export * from 'core/component/types'
|
|
19
|
-
export * from 'components/crosshair/types'
|
|
20
|
-
export * from 'components/axis/types'
|
|
21
|
-
export * from 'components/chord-diagram/types'
|
|
22
|
-
export * from 'components/topojson-map/types'
|
|
23
|
-
export * from 'components/leaflet-map/types'
|
|
24
|
-
export * from 'components/leaflet-map/renderer/map-style'
|
|
25
|
-
export * from 'components/graph/types'
|
|
26
|
-
export * from 'components/sankey/types'
|
|
27
|
-
export * from 'components/vis-controls/types'
|
|
28
|
-
export * from 'components/free-brush/types'
|
|
29
|
-
export * from 'components/bullet-legend/types'
|
|
30
|
-
export * from 'components/xy-labels/types'
|
|
31
|
-
export * from 'components/nested-donut/types'
|
package/src/utils/color.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { color } from 'd3-color'
|
|
2
|
-
|
|
3
|
-
// Core
|
|
4
|
-
import { getCSSColorVariable } from 'styles/colors'
|
|
5
|
-
|
|
6
|
-
// Utils
|
|
7
|
-
import { ColorAccessor, StringAccessor } from 'types/accessor'
|
|
8
|
-
import { getString, isNumber } from 'utils/data'
|
|
9
|
-
import { isStringCSSVariable, getCSSVariableValue } from 'utils/misc'
|
|
10
|
-
|
|
11
|
-
/** Retrieves color from the data if provided, fallbacks to CSS variables if the index was passed */
|
|
12
|
-
export function getColor<T> (
|
|
13
|
-
d: T,
|
|
14
|
-
accessor: ColorAccessor<T>,
|
|
15
|
-
index?: number,
|
|
16
|
-
dontFallbackToCssVar?: boolean
|
|
17
|
-
): string | null {
|
|
18
|
-
if (Array.isArray(accessor) && isFinite(index)) return accessor[index % accessor.length]
|
|
19
|
-
|
|
20
|
-
const value = getString(d, accessor as StringAccessor<T>, index)
|
|
21
|
-
return (value || ((isNumber(index) && !dontFallbackToCssVar) ? `var(${getCSSColorVariable(index)})` : null))
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function hexToRgb (hex: string): { r: number; g: number; b: number } {
|
|
25
|
-
const parsed = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)
|
|
26
|
-
return parsed ? {
|
|
27
|
-
r: parseInt(parsed[1], 16),
|
|
28
|
-
g: parseInt(parsed[2], 16),
|
|
29
|
-
b: parseInt(parsed[3], 16),
|
|
30
|
-
} : { r: 0, g: 0, b: 0 }
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function hexToBrightness (hex: string): number {
|
|
34
|
-
const rgb = hexToRgb(hex)
|
|
35
|
-
return (0.2126 * rgb.r + 0.7152 * rgb.g + 0.0722 * rgb.b) / 255
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function getHexValue (s: string, context: HTMLElement | SVGElement): string {
|
|
39
|
-
const hex = isStringCSSVariable(s) ? getCSSVariableValue(s, context) : s
|
|
40
|
-
return color(hex)?.formatHex()
|
|
41
|
-
}
|
package/src/utils/d3.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { interrupt, Transition } from 'd3-transition'
|
|
2
|
-
import { BaseType, Selection } from 'd3-selection'
|
|
3
|
-
|
|
4
|
-
export function smartTransition<Element extends BaseType, Datum, ParentElement extends BaseType, ParentDatum> (
|
|
5
|
-
selection: Selection<Element, Datum, ParentElement, ParentDatum>,
|
|
6
|
-
duration?: number,
|
|
7
|
-
easing?: (normalizedTime: number) => number
|
|
8
|
-
): Selection<Element, Datum, ParentElement, ParentDatum> | Transition<Element, Datum, ParentElement, ParentDatum> {
|
|
9
|
-
selection.nodes().forEach(node => interrupt(node)) // Interrupt active transitions if any
|
|
10
|
-
if (duration) {
|
|
11
|
-
const transition = selection.transition().duration(duration)
|
|
12
|
-
if (easing) transition.ease(easing)
|
|
13
|
-
return transition
|
|
14
|
-
} else return selection
|
|
15
|
-
}
|
package/src/utils/data.ts
DELETED
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import { max, min, mean, bisector } from 'd3-array'
|
|
2
|
-
import { throttle as _throttle } from 'throttle-debounce'
|
|
3
|
-
|
|
4
|
-
// Types
|
|
5
|
-
import { NumericAccessor, StringAccessor, BooleanAccessor, ColorAccessor, GenericAccessor } from 'types/accessor'
|
|
6
|
-
import { StackValuesRecord } from 'types/data'
|
|
7
|
-
|
|
8
|
-
export const isNumber = <T>(a: T): boolean => typeof a === 'number'
|
|
9
|
-
export const isFunction = <T>(a: T): boolean => typeof a === 'function'
|
|
10
|
-
export const isUndefined = <T>(a: T): boolean => a === undefined
|
|
11
|
-
export const isNil = <T>(a: T): boolean => a == null
|
|
12
|
-
export const isString = <T>(a: T): boolean => typeof a === 'string'
|
|
13
|
-
export const isArray = <T>(a: T): boolean => Array.isArray(a)
|
|
14
|
-
export const isObject = <T>(a: T): boolean => (a instanceof Object)
|
|
15
|
-
export const isAClassInstance = <T>(a: T): boolean => a.constructor.name !== 'Function' && a.constructor.name !== 'Object'
|
|
16
|
-
export const isPlainObject = <T>(a: T): boolean => isObject(a) && !isArray(a) && !isFunction(a) && !isAClassInstance(a)
|
|
17
|
-
|
|
18
|
-
export const isEmpty = <T>(obj: T): boolean => {
|
|
19
|
-
return [Object, Array].includes((obj || {}).constructor as ArrayConstructor | ObjectConstructor) &&
|
|
20
|
-
!Object.entries((obj || {})).length
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Based on https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/src/style-spec/util/deep_equal.ts, 3-Clause BSD license
|
|
24
|
-
export const isEqual = (a?: unknown | null, b?: unknown | null, visited: Set<any> = new Set()): boolean => {
|
|
25
|
-
if (Array.isArray(a)) {
|
|
26
|
-
if (!Array.isArray(b) || a.length !== b.length) return false
|
|
27
|
-
|
|
28
|
-
if (visited.has(a)) return true
|
|
29
|
-
else visited.add(a)
|
|
30
|
-
|
|
31
|
-
for (let i = 0; i < a.length; i++) {
|
|
32
|
-
if (!isEqual(a[i], b[i], visited)) return false
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (typeof a === 'object' && a !== null && b !== null) {
|
|
39
|
-
if (!(typeof b === 'object')) return false
|
|
40
|
-
if (a === b) return true
|
|
41
|
-
|
|
42
|
-
const keys = Object.keys(a)
|
|
43
|
-
if (keys.length !== Object.keys(b).length) return false
|
|
44
|
-
|
|
45
|
-
if (visited.has(a)) return true
|
|
46
|
-
else visited.add(a)
|
|
47
|
-
|
|
48
|
-
for (const key in a) {
|
|
49
|
-
if (!isEqual(a[key], b[key], visited)) return false
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return true
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return a === b
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const without = <T>(arr: Array<T>, ...args: T[]): Array<T> => arr.filter(item => !args.includes(item))
|
|
59
|
-
export const flatten = <T>(arr: Array<T | T[]>): Array<T> => arr.flat() as T[]
|
|
60
|
-
export const cloneDeep = <T>(obj: T, stack: Map<any, any> = new Map()): T => {
|
|
61
|
-
if (typeof obj !== 'object' || obj === null) {
|
|
62
|
-
return obj
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (obj instanceof Date) {
|
|
66
|
-
return new Date(obj.getTime()) as unknown as T
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (obj instanceof Array) {
|
|
70
|
-
const clone: unknown[] = []
|
|
71
|
-
stack.set(obj, clone)
|
|
72
|
-
for (const item of obj) {
|
|
73
|
-
clone.push(stack.has(item) ? stack.get(item) : cloneDeep(item, stack))
|
|
74
|
-
}
|
|
75
|
-
return clone as unknown as T
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Class instances will be copied without cloning
|
|
79
|
-
if (isAClassInstance(obj)) {
|
|
80
|
-
const clone = obj
|
|
81
|
-
return clone
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (obj instanceof Object) {
|
|
85
|
-
const clone = {} as T
|
|
86
|
-
stack.set(obj, clone)
|
|
87
|
-
const objAsRecord = obj as Record<string | number, unknown>
|
|
88
|
-
Object.keys(obj)
|
|
89
|
-
.reduce((newObj: typeof objAsRecord, key: string | number): typeof objAsRecord => {
|
|
90
|
-
newObj[key] = stack.has(objAsRecord[key]) ? stack.get(objAsRecord[key]) : cloneDeep(objAsRecord[key], stack)
|
|
91
|
-
return newObj
|
|
92
|
-
}, clone as typeof objAsRecord)
|
|
93
|
-
|
|
94
|
-
return clone
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return obj
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
export const merge = <T, K>(obj1: T, obj2: K, visited: Map<any, any> = new Map()): T & K => {
|
|
102
|
-
type Rec = Record<string | number, unknown>
|
|
103
|
-
|
|
104
|
-
if (!obj1 || !obj2) return obj1 as T & K
|
|
105
|
-
if ((obj1 as unknown) === (obj2 as unknown)) return obj1 as T & K
|
|
106
|
-
|
|
107
|
-
const newObj = (isAClassInstance(obj1 as Rec) ? obj1 : cloneDeep(obj1)) as T & K
|
|
108
|
-
|
|
109
|
-
// Taking care of recursive structures
|
|
110
|
-
if (visited.has(obj2)) return visited.get(obj2)
|
|
111
|
-
else visited.set(obj2, newObj)
|
|
112
|
-
|
|
113
|
-
Object.keys(obj2 as Rec).forEach(key => {
|
|
114
|
-
if (isPlainObject((obj1 as Rec)[key]) && isPlainObject((obj2 as Rec)[key])) {
|
|
115
|
-
(newObj as Rec)[key] = merge((obj1 as Rec)[key], (obj2 as Rec)[key], visited)
|
|
116
|
-
} else if (isAClassInstance(obj2 as Rec)) {
|
|
117
|
-
(newObj as Rec)[key] = obj2
|
|
118
|
-
} else {
|
|
119
|
-
(newObj as Rec)[key] = cloneDeep((obj2 as Rec)[key])
|
|
120
|
-
}
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
return newObj
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export const omit = <T extends Record<string | number | symbol, unknown>>(obj: T, props: Array<keyof T>): Partial<T> => {
|
|
127
|
-
obj = { ...obj }
|
|
128
|
-
props.forEach(prop => delete obj[prop])
|
|
129
|
-
return obj
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export const groupBy = <T extends Record<string | number, any>> (arr: T[], accessor: (a: T) => string | number): Record<string | number, T[]> => {
|
|
133
|
-
return arr.reduce(
|
|
134
|
-
(grouped, v, i, a, k = accessor(v)) => (((grouped[k] || (grouped[k] = [])).push(v), grouped)),
|
|
135
|
-
{} as Record<string | number, T[]>
|
|
136
|
-
)
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export const sortBy = <T>(arr: Array<T>, accessor: (a: T) => string | number): Array<T> => {
|
|
140
|
-
return arr.concat() // The native sort method modifies the array in place. We use `.concat()` to copy the array first
|
|
141
|
-
.sort((a, b): number => {
|
|
142
|
-
return (accessor(a) > accessor(b)) ? 1 : ((accessor(b) > accessor(a)) ? -1 : 0)
|
|
143
|
-
})
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export const throttle = <T extends (...args: any[]) => any>(
|
|
147
|
-
f: T,
|
|
148
|
-
delay: number,
|
|
149
|
-
options?: {
|
|
150
|
-
noTrailing?: boolean;
|
|
151
|
-
noLeading?: boolean;
|
|
152
|
-
debounceMode?: boolean;
|
|
153
|
-
}
|
|
154
|
-
): _throttle<T> => _throttle(delay, f, options)
|
|
155
|
-
|
|
156
|
-
export function getValue<T, ReturnType> (
|
|
157
|
-
d: T,
|
|
158
|
-
accessor: NumericAccessor<T> | StringAccessor<T> | BooleanAccessor<T> | ColorAccessor<T> | GenericAccessor<ReturnType, T>,
|
|
159
|
-
index?: number
|
|
160
|
-
): ReturnType {
|
|
161
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
162
|
-
if (isFunction(accessor)) return (accessor as Function)(d, index) as (ReturnType | null | undefined)
|
|
163
|
-
else return accessor as unknown as (ReturnType | null | undefined)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export function getString<T> (d: T, accessor: StringAccessor<T>, i?: number): string | null | undefined {
|
|
167
|
-
return getValue<T, string>(d, accessor, i)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export function getNumber<T> (d: T, accessor: NumericAccessor<T>, i?: number): number | null | undefined {
|
|
171
|
-
return getValue<T, number>(d, accessor, i)
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export function getBoolean<T> (d: T, accessor: BooleanAccessor<T>, i?: number): boolean | null | undefined {
|
|
175
|
-
return getValue<T, boolean>(d, accessor, i)
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export function clean<T> (data: T[]): T[] {
|
|
179
|
-
return data.filter(d => d && !isNumber(d))
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export function clamp (d: number, min: number, max: number): number {
|
|
183
|
-
return Math.min(Math.max(d, min), max)
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export function unique<T> (array: T[]): T[] {
|
|
187
|
-
return Array.from(new Set(array))
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export function countUnique<T> (array: T[], accessor = d => d): number {
|
|
191
|
-
return new Set(array.map(d => accessor(d))).size
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export function arrayOfIndices (n: number): number[] {
|
|
195
|
-
return [...Array(n).keys()]
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export function shallowDiff (o1: Record<string, unknown> = {}, o2: Record<string, unknown> = {}): Record<string, unknown> {
|
|
199
|
-
return Object.keys(o2).reduce((diff, key) => {
|
|
200
|
-
if (o1[key] === o2[key]) return diff
|
|
201
|
-
return {
|
|
202
|
-
...diff,
|
|
203
|
-
[key]: o2[key],
|
|
204
|
-
}
|
|
205
|
-
}, {})
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export function getStackedExtent<Datum> (data: Datum[], ...acs: NumericAccessor<Datum>[]): (number | undefined)[] {
|
|
209
|
-
if (!data) return [undefined, undefined]
|
|
210
|
-
if (isArray(acs)) {
|
|
211
|
-
let minValue = 0
|
|
212
|
-
let maxValue = 0
|
|
213
|
-
data.forEach((d, i) => {
|
|
214
|
-
let positiveStack = 0
|
|
215
|
-
let negativeStack = 0
|
|
216
|
-
for (const a of acs as NumericAccessor<Datum>[]) {
|
|
217
|
-
const value = getNumber(d, a, i) || 0
|
|
218
|
-
if (value >= 0) positiveStack += value
|
|
219
|
-
else negativeStack += value
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
if (positiveStack > maxValue) maxValue = positiveStack
|
|
223
|
-
if (negativeStack < minValue) minValue = negativeStack
|
|
224
|
-
})
|
|
225
|
-
return [minValue, maxValue]
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export function getStackedValues<Datum> (d: Datum, index: number, ...acs: NumericAccessor<Datum>[]): (number | undefined)[] {
|
|
230
|
-
const values = []
|
|
231
|
-
|
|
232
|
-
let positiveStack = 0
|
|
233
|
-
let negativeStack = 0
|
|
234
|
-
for (const a of acs as NumericAccessor<Datum>[]) {
|
|
235
|
-
const value = getNumber(d, a, index) || 0
|
|
236
|
-
if (value >= 0) {
|
|
237
|
-
values.push(positiveStack += value)
|
|
238
|
-
} else {
|
|
239
|
-
values.push(negativeStack += value)
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
return values
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
export function getStackedData<Datum> (
|
|
247
|
-
data: Datum[],
|
|
248
|
-
baseline: NumericAccessor<Datum>,
|
|
249
|
-
acs: NumericAccessor<Datum>[],
|
|
250
|
-
prevNegative?: boolean[] // to help guessing the stack direction (positive/negative) when the values are 0 or null
|
|
251
|
-
): StackValuesRecord[] {
|
|
252
|
-
const baselineValues = data.map((d, i) => getNumber(d, baseline, i) || 0)
|
|
253
|
-
const isNegativeStack = acs.map((a, j) => {
|
|
254
|
-
const average = mean(data, (d, i) => getNumber(d, a, i) || 0)
|
|
255
|
-
return (average === 0 && Array.isArray(prevNegative)) ? prevNegative[j] : average < 0
|
|
256
|
-
})
|
|
257
|
-
|
|
258
|
-
const stackedData: StackValuesRecord[] = acs.map(() => [])
|
|
259
|
-
data.forEach((d, i) => {
|
|
260
|
-
let positiveStack = baselineValues[i]
|
|
261
|
-
let negativeStack = baselineValues[i]
|
|
262
|
-
acs.forEach((a, j) => {
|
|
263
|
-
const value = getNumber(d, a, i) || 0
|
|
264
|
-
if (!isNegativeStack[j]) {
|
|
265
|
-
stackedData[j].push([positiveStack, positiveStack += value])
|
|
266
|
-
} else {
|
|
267
|
-
stackedData[j].push([negativeStack, negativeStack += value])
|
|
268
|
-
}
|
|
269
|
-
})
|
|
270
|
-
})
|
|
271
|
-
|
|
272
|
-
// Fill in additional stack information
|
|
273
|
-
stackedData.forEach((stack, i) => {
|
|
274
|
-
stack.negative = isNegativeStack[i]
|
|
275
|
-
})
|
|
276
|
-
|
|
277
|
-
stackedData.filter(s => s.negative)
|
|
278
|
-
.forEach((s, i, arr) => {
|
|
279
|
-
s.ending = i === arr.length - 1
|
|
280
|
-
})
|
|
281
|
-
|
|
282
|
-
stackedData.filter(s => !s.negative)
|
|
283
|
-
.forEach((s, i, arr) => {
|
|
284
|
-
s.ending = i === arr.length - 1
|
|
285
|
-
})
|
|
286
|
-
|
|
287
|
-
return stackedData
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
export function getMin<Datum> (data: Datum[], ...acs: NumericAccessor<Datum>[]): number | undefined {
|
|
291
|
-
if (!data) return undefined
|
|
292
|
-
const minValue = min(data, (d, i) => min(acs as NumericAccessor<Datum>[], a => getNumber(d, a, i)))
|
|
293
|
-
return minValue
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export function getMax<Datum> (data: Datum[], ...acs: NumericAccessor<Datum>[]): number | undefined {
|
|
297
|
-
if (!data) return undefined
|
|
298
|
-
const maxValue = max(data, (d, i) => max(acs as NumericAccessor<Datum>[], a => getNumber(d, a, i)))
|
|
299
|
-
return maxValue
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
export function getExtent<Datum> (data: Datum[], ...acs: NumericAccessor<Datum>[]): (number | undefined)[] {
|
|
303
|
-
return [getMin(data, ...acs), getMax(data, ...acs)]
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
export function getNearest<Datum> (data: Datum[], value: number, accessor: NumericAccessor<Datum>): Datum {
|
|
307
|
-
if (data.length <= 1) return data[0]
|
|
308
|
-
|
|
309
|
-
const values = data.map((d, i) => getNumber(d, accessor, i))
|
|
310
|
-
values.sort((a, b) => a - b)
|
|
311
|
-
|
|
312
|
-
const xBisector = bisector(d => d).left
|
|
313
|
-
const index = xBisector(values, value, 1, data.length - 1)
|
|
314
|
-
return value - values[index - 1] > values[index] - value ? data[index] : data[index - 1]
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
export function filterDataByRange<Datum> (data: Datum[], range: [number, number], accessor: NumericAccessor<Datum>): Datum[] {
|
|
318
|
-
const filteredData = data.filter((d, i) => {
|
|
319
|
-
const value = getNumber(d, accessor, i)
|
|
320
|
-
return (value >= range[0]) && (value < range[1])
|
|
321
|
-
})
|
|
322
|
-
|
|
323
|
-
return filteredData
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export function isNumberWithinRange (value: number, range: [number, number]): boolean {
|
|
327
|
-
return (value >= range[0]) && (value <= range[1])
|
|
328
|
-
}
|
package/src/utils/html.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { select } from 'd3-selection'
|
|
2
|
-
|
|
3
|
-
export function getHTMLTransform (el: HTMLElement): number[] {
|
|
4
|
-
const results = select(el).style('transform')
|
|
5
|
-
// eslint-disable-next-line max-len
|
|
6
|
-
.match(/matrix(?:(3d)\(-{0,1}\d+\.?\d*(?:, -{0,1}\d+\.?\d*)*(?:, (-{0,1}\d+\.?\d*))(?:, (-{0,1}\d+\.?\d*))(?:, (-{0,1}\d+\.?\d*)), -{0,1}\d+\.?\d*\)|\(-{0,1}\d+\.?\d*(?:, -{0,1}\d+\.?\d*)*(?:, (-{0,1}\d+\.?\d*))(?:, (-{0,1}\d+\.?\d*))\))/)
|
|
7
|
-
|
|
8
|
-
if (!results) return [0, 0, 0]
|
|
9
|
-
if (results[1] === '3d') return results.slice(2, 5).map(d => +d)
|
|
10
|
-
|
|
11
|
-
results.push('0')
|
|
12
|
-
return results.slice(5, 8).map(d => +d)
|
|
13
|
-
}
|
package/src/utils/map.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { min, max } from 'd3-array'
|
|
2
|
-
|
|
3
|
-
// Types
|
|
4
|
-
import { NumericAccessor } from 'types/accessor'
|
|
5
|
-
|
|
6
|
-
// Utils
|
|
7
|
-
import { getNumber } from 'utils/data'
|
|
8
|
-
|
|
9
|
-
export function getDataLatLngBounds<D> (
|
|
10
|
-
data: D[],
|
|
11
|
-
pointLatitude: NumericAccessor<D>,
|
|
12
|
-
pointLongitude: NumericAccessor<D>,
|
|
13
|
-
paddingDegrees = 1
|
|
14
|
-
): [[number, number], [number, number]] {
|
|
15
|
-
const northWest = {
|
|
16
|
-
lat: max(data ?? [], d => getNumber(d, pointLatitude)),
|
|
17
|
-
lng: min(data ?? [], d => getNumber(d, pointLongitude)),
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const southEast = {
|
|
21
|
-
lat: min(data ?? [], d => getNumber(d, pointLatitude)),
|
|
22
|
-
lng: max(data ?? [], d => getNumber(d, pointLongitude)),
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return [
|
|
26
|
-
[northWest.lat + paddingDegrees || 90, northWest.lng - paddingDegrees || -180],
|
|
27
|
-
[southEast.lat - paddingDegrees || -70, southEast.lng + paddingDegrees || 180],
|
|
28
|
-
]
|
|
29
|
-
}
|