@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
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// Core
|
|
2
|
-
import { Config } from 'core/config'
|
|
3
|
-
|
|
4
|
-
// Types
|
|
5
|
-
import { Sizing } from 'types/component'
|
|
6
|
-
import { Spacing } from 'types/spacing'
|
|
7
|
-
|
|
8
|
-
export interface ContainerConfigInterface {
|
|
9
|
-
/** Animation duration of all the components within the container. Default: `undefined` */
|
|
10
|
-
duration?: number;
|
|
11
|
-
/** Margins. Default: `{ top: 0, bottom: 0, left: 0, right: 0 }` */
|
|
12
|
-
margin?: Spacing;
|
|
13
|
-
/** Padding. Default: `{ top: 0, bottom: 0, left: 0, right: 0 }` */
|
|
14
|
-
padding?: Spacing;
|
|
15
|
-
/** Defines whether components should fit into the container or the container should expand to fit to the component's size. Default: `Sizing.Fit` */
|
|
16
|
-
sizing?: Sizing | string;
|
|
17
|
-
/** Width in pixels or in CSS units.
|
|
18
|
-
* Percentage units `"%"` are not supported here. If you want to set `width` as a percentage, do it via `style`
|
|
19
|
-
* of the corresponding DOM element.
|
|
20
|
-
* By default, Container automatically fits to the size of the parent element.
|
|
21
|
-
* Default: `undefined`
|
|
22
|
-
*/
|
|
23
|
-
width?: number | string;
|
|
24
|
-
/** Height in pixels or in CSS units.
|
|
25
|
-
* Percentage units `"%"` are not supported here. If you want to set `height` as a percentage, do it via `style`
|
|
26
|
-
* of the corresponding DOM element.
|
|
27
|
-
* By default, Container automatically fits to the size of the parent element.
|
|
28
|
-
* Default: `undefined`
|
|
29
|
-
*/
|
|
30
|
-
height?: number | string;
|
|
31
|
-
/** Custom SVG defs available to all the components within the container. Default: `undefined`. */
|
|
32
|
-
svgDefs?: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export class ContainerConfig extends Config implements ContainerConfigInterface {
|
|
36
|
-
duration = undefined
|
|
37
|
-
margin = {
|
|
38
|
-
top: 0,
|
|
39
|
-
bottom: 0,
|
|
40
|
-
left: 0,
|
|
41
|
-
right: 0,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
padding = {
|
|
45
|
-
top: 0,
|
|
46
|
-
bottom: 0,
|
|
47
|
-
left: 0,
|
|
48
|
-
right: 0,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
sizing = Sizing.Fit
|
|
52
|
-
width = undefined
|
|
53
|
-
height = undefined
|
|
54
|
-
|
|
55
|
-
svgDefs = undefined
|
|
56
|
-
}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { select, Selection } from 'd3-selection'
|
|
2
|
-
import { ResizeObserver } from '@juggle/resize-observer'
|
|
3
|
-
|
|
4
|
-
// Types
|
|
5
|
-
import { Sizing } from 'types/component'
|
|
6
|
-
|
|
7
|
-
// Utils
|
|
8
|
-
import { isEqual, clamp } from 'utils/data'
|
|
9
|
-
|
|
10
|
-
// Config
|
|
11
|
-
import { ContainerConfig, ContainerConfigInterface } from './config'
|
|
12
|
-
|
|
13
|
-
export class ContainerCore {
|
|
14
|
-
svg: Selection<SVGSVGElement, unknown, null, undefined>
|
|
15
|
-
element: SVGSVGElement
|
|
16
|
-
prevConfig: ContainerConfig
|
|
17
|
-
config: ContainerConfig
|
|
18
|
-
|
|
19
|
-
protected _container: HTMLElement
|
|
20
|
-
protected _requestedAnimationFrame: number
|
|
21
|
-
private _isFirstRender = true
|
|
22
|
-
private _containerSize: { width: number; height: number }
|
|
23
|
-
private _resizeObserver: ResizeObserver | undefined
|
|
24
|
-
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
26
|
-
static DEFAULT_CONTAINER_HEIGHT = 300
|
|
27
|
-
|
|
28
|
-
constructor (element: HTMLElement) {
|
|
29
|
-
this._requestedAnimationFrame = null
|
|
30
|
-
this._container = element
|
|
31
|
-
|
|
32
|
-
// Create SVG element for visualizations
|
|
33
|
-
this.svg = select(this._container).append('svg')
|
|
34
|
-
// We set `display` to `block` because inline elements have an invisible
|
|
35
|
-
// inline space that adds 4px to the height of the container
|
|
36
|
-
.style('display', 'block')
|
|
37
|
-
.attr('xmlns', 'http://www.w3.org/2000/svg')
|
|
38
|
-
.attr('height', ContainerCore.DEFAULT_CONTAINER_HEIGHT)
|
|
39
|
-
|
|
40
|
-
this.element = this.svg.node()
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
updateContainer<T extends ContainerConfigInterface> (config: T): void {
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
45
|
-
const ConfigModel = (this.config.constructor as typeof ContainerConfig)
|
|
46
|
-
this.prevConfig = this.config
|
|
47
|
-
this.config = new ConfigModel().init(config)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
_render (duration?: number): void {
|
|
51
|
-
if (this.config.svgDefs) {
|
|
52
|
-
this.svg.select('.svgDefs').remove()
|
|
53
|
-
this.svg.append('defs').attr('class', 'svgDefs').html(this.config.svgDefs)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
this._isFirstRender = false
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
render (duration = this.config.duration): void {
|
|
60
|
-
const width = this.config.width || this.containerWidth
|
|
61
|
-
const height = this.config.height || this.containerHeight
|
|
62
|
-
|
|
63
|
-
// We set SVG size in `render()` instead of `_render()`, because the size values in pixels will become
|
|
64
|
-
// available only in the next animation when being accessed via `element.clientWidth` and `element.clientHeight`,
|
|
65
|
-
// and we rely on those values when setting width and size of the components.
|
|
66
|
-
this.svg
|
|
67
|
-
.attr('width', width)
|
|
68
|
-
.attr('height', height)
|
|
69
|
-
|
|
70
|
-
// Set up Resize Observer. We do it in `render()` to capture container size change if it happened
|
|
71
|
-
// in the next animation frame after the initial `render` was called.
|
|
72
|
-
if (!this._resizeObserver) this._setUpResizeObserver()
|
|
73
|
-
|
|
74
|
-
// Schedule the actual rendering in the next frame
|
|
75
|
-
cancelAnimationFrame(this._requestedAnimationFrame)
|
|
76
|
-
this._requestedAnimationFrame = requestAnimationFrame(() => {
|
|
77
|
-
this._render(duration)
|
|
78
|
-
})
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
get containerWidth (): number {
|
|
82
|
-
return this.config.width
|
|
83
|
-
? this.element.clientWidth
|
|
84
|
-
: clamp(this._container.clientWidth || this._container.getBoundingClientRect().width, 0, Number.POSITIVE_INFINITY)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
get containerHeight (): number {
|
|
88
|
-
return this.config.height
|
|
89
|
-
? this.element.clientHeight
|
|
90
|
-
: clamp(this._container.clientHeight || this._container.getBoundingClientRect().height, 0, Number.POSITIVE_INFINITY)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
get width (): number {
|
|
94
|
-
return clamp(this.containerWidth - this.config.margin.left - this.config.margin.right, 0, Number.POSITIVE_INFINITY)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
get height (): number {
|
|
98
|
-
return clamp(this.containerHeight - this.config.margin.top - this.config.margin.bottom, 0, Number.POSITIVE_INFINITY)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
removeAllChildren (): void {
|
|
102
|
-
while (this.element.firstChild) {
|
|
103
|
-
this.element.removeChild(this.element.firstChild)
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
_onResize (): void {
|
|
108
|
-
const { config } = this
|
|
109
|
-
const redrawOnResize = config.sizing === Sizing.Fit || config.sizing === Sizing.FitWidth
|
|
110
|
-
if (redrawOnResize) this.render(0)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
_setUpResizeObserver (): void {
|
|
114
|
-
const containerRect = this._container.getBoundingClientRect()
|
|
115
|
-
this._containerSize = { width: containerRect.width, height: containerRect.height }
|
|
116
|
-
|
|
117
|
-
this._resizeObserver = new ResizeObserver((entries, observer) => {
|
|
118
|
-
const resizedContainerRect = this._container.getBoundingClientRect()
|
|
119
|
-
const resizedContainerSize = { width: resizedContainerRect.width, height: resizedContainerRect.height }
|
|
120
|
-
const hasSizeChanged = !isEqual(this._containerSize, resizedContainerSize)
|
|
121
|
-
// Do resize only if element is attached to the DOM
|
|
122
|
-
// will come in useful when some ancestor of container becomes detached
|
|
123
|
-
if (hasSizeChanged && resizedContainerSize.width && resizedContainerSize.height) {
|
|
124
|
-
this._containerSize = resizedContainerSize
|
|
125
|
-
this._onResize()
|
|
126
|
-
}
|
|
127
|
-
})
|
|
128
|
-
this._resizeObserver.observe(this._container)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
destroy (): void {
|
|
132
|
-
cancelAnimationFrame(this._requestedAnimationFrame)
|
|
133
|
-
this._resizeObserver?.disconnect()
|
|
134
|
-
this.svg.remove()
|
|
135
|
-
}
|
|
136
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ContinuousScale } from 'types/scale'
|
|
2
|
-
|
|
3
|
-
// Types
|
|
4
|
-
import { ColorAccessor, NumericAccessor } from 'types/accessor'
|
|
5
|
-
|
|
6
|
-
// Config
|
|
7
|
-
import { ComponentConfig, ComponentConfigInterface } from '../component/config'
|
|
8
|
-
|
|
9
|
-
export interface XYComponentConfigInterface<Datum> extends ComponentConfigInterface {
|
|
10
|
-
/** Accessor function for getting the values along the X axis. Default: `undefined` */
|
|
11
|
-
x: NumericAccessor<Datum>;
|
|
12
|
-
/** A single of multiple accessor functions for getting the values along the Y axis. Default: `undefined` */
|
|
13
|
-
y: NumericAccessor<Datum> | NumericAccessor<Datum>[];
|
|
14
|
-
/** Accessor function for getting the unique data record id. Used for more persistent data updates. Default: `(d, i) => d.id ?? i` */
|
|
15
|
-
id?: ((d: Datum, i: number, ...any: any[]) => string);
|
|
16
|
-
/** Component color accessor function. Default: `d => d.color` */
|
|
17
|
-
color?: ColorAccessor<Datum> | ColorAccessor<Datum[]>;
|
|
18
|
-
/** Scale for X dimension, e.g. Scale.scaleLinear(). If you set xScale you'll be responsible for setting it's `domain` and `range` as well.
|
|
19
|
-
* Only continuous scales are supported.
|
|
20
|
-
* Default: `undefined`
|
|
21
|
-
*/
|
|
22
|
-
xScale?: ContinuousScale;
|
|
23
|
-
/** Scale for Y dimension, e.g. Scale.scaleLinear(). If you set yScale you'll be responsible for setting it's `domain` and `range` as well.
|
|
24
|
-
* Only continuous scales are supported.
|
|
25
|
-
* Default: `undefined`
|
|
26
|
-
*/
|
|
27
|
-
yScale?: ContinuousScale;
|
|
28
|
-
/** Identifies whether the component should be excluded from overall X and Y domain calculations or not.
|
|
29
|
-
* This property can be useful when you want pass individual data to a component and you don't want it to affect
|
|
30
|
-
* the scales of the chart.
|
|
31
|
-
* Default: `false`
|
|
32
|
-
*/
|
|
33
|
-
excludeFromDomainCalculation?: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export class XYComponentConfig<Datum> extends ComponentConfig implements XYComponentConfigInterface<Datum> {
|
|
37
|
-
x = undefined
|
|
38
|
-
y = undefined
|
|
39
|
-
// eslint-disable-next-line dot-notation
|
|
40
|
-
id = (d: Datum, i: number): string => d['id'] ?? `${i}`
|
|
41
|
-
// eslint-disable-next-line dot-notation
|
|
42
|
-
color = (d: Datum | Datum[]): string => d['color']
|
|
43
|
-
xScale = undefined
|
|
44
|
-
yScale = undefined
|
|
45
|
-
excludeFromDomainCalculation = false
|
|
46
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Selection } from 'd3-selection'
|
|
2
|
-
|
|
3
|
-
// Core
|
|
4
|
-
import { ComponentCore } from 'core/component'
|
|
5
|
-
import { SeriesDataModel } from 'data-models/series'
|
|
6
|
-
|
|
7
|
-
// Utils
|
|
8
|
-
import { filterDataByRange, getExtent, isArray } from 'utils/data'
|
|
9
|
-
|
|
10
|
-
// Types
|
|
11
|
-
import { NumericAccessor } from 'types/accessor'
|
|
12
|
-
import { ContinuousScale, Scale, ScaleDimension } from 'types/scale'
|
|
13
|
-
|
|
14
|
-
// Config
|
|
15
|
-
import { XYComponentConfig, XYComponentConfigInterface } from './config'
|
|
16
|
-
|
|
17
|
-
export class XYComponentCore<
|
|
18
|
-
Datum,
|
|
19
|
-
ConfigClass extends XYComponentConfig<Datum> = XYComponentConfig<Datum>,
|
|
20
|
-
ConfigInterface extends Partial<XYComponentConfigInterface<Datum>> = Partial<XYComponentConfigInterface<Datum>>,
|
|
21
|
-
> extends ComponentCore<Datum[], ConfigClass, ConfigInterface> {
|
|
22
|
-
element: SVGGraphicsElement
|
|
23
|
-
g: Selection<SVGGElement, unknown, null, undefined>
|
|
24
|
-
config: ConfigClass
|
|
25
|
-
prevConfig: ConfigClass
|
|
26
|
-
datamodel: SeriesDataModel<Datum> = new SeriesDataModel()
|
|
27
|
-
|
|
28
|
-
/** Clippable components can be affected by a clipping path (set up in the container) */
|
|
29
|
-
clippable = true
|
|
30
|
-
|
|
31
|
-
/** Identifies whether the component displayed stacked data (eg StackedBar, Area) */
|
|
32
|
-
stacked = false
|
|
33
|
-
|
|
34
|
-
private _xScale: ContinuousScale = Scale.scaleLinear()
|
|
35
|
-
private _yScale: ContinuousScale = Scale.scaleLinear()
|
|
36
|
-
|
|
37
|
-
get xScale (): ContinuousScale {
|
|
38
|
-
return this.config.xScale || this._xScale
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
get yScale (): ContinuousScale {
|
|
42
|
-
return this.config.yScale || this._yScale
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
setConfig (config: ConfigInterface): void {
|
|
46
|
-
// We don't allow changing scales after the component has been initialized
|
|
47
|
-
if (this.config?.xScale) config.xScale = this.config.xScale
|
|
48
|
-
if (this.config?.yScale) config.yScale = this.config.yScale
|
|
49
|
-
|
|
50
|
-
super.setConfig(config)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
setScaleDomain (dimension: ScaleDimension, domain: number[]): void {
|
|
54
|
-
if (dimension === ScaleDimension.X) this._xScale?.domain(domain)
|
|
55
|
-
if (dimension === ScaleDimension.Y) this._yScale?.domain(domain)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
setScaleRange (dimension: ScaleDimension, range: number[]): void {
|
|
59
|
-
if (dimension === ScaleDimension.X) this._xScale?.range(range)
|
|
60
|
-
if (dimension === ScaleDimension.Y) this._yScale?.range(range)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
setScale (dimension: ScaleDimension, scale: ContinuousScale): void {
|
|
64
|
-
if (scale && (dimension === ScaleDimension.X)) this._xScale = scale
|
|
65
|
-
if (scale && (dimension === ScaleDimension.Y)) this._yScale = scale
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
getDataExtent (dimension: ScaleDimension, scaleByVisibleData: boolean): number[] {
|
|
69
|
-
const { config, datamodel } = this
|
|
70
|
-
|
|
71
|
-
switch (dimension) {
|
|
72
|
-
case ScaleDimension.X: return this.getXDataExtent()
|
|
73
|
-
case ScaleDimension.Y: return this.getYDataExtent(scaleByVisibleData)
|
|
74
|
-
default: return getExtent(datamodel.data, config[dimension])
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
getXDataExtent (): number[] {
|
|
79
|
-
const { config, datamodel } = this
|
|
80
|
-
return getExtent(datamodel.data, config.x)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
getYDataExtent (scaleByVisibleData: boolean): number[] {
|
|
84
|
-
const { config, datamodel } = this
|
|
85
|
-
|
|
86
|
-
const data = scaleByVisibleData ? filterDataByRange(datamodel.data, this.xScale.domain() as [number, number], config.x) : datamodel.data
|
|
87
|
-
const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]
|
|
88
|
-
return getExtent(data, ...yAccessors)
|
|
89
|
-
}
|
|
90
|
-
}
|
package/src/data-models/core.ts
DELETED
package/src/data-models/graph.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { isNumber, isUndefined, cloneDeep, isFunction, without, isString, isObject, isEqual } from 'utils/data'
|
|
2
|
-
|
|
3
|
-
// Types
|
|
4
|
-
import { GraphInputLink, GraphInputNode, GraphLinkCore, GraphNodeCore } from 'types/graph'
|
|
5
|
-
|
|
6
|
-
// Core Data Model
|
|
7
|
-
import { CoreDataModel } from './core'
|
|
8
|
-
|
|
9
|
-
export type GraphData<N extends GraphInputNode, L extends GraphInputLink> = {
|
|
10
|
-
nodes: N[];
|
|
11
|
-
links?: L[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export class GraphDataModel<
|
|
15
|
-
N extends GraphInputNode,
|
|
16
|
-
L extends GraphInputLink,
|
|
17
|
-
OutNode extends GraphNodeCore<N, L> = GraphNodeCore<N, L>,
|
|
18
|
-
OutLink extends GraphLinkCore<N, L> = GraphLinkCore<N, L>,
|
|
19
|
-
> extends CoreDataModel<GraphData<N, L>> {
|
|
20
|
-
private _nonConnectedNodes: OutNode[]
|
|
21
|
-
private _connectedNodes: OutNode[]
|
|
22
|
-
private _nodes: OutNode[] = []
|
|
23
|
-
private _links: OutLink[] = []
|
|
24
|
-
private _inputNodesMap = new Map<OutNode, N>()
|
|
25
|
-
|
|
26
|
-
// Model configuration
|
|
27
|
-
public nodeId: ((n: N) => string | undefined) = n => (isString(n.id) || isFinite(n.id as number)) ? `${n.id}` : undefined
|
|
28
|
-
public linkId: ((n: L) => string | undefined) = l => (isString(l.id) || isFinite(l.id as number)) ? `${l.id}` : undefined
|
|
29
|
-
public nodeSort: ((a: N, b: N) => number)
|
|
30
|
-
|
|
31
|
-
get data (): GraphData<N, L> {
|
|
32
|
-
return this._data
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
set data (inputData: GraphData<N, L>) {
|
|
36
|
-
if (!inputData) return
|
|
37
|
-
this._data = inputData
|
|
38
|
-
const prevNodes = this.nodes
|
|
39
|
-
const prevLinks = this.links
|
|
40
|
-
|
|
41
|
-
this._inputNodesMap.clear()
|
|
42
|
-
const nodes = cloneDeep(inputData?.nodes ?? []) as OutNode[]
|
|
43
|
-
const links = cloneDeep(inputData?.links ?? []) as OutLink[]
|
|
44
|
-
|
|
45
|
-
// Every node or link can have a private state used for rendering needs
|
|
46
|
-
// On data update we transfer state between objects with same ids
|
|
47
|
-
this.transferState(nodes, prevNodes, this.nodeId)
|
|
48
|
-
this.transferState(links, prevLinks, this.linkId)
|
|
49
|
-
|
|
50
|
-
// Set node `_id` and `_index`
|
|
51
|
-
nodes.forEach((node, i) => {
|
|
52
|
-
node._index = i
|
|
53
|
-
node._id = this.nodeId(node) || `${i}`
|
|
54
|
-
this._inputNodesMap.set(node, inputData.nodes[i])
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
// Sort nodes
|
|
58
|
-
if (isFunction(this.nodeSort)) nodes.sort(this.nodeSort)
|
|
59
|
-
|
|
60
|
-
// Fill link source and target
|
|
61
|
-
links.forEach((link, i) => {
|
|
62
|
-
link._indexGlobal = i
|
|
63
|
-
link.source = this.findNode(nodes, link.source)
|
|
64
|
-
link.target = this.findNode(nodes, link.target)
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
// Set link index for multiple link rendering
|
|
68
|
-
links.forEach((link, i) => {
|
|
69
|
-
if (!isUndefined(link._index) && !isUndefined(link._neighbours)) return
|
|
70
|
-
|
|
71
|
-
const linksFiltered = links.filter(l =>
|
|
72
|
-
((link.source === l.source) && (link.target === l.target)) ||
|
|
73
|
-
((link.source === l.target) && (link.target === l.source))
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
linksFiltered.forEach((l, i) => {
|
|
77
|
-
l._index = i
|
|
78
|
-
l._id = this.linkId(l) || `${l.source?._id}-${l.target?._id}-${i}`
|
|
79
|
-
l._neighbours = linksFiltered.length
|
|
80
|
-
l._direction = ((link.source === l.source) && (link.target === l.target)) ? 1 : -1
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
nodes.forEach(d => {
|
|
85
|
-
// Determine if a node is connected or not and store it as a property
|
|
86
|
-
d.links = links.filter(l => (l.source === d) || (l.target === d))
|
|
87
|
-
d._isConnected = d.links.length !== 0
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
this._nonConnectedNodes = nodes.filter(d => !d._isConnected)
|
|
91
|
-
this._connectedNodes = without(nodes, ...this._nonConnectedNodes)
|
|
92
|
-
|
|
93
|
-
this._nodes = nodes
|
|
94
|
-
this._links = links.filter(l => l.source && l.target)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
get nodes (): OutNode[] {
|
|
98
|
-
return this._nodes
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
get links (): OutLink[] {
|
|
102
|
-
return this._links
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
get connectedNodes (): OutNode[] {
|
|
106
|
-
return this._connectedNodes
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
get nonConnectedNodes (): OutNode[] {
|
|
110
|
-
return this._nonConnectedNodes
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
private findNode (nodes: OutNode[], nodeIdentifier: number | string | N): OutNode | undefined {
|
|
114
|
-
let foundNode: OutNode | undefined
|
|
115
|
-
|
|
116
|
-
if (isNumber(nodeIdentifier)) foundNode = nodes[nodeIdentifier as number]
|
|
117
|
-
else if (isString(nodeIdentifier)) foundNode = nodes.find(node => this.nodeId(node) === nodeIdentifier)
|
|
118
|
-
else if (isObject(nodeIdentifier)) foundNode = nodes.find(node => isEqual(this._inputNodesMap.get(node), nodeIdentifier))
|
|
119
|
-
|
|
120
|
-
if (!foundNode) {
|
|
121
|
-
console.warn(`Node ${nodeIdentifier} is missing from the nodes list`)
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return foundNode
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
private transferState<T extends { _state: Record<string, any>}> (
|
|
128
|
-
items: T[],
|
|
129
|
-
itemsPrev: T[],
|
|
130
|
-
getId: (d: T) => string
|
|
131
|
-
): void {
|
|
132
|
-
for (const item of items) {
|
|
133
|
-
const dPrev = itemsPrev.find((dp) => getId(dp) === getId(item))
|
|
134
|
-
if (dPrev) item._state = { ...dPrev._state }
|
|
135
|
-
else item._state = {}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// Utils
|
|
2
|
-
import { cloneDeep, isNumber, isObject, isString } from 'utils/data'
|
|
3
|
-
|
|
4
|
-
// Core Data Model
|
|
5
|
-
import { CoreDataModel } from 'data-models/core'
|
|
6
|
-
|
|
7
|
-
// Types
|
|
8
|
-
import { MapLink } from 'types/map'
|
|
9
|
-
|
|
10
|
-
export type MapGraphData<AreaDatum, PointDatum, LinkDatum> = {
|
|
11
|
-
areas?: AreaDatum[];
|
|
12
|
-
points?: PointDatum[];
|
|
13
|
-
links?: LinkDatum[];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class MapGraphDataModel<AreaDatum, PointDatum, LinkDatum> extends CoreDataModel<MapGraphData<AreaDatum, PointDatum, LinkDatum>> {
|
|
17
|
-
private _areas: AreaDatum[] = []
|
|
18
|
-
private _points: PointDatum[] = []
|
|
19
|
-
private _links: MapLink<PointDatum, LinkDatum>[] = []
|
|
20
|
-
|
|
21
|
-
// Model configuration
|
|
22
|
-
/* eslint-disable-next-line dot-notation */
|
|
23
|
-
public pointId: ((n: PointDatum) => string) = n => n['id']
|
|
24
|
-
/* eslint-disable-next-line dot-notation */
|
|
25
|
-
public linkSource: ((l: LinkDatum) => number | string | PointDatum) = l => l['source']
|
|
26
|
-
/* eslint-disable-next-line dot-notation */
|
|
27
|
-
public linkTarget: ((l: LinkDatum) => number | string | PointDatum) = l => l['target']
|
|
28
|
-
|
|
29
|
-
get data (): MapGraphData<AreaDatum, PointDatum, LinkDatum> {
|
|
30
|
-
return this._data
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
set data (data: MapGraphData<AreaDatum, PointDatum, LinkDatum>) {
|
|
34
|
-
if (!data) return
|
|
35
|
-
this._data = data
|
|
36
|
-
|
|
37
|
-
this._areas = cloneDeep(data?.areas ?? [])
|
|
38
|
-
this._points = cloneDeep(data?.points ?? [])
|
|
39
|
-
|
|
40
|
-
this._links = cloneDeep(data?.links ?? []).reduce((arr, link) => {
|
|
41
|
-
const source = this.findPoint(this.points, this.linkSource(link))
|
|
42
|
-
const target = this.findPoint(this.points, this.linkTarget(link))
|
|
43
|
-
if (source && target) arr.push({ source, target })
|
|
44
|
-
return arr
|
|
45
|
-
}, [])
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
get areas (): AreaDatum[] {
|
|
49
|
-
return this._areas
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
get points (): PointDatum[] {
|
|
53
|
-
return this._points
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
get links (): MapLink<PointDatum, LinkDatum>[] {
|
|
57
|
-
return this._links
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
private findPoint (points: PointDatum[], pointIdentifier: number | string | PointDatum): PointDatum | undefined {
|
|
61
|
-
let foundPoint: PointDatum | undefined
|
|
62
|
-
if (isNumber(pointIdentifier)) foundPoint = points[pointIdentifier as number]
|
|
63
|
-
else if (isString(pointIdentifier)) foundPoint = points.find(node => this.pointId(node) === pointIdentifier)
|
|
64
|
-
else if (isObject(pointIdentifier)) foundPoint = points.find(node => node === pointIdentifier)
|
|
65
|
-
|
|
66
|
-
if (!foundPoint) {
|
|
67
|
-
console.warn(`Point ${pointIdentifier} is missing from the points list`)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return foundPoint
|
|
71
|
-
}
|
|
72
|
-
}
|
package/src/data-models/map.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Core
|
|
2
|
-
import { CoreDataModel } from 'data-models/core'
|
|
3
|
-
|
|
4
|
-
// Types
|
|
5
|
-
import { NumericAccessor } from 'types/accessor'
|
|
6
|
-
|
|
7
|
-
// Utils
|
|
8
|
-
import { getDataLatLngBounds } from 'utils/map'
|
|
9
|
-
|
|
10
|
-
export class MapDataModel<PointDatum> extends CoreDataModel<PointDatum[]> {
|
|
11
|
-
getDataLatLngBounds (
|
|
12
|
-
pointLatitude: NumericAccessor<PointDatum>,
|
|
13
|
-
pointLongitude: NumericAccessor<PointDatum>,
|
|
14
|
-
paddingDegrees = 1
|
|
15
|
-
): [[number, number], [number, number]] {
|
|
16
|
-
return getDataLatLngBounds(this.data, pointLatitude, pointLongitude, paddingDegrees)
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Core
|
|
2
|
-
import { CoreDataModel } from './core'
|
|
3
|
-
|
|
4
|
-
export class SeriesDataModel<Datum> extends CoreDataModel<Datum[]> {
|
|
5
|
-
constructor (data?: Datum[]) {
|
|
6
|
-
super(data)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
get data (): Datum[] {
|
|
10
|
-
return this._data ?? []
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
set data (data: Datum[]) {
|
|
14
|
-
if (Array.isArray(data)) this._data = data
|
|
15
|
-
}
|
|
16
|
-
}
|