@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,407 +0,0 @@
|
|
|
1
|
-
import { css } from '@emotion/css'
|
|
2
|
-
import { extent, merge as mergeArrays } from 'd3-array'
|
|
3
|
-
import { Selection } from 'd3-selection'
|
|
4
|
-
|
|
5
|
-
// Global CSS variables (side effects import)
|
|
6
|
-
import 'styles/index'
|
|
7
|
-
|
|
8
|
-
// Core
|
|
9
|
-
import { ContainerCore } from 'core/container'
|
|
10
|
-
import { XYComponentCore } from 'core/xy-component'
|
|
11
|
-
import { XYComponentConfigInterface } from 'core/xy-component/config'
|
|
12
|
-
|
|
13
|
-
// Data Model
|
|
14
|
-
import { CoreDataModel } from 'data-models/core'
|
|
15
|
-
|
|
16
|
-
// Types
|
|
17
|
-
import { Spacing } from 'types/spacing'
|
|
18
|
-
import { AxisType } from 'components/axis/types'
|
|
19
|
-
import { ScaleDimension } from 'types/scale'
|
|
20
|
-
import { Direction } from 'types/direction'
|
|
21
|
-
|
|
22
|
-
// Utils
|
|
23
|
-
import { clamp, clean, flatten } from 'utils/data'
|
|
24
|
-
import { guid } from 'utils/misc'
|
|
25
|
-
|
|
26
|
-
// Config
|
|
27
|
-
import { XYContainerConfig, XYContainerConfigInterface } from './config'
|
|
28
|
-
import {
|
|
29
|
-
AreaConfigInterface,
|
|
30
|
-
BrushConfigInterface,
|
|
31
|
-
LineConfigInterface,
|
|
32
|
-
ScatterConfigInterface,
|
|
33
|
-
StackedBarConfigInterface,
|
|
34
|
-
TimelineConfigInterface,
|
|
35
|
-
} from '../../components'
|
|
36
|
-
|
|
37
|
-
export type XYConfigInterface<Datum> = XYComponentConfigInterface<Datum>
|
|
38
|
-
| StackedBarConfigInterface<Datum>
|
|
39
|
-
| LineConfigInterface<Datum>
|
|
40
|
-
| ScatterConfigInterface<Datum>
|
|
41
|
-
| BrushConfigInterface<Datum>
|
|
42
|
-
| TimelineConfigInterface<Datum>
|
|
43
|
-
| AreaConfigInterface<Datum>
|
|
44
|
-
|
|
45
|
-
export class XYContainer<Datum> extends ContainerCore {
|
|
46
|
-
config: XYContainerConfig<Datum> = new XYContainerConfig()
|
|
47
|
-
datamodel: CoreDataModel<Datum[]> = new CoreDataModel()
|
|
48
|
-
private _svgDefs: Selection<SVGDefsElement, unknown, null, undefined>
|
|
49
|
-
private _clipPath: Selection<SVGClipPathElement, unknown, null, undefined>
|
|
50
|
-
private _clipPathId = guid()
|
|
51
|
-
private _axisMargin: Spacing = { top: 0, bottom: 0, left: 0, right: 0 }
|
|
52
|
-
private _firstRender = true
|
|
53
|
-
|
|
54
|
-
constructor (element: HTMLElement, config?: XYContainerConfigInterface<Datum>, data?: Datum[]) {
|
|
55
|
-
super(element)
|
|
56
|
-
|
|
57
|
-
this._clipPath = this.svg.append('clipPath')
|
|
58
|
-
.attr('id', this._clipPathId)
|
|
59
|
-
this._clipPath.append('rect')
|
|
60
|
-
|
|
61
|
-
// When the base tag is specified on the HTML head,
|
|
62
|
-
// Safari fails to find the corresponding filter URL.
|
|
63
|
-
// We have to provide tull url in order to fix that
|
|
64
|
-
const highlightFilterId = 'saturate'
|
|
65
|
-
const baseUrl = window.location.href.replace(window.location.hash, '')
|
|
66
|
-
this.svg.attr('class', css`
|
|
67
|
-
--highlight-filter-id: url(${baseUrl}#${highlightFilterId}); // defining a css variable
|
|
68
|
-
`)
|
|
69
|
-
|
|
70
|
-
this._svgDefs = this.svg.append('defs')
|
|
71
|
-
this._svgDefs.append('filter')
|
|
72
|
-
.attr('id', highlightFilterId)
|
|
73
|
-
.attr('filterUnits', 'objectBoundingBox')
|
|
74
|
-
.html('<feColorMatrix type="saturate" in="SourceGraphic" values="1.35"/>')
|
|
75
|
-
|
|
76
|
-
if (config) {
|
|
77
|
-
this.updateContainer(config, true)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (data) {
|
|
81
|
-
this.setData(data, true)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Render if components are present and have data
|
|
85
|
-
if (this.components?.some(c => c.datamodel.data)) {
|
|
86
|
-
this.render()
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Force re-render axes when fonts are loaded
|
|
90
|
-
(document as any).fonts?.ready.then(() => {
|
|
91
|
-
if (!this._firstRender) this._renderAxes(0)
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
get components (): XYComponentCore<Datum>[] {
|
|
96
|
-
return this.config.components
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Overriding ContainerCore default get width method to work with axis auto margin
|
|
100
|
-
get width (): number {
|
|
101
|
-
const margin = this._getMargin()
|
|
102
|
-
return clamp(this.containerWidth - margin.left - margin.right, 0, Number.POSITIVE_INFINITY)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Overriding ContainerCore default get height method to work with axis auto margin
|
|
106
|
-
get height (): number {
|
|
107
|
-
const margin = this._getMargin()
|
|
108
|
-
|
|
109
|
-
return clamp(this.containerHeight - margin.top - margin.bottom, 0, Number.POSITIVE_INFINITY)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
setData (data: Datum[], preventRender?: boolean): void {
|
|
113
|
-
const { components, config } = this
|
|
114
|
-
if (!data) return
|
|
115
|
-
this.datamodel.data = data
|
|
116
|
-
|
|
117
|
-
components.forEach((c) => {
|
|
118
|
-
c.setData(data)
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
config.crosshair?.setData(data)
|
|
122
|
-
config.xAxis?.setData(data)
|
|
123
|
-
config.yAxis?.setData(data)
|
|
124
|
-
config.tooltip?.hide()
|
|
125
|
-
if (!preventRender) this.render()
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
updateContainer (containerConfig: XYContainerConfigInterface<Datum>, preventRender?: boolean): void {
|
|
129
|
-
super.updateContainer(containerConfig)
|
|
130
|
-
this.removeAllChildren()
|
|
131
|
-
|
|
132
|
-
// If there were any new components added we need to pass them data
|
|
133
|
-
this.setData(this.datamodel.data, true)
|
|
134
|
-
|
|
135
|
-
// Set up the axes
|
|
136
|
-
if (containerConfig.xAxis) {
|
|
137
|
-
this.config.xAxis.config.type = AxisType.X
|
|
138
|
-
this.element.appendChild(containerConfig.xAxis.element)
|
|
139
|
-
}
|
|
140
|
-
if (containerConfig.yAxis) {
|
|
141
|
-
this.config.yAxis.config.type = AxisType.Y
|
|
142
|
-
this.element.appendChild(containerConfig.yAxis.element)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Re-insert elements to the DOM
|
|
146
|
-
for (const c of this.components) {
|
|
147
|
-
this.element.appendChild(c.element)
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Set up the tooltip
|
|
151
|
-
const tooltip = containerConfig.tooltip
|
|
152
|
-
if (tooltip) {
|
|
153
|
-
if (!tooltip.hasContainer()) tooltip.setContainer(this._container)
|
|
154
|
-
tooltip.setComponents(this.components)
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Set up the crosshair
|
|
158
|
-
const crosshair = containerConfig.crosshair
|
|
159
|
-
if (crosshair) {
|
|
160
|
-
crosshair.setContainer(this.svg)
|
|
161
|
-
crosshair.tooltip = tooltip
|
|
162
|
-
|
|
163
|
-
this.element.appendChild(crosshair.element)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Clipping path
|
|
167
|
-
this.element.appendChild(this._clipPath.node())
|
|
168
|
-
|
|
169
|
-
// Defs
|
|
170
|
-
this.element.appendChild(this._svgDefs.node())
|
|
171
|
-
|
|
172
|
-
// Rendering
|
|
173
|
-
if (!preventRender) this.render()
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
updateComponents (componentConfigs: XYConfigInterface<Datum>[], preventRender?: boolean): void {
|
|
177
|
-
const { config } = this
|
|
178
|
-
|
|
179
|
-
this.components.forEach((c, i) => {
|
|
180
|
-
const componentConfig = componentConfigs[i]
|
|
181
|
-
if (componentConfig) {
|
|
182
|
-
c.setConfig(componentConfigs[i])
|
|
183
|
-
}
|
|
184
|
-
})
|
|
185
|
-
|
|
186
|
-
this.updateScales(...this.components, config.xAxis, config.yAxis, config.crosshair)
|
|
187
|
-
if (!preventRender) this.render()
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
update (containerConfig: XYContainerConfigInterface<Datum>, componentConfigs?: XYComponentConfigInterface<Datum>[], data?: Datum[]): void {
|
|
191
|
-
if (data) this.datamodel.data = data // Just updating the data model because the `updateContainer` method has the `setData` step inside
|
|
192
|
-
if (containerConfig) this.updateContainer(containerConfig, true)
|
|
193
|
-
if (componentConfigs) this.updateComponents(componentConfigs, true)
|
|
194
|
-
this.render()
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
_render (customDuration?: number): void {
|
|
198
|
-
const { config } = this
|
|
199
|
-
super._render()
|
|
200
|
-
|
|
201
|
-
// Calculate extra margin required to fit the axes
|
|
202
|
-
if (config.autoMargin) {
|
|
203
|
-
this._setAutoMargin()
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// Get chart total margin after auto margin calculations
|
|
207
|
-
const margin = this._getMargin()
|
|
208
|
-
|
|
209
|
-
// Update Scales of all the components at once to calculate required paddings and sync them
|
|
210
|
-
this.updateScales(...this.components, config.xAxis, config.yAxis, config.crosshair)
|
|
211
|
-
|
|
212
|
-
// Render components
|
|
213
|
-
for (const c of this.components) {
|
|
214
|
-
c.g.attr('transform', `translate(${margin.left},${margin.top})`)
|
|
215
|
-
.style('clip-path', c.clippable ? `url(#${this._clipPathId})` : null)
|
|
216
|
-
.style('-webkit-clip-path', c.clippable ? `url(#${this._clipPathId})` : null)
|
|
217
|
-
|
|
218
|
-
c.render(customDuration)
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
this._renderAxes(this._firstRender ? 0 : customDuration)
|
|
222
|
-
|
|
223
|
-
// Clip Rect
|
|
224
|
-
// Extending the clipping path to allow small overflow (e.g. Line will looks better that way when it touches the edges)
|
|
225
|
-
const clipPathExtension = 2
|
|
226
|
-
this._clipPath.select('rect')
|
|
227
|
-
.attr('x', -clipPathExtension)
|
|
228
|
-
.attr('y', -clipPathExtension)
|
|
229
|
-
.attr('width', this.width + 2 * clipPathExtension)
|
|
230
|
-
.attr('height', this.height + 2 * clipPathExtension)
|
|
231
|
-
|
|
232
|
-
// Tooltip
|
|
233
|
-
config.tooltip?.update() // Re-bind events
|
|
234
|
-
|
|
235
|
-
// Crosshair
|
|
236
|
-
const crosshair = config.crosshair
|
|
237
|
-
if (crosshair) {
|
|
238
|
-
// Pass accessors
|
|
239
|
-
const yAccessors = this.components.filter(c => !c.stacked).map(c => c.config.y)
|
|
240
|
-
const yStackedAccessors = this.components.filter(c => c.stacked).map(c => c.config.y)
|
|
241
|
-
// eslint-disable-next-line dot-notation
|
|
242
|
-
const baselineAccessor = this.components.find(c => c.config['baseline'])?.config['baseline']
|
|
243
|
-
|
|
244
|
-
crosshair.accessors = {
|
|
245
|
-
x: this.components[0]?.config.x,
|
|
246
|
-
y: flatten(yAccessors),
|
|
247
|
-
yStacked: flatten(yStackedAccessors),
|
|
248
|
-
baseline: baselineAccessor,
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
crosshair.g.attr('transform', `translate(${margin.left},${margin.top})`)
|
|
252
|
-
.style('clip-path', `url(#${this._clipPathId})`)
|
|
253
|
-
.style('-webkit-clip-path', `url(#${this._clipPathId})`)
|
|
254
|
-
crosshair.hide()
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
this._firstRender = false
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
updateScales<T extends XYComponentCore<Datum>> (...components: T[]): void {
|
|
261
|
-
const c = clean(components || this.components)
|
|
262
|
-
this._setScales(...c)
|
|
263
|
-
this._updateScalesDomain(...c)
|
|
264
|
-
this._updateScalesRange(...c)
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
_setScales<T extends XYComponentCore<Datum>> (...components: T[]): void {
|
|
268
|
-
const { config } = this
|
|
269
|
-
if (!components) return
|
|
270
|
-
|
|
271
|
-
// Set the X and Y scales
|
|
272
|
-
if (config.xScale) components.forEach(c => c.setScale(ScaleDimension.X, config.xScale))
|
|
273
|
-
if (config.yScale) components.forEach(c => c.setScale(ScaleDimension.Y, config.yScale))
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
_updateScalesDomain<T extends XYComponentCore<Datum>> (...components: T[]): void {
|
|
277
|
-
const { config } = this
|
|
278
|
-
if (!components) return
|
|
279
|
-
|
|
280
|
-
// Loop over all the dimensions
|
|
281
|
-
Object.values(ScaleDimension).forEach((dimension: ScaleDimension) => {
|
|
282
|
-
const [min, max] = extent(
|
|
283
|
-
mergeArrays(
|
|
284
|
-
components
|
|
285
|
-
.filter(c => !c.config.excludeFromDomainCalculation)
|
|
286
|
-
.map(c => c.getDataExtent(dimension, config.scaleByDomain))
|
|
287
|
-
) as number[]
|
|
288
|
-
) // Components with undefined dimension accessors will return [undefined, undefined] but d3.extent will take care of that
|
|
289
|
-
|
|
290
|
-
const configuredDomain = dimension === ScaleDimension.Y ? config.yDomain : config.xDomain
|
|
291
|
-
const configuredDomainMinConstraint = dimension === ScaleDimension.Y ? config.yDomainMinConstraint : config.xDomainMinConstraint
|
|
292
|
-
const configuredDomainMaxConstraint = dimension === ScaleDimension.Y ? config.yDomainMaxConstraint : config.xDomainMaxConstraint
|
|
293
|
-
const domainMin = configuredDomain?.[0] ?? min ?? 0
|
|
294
|
-
const domainMax = configuredDomain?.[1] ?? max ?? 1
|
|
295
|
-
const domain = [
|
|
296
|
-
clamp(domainMin, configuredDomainMinConstraint?.[0] ?? Number.NEGATIVE_INFINITY, configuredDomainMinConstraint?.[1] ?? Number.POSITIVE_INFINITY),
|
|
297
|
-
clamp(domainMax, configuredDomainMaxConstraint?.[0] ?? Number.NEGATIVE_INFINITY, configuredDomainMaxConstraint?.[1] ?? Number.POSITIVE_INFINITY),
|
|
298
|
-
]
|
|
299
|
-
|
|
300
|
-
if (config.preventEmptyDomain && (domain[0] === domain[1]) && isFinite(domain[0])) {
|
|
301
|
-
domain[1] = domain[0] + 1
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
components.forEach(c => c.setScaleDomain(dimension, domain))
|
|
305
|
-
})
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
_updateScalesRange<T extends XYComponentCore<Datum>> (...components: T[]): void {
|
|
309
|
-
const { config } = this
|
|
310
|
-
if (!components) return
|
|
311
|
-
|
|
312
|
-
// Set initial scale range
|
|
313
|
-
const isYDirectionSouth = config.yDirection === Direction.South
|
|
314
|
-
const xRange: [number, number] = [config.padding.left ?? 0, this.width - config.padding.right ?? 0]
|
|
315
|
-
const yRange: [number, number] = [this.height - config.padding.bottom ?? 0, config.padding.top ?? 0]
|
|
316
|
-
if (isYDirectionSouth) yRange.reverse()
|
|
317
|
-
|
|
318
|
-
for (const c of components) {
|
|
319
|
-
c.setSize(this.width, this.height, this.containerWidth, this.containerHeight)
|
|
320
|
-
c.setScaleRange(ScaleDimension.X, config.xRange ?? xRange)
|
|
321
|
-
c.setScaleRange(ScaleDimension.Y, config.yRange ?? yRange)
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// Get and combine bleed
|
|
325
|
-
const bleed = components.map(c => c.bleed).reduce((bleed, b) => {
|
|
326
|
-
for (const key of Object.keys(bleed)) {
|
|
327
|
-
if (bleed[key] < b[key]) bleed[key] = b[key]
|
|
328
|
-
}
|
|
329
|
-
return bleed
|
|
330
|
-
}, { top: 0, bottom: 0, left: 0, right: 0 })
|
|
331
|
-
|
|
332
|
-
// Update scale range
|
|
333
|
-
for (const c of components) {
|
|
334
|
-
c.setScaleRange(ScaleDimension.X, [xRange[0] + bleed.left, xRange[1] - bleed.right])
|
|
335
|
-
c.setScaleRange(
|
|
336
|
-
ScaleDimension.Y,
|
|
337
|
-
isYDirectionSouth
|
|
338
|
-
? [yRange[0] + bleed.top, yRange[1] - bleed.bottom] // if Y axis is directed downwards
|
|
339
|
-
: [yRange[0] - bleed.bottom, yRange[1] + bleed.top] // if Y axis is directed upwards
|
|
340
|
-
)
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
_renderAxes (duration: number): void {
|
|
345
|
-
const { config: { xAxis, yAxis } } = this
|
|
346
|
-
const margin = this._getMargin()
|
|
347
|
-
|
|
348
|
-
const axes = clean([xAxis, yAxis])
|
|
349
|
-
axes.forEach(axis => {
|
|
350
|
-
const offset = axis.getOffset(margin)
|
|
351
|
-
axis.g.attr('transform', `translate(${offset.left},${offset.top})`)
|
|
352
|
-
axis.render(duration)
|
|
353
|
-
})
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
_setAutoMargin (): void {
|
|
357
|
-
const { config: { xAxis, yAxis } } = this
|
|
358
|
-
|
|
359
|
-
// At first we need to set the domain to the scales
|
|
360
|
-
const components = clean([...this.components, xAxis, yAxis])
|
|
361
|
-
this._updateScalesDomain(...components)
|
|
362
|
-
|
|
363
|
-
// Calculate margin required by the axes
|
|
364
|
-
// We do two iterations on the first render, because the amount and size of ticks can change
|
|
365
|
-
// after new margin are calculated and applied (axes dimensions will change).
|
|
366
|
-
// That's needed for correct label placement.
|
|
367
|
-
const numIterations = this._firstRender ? 2 : 1
|
|
368
|
-
for (let i = 0; i < numIterations; i += 1) {
|
|
369
|
-
const axisMargin: Spacing = { top: 0, bottom: 0, left: 0, right: 0 }
|
|
370
|
-
this._updateScalesRange(...components)
|
|
371
|
-
const axes = clean([xAxis, yAxis])
|
|
372
|
-
axes.forEach(axis => {
|
|
373
|
-
axis.preRender()
|
|
374
|
-
|
|
375
|
-
const m = axis.getRequiredMargin()
|
|
376
|
-
if (axisMargin.top < m.top) axisMargin.top = m.top
|
|
377
|
-
if (axisMargin.bottom < m.bottom) axisMargin.bottom = m.bottom
|
|
378
|
-
if (axisMargin.left < m.left) axisMargin.left = m.left
|
|
379
|
-
if (axisMargin.right < m.right) axisMargin.right = m.right
|
|
380
|
-
})
|
|
381
|
-
|
|
382
|
-
this._axisMargin = axisMargin
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
private _getMargin (): Spacing {
|
|
387
|
-
const { config: { margin } } = this
|
|
388
|
-
|
|
389
|
-
return {
|
|
390
|
-
top: margin.top + this._axisMargin.top,
|
|
391
|
-
bottom: margin.bottom + this._axisMargin.bottom,
|
|
392
|
-
left: margin.left + this._axisMargin.left,
|
|
393
|
-
right: margin.right + this._axisMargin.right,
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
public destroy (): void {
|
|
398
|
-
const { components, config: { tooltip, crosshair, xAxis, yAxis } } = this
|
|
399
|
-
super.destroy()
|
|
400
|
-
|
|
401
|
-
for (const c of components) c?.destroy()
|
|
402
|
-
tooltip?.destroy()
|
|
403
|
-
crosshair?.destroy()
|
|
404
|
-
xAxis?.destroy()
|
|
405
|
-
yAxis?.destroy()
|
|
406
|
-
}
|
|
407
|
-
}
|
package/src/containers.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ContainerCore } from './core/container'
|
|
2
|
-
export type { ContainerConfigInterface } from './core/container/config'
|
|
3
|
-
export { SingleContainer } from './containers/single-container'
|
|
4
|
-
export type { SingleContainerConfigInterface } from './containers/single-container/config'
|
|
5
|
-
export { XYContainer } from './containers/xy-container'
|
|
6
|
-
export type { XYContainerConfigInterface } from './containers/xy-container/config'
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-irregular-whitespace */
|
|
2
|
-
import { Config } from 'core/config'
|
|
3
|
-
import { VisEventCallback, VisEventType } from 'core/component/types'
|
|
4
|
-
|
|
5
|
-
export interface ComponentConfigInterface {
|
|
6
|
-
/** Animation duration of the data update transitions in milliseconds. Default: `600` */
|
|
7
|
-
duration?: number;
|
|
8
|
-
/** Events configuration. An object containing properties in the following format:
|
|
9
|
-
*
|
|
10
|
-
* ```
|
|
11
|
-
* {
|
|
12
|
-
* [selectorString]: {
|
|
13
|
-
* [eventType]: callbackFunction
|
|
14
|
-
* }
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
* e.g.:
|
|
18
|
-
* ```
|
|
19
|
-
* {
|
|
20
|
-
* [Area.selectors.area]: {
|
|
21
|
-
* click: (d) => console.log("Clicked Area", d)
|
|
22
|
-
* }
|
|
23
|
-
* }
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
events?: {
|
|
27
|
-
[selector: string]: {
|
|
28
|
-
[eventType in VisEventType]?: VisEventCallback;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
/** You can set every SVG and HTML visualization object to have a custom DOM attributes, which is useful
|
|
32
|
-
* when you want to do unit or end-to-end testing. Attributes configuration object has the following structure:
|
|
33
|
-
*
|
|
34
|
-
* ```
|
|
35
|
-
* {
|
|
36
|
-
* [selectorString]: {
|
|
37
|
-
* [attributeName]: attribute constant value or accessor function
|
|
38
|
-
* }
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
* e.g.:
|
|
42
|
-
* ```
|
|
43
|
-
* {
|
|
44
|
-
* [Area.selectors.area]: {
|
|
45
|
-
* "test-value": d => d.value
|
|
46
|
-
* }
|
|
47
|
-
* }
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
attributes?: {
|
|
51
|
-
[selector: string]: {
|
|
52
|
-
[attr: string]: string | number | boolean | ((datum: any) => string | number | boolean);
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export class ComponentConfig extends Config implements ComponentConfigInterface {
|
|
58
|
-
duration = 600
|
|
59
|
-
events = {}
|
|
60
|
-
attributes = {}
|
|
61
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { select, Selection } from 'd3-selection'
|
|
2
|
-
import { Transition } from 'd3-transition'
|
|
3
|
-
|
|
4
|
-
// Core
|
|
5
|
-
import { CoreDataModel } from 'data-models/core'
|
|
6
|
-
|
|
7
|
-
// Utils
|
|
8
|
-
import { throttle } from 'utils/data'
|
|
9
|
-
import { guid } from 'utils/misc'
|
|
10
|
-
|
|
11
|
-
// Types
|
|
12
|
-
import { ComponentType, Sizing } from 'types/component'
|
|
13
|
-
import { Spacing } from 'types/spacing'
|
|
14
|
-
|
|
15
|
-
// Local Types
|
|
16
|
-
import { VisEventCallback, VisEventType } from './types'
|
|
17
|
-
|
|
18
|
-
// Config
|
|
19
|
-
import { ComponentConfig, ComponentConfigInterface } from './config'
|
|
20
|
-
|
|
21
|
-
export class ComponentCore<
|
|
22
|
-
CoreDatum,
|
|
23
|
-
ConfigClass extends ComponentConfig = ComponentConfig,
|
|
24
|
-
ConfigInterface extends ComponentConfigInterface = ComponentConfigInterface,
|
|
25
|
-
> {
|
|
26
|
-
element: SVGGElement | HTMLElement
|
|
27
|
-
type: ComponentType = ComponentType.SVG
|
|
28
|
-
g: Selection<SVGGElement, unknown, null, undefined> | Selection<HTMLElement, unknown, null, undefined>
|
|
29
|
-
config: ConfigClass
|
|
30
|
-
prevConfig: ConfigClass
|
|
31
|
-
datamodel: CoreDataModel<CoreDatum> = new CoreDataModel()
|
|
32
|
-
sizing: Sizing | string = Sizing.Fit // Supported by SingleContainer and a subset of components only (Sankey)
|
|
33
|
-
uid: string
|
|
34
|
-
|
|
35
|
-
events: {
|
|
36
|
-
[selector: string]: {
|
|
37
|
-
[eventType in VisEventType]?: VisEventCallback;
|
|
38
|
-
};
|
|
39
|
-
} = {}
|
|
40
|
-
|
|
41
|
-
/** Component width in pixels. This property is set automatically by the container. */
|
|
42
|
-
protected _width = 400
|
|
43
|
-
/** Component height in pixels. This property is set automatically by the container. */
|
|
44
|
-
protected _height = 200
|
|
45
|
-
/** Container width in pixels. This property is set automatically by the container. */
|
|
46
|
-
protected _containerWidth: number | undefined = undefined
|
|
47
|
-
/** Container height in pixels. This property is set automatically by the container. */
|
|
48
|
-
protected _containerHeight: number | undefined = undefined
|
|
49
|
-
|
|
50
|
-
_setUpComponentEventsThrottled = throttle(this._setUpComponentEvents, 500)
|
|
51
|
-
_setCustomAttributesThrottled = throttle(this._setCustomAttributes, 500)
|
|
52
|
-
|
|
53
|
-
constructor (type = ComponentType.SVG) {
|
|
54
|
-
if (type === ComponentType.SVG) {
|
|
55
|
-
this.element = document.createElementNS('http://www.w3.org/2000/svg', 'g')
|
|
56
|
-
} else {
|
|
57
|
-
this.element = document.createElement('div')
|
|
58
|
-
}
|
|
59
|
-
this.uid = guid()
|
|
60
|
-
this.g = select(this.element) as Selection<SVGGElement, unknown, null, undefined> | Selection<HTMLElement, unknown, null, undefined>
|
|
61
|
-
|
|
62
|
-
// Setting the root class if available
|
|
63
|
-
// eslint-disable-next-line dot-notation
|
|
64
|
-
const rootClass = this.constructor?.['selectors']?.root as string
|
|
65
|
-
if (rootClass) this.g.attr('class', rootClass)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
setConfig (config: ConfigInterface): void {
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
70
|
-
const ConfigModel = (this.config.constructor as typeof ComponentConfig)
|
|
71
|
-
this.prevConfig = this.config // Store the previous config instance
|
|
72
|
-
this.config = new ConfigModel().init(config) as ConfigClass
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
setData (data: CoreDatum): void {
|
|
76
|
-
this.datamodel.data = data
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
setSize (width: number, height: number, containerWidth: number, containerHeight: number): void {
|
|
80
|
-
if (isFinite(width)) this._width = width
|
|
81
|
-
if (isFinite(height)) this._height = height
|
|
82
|
-
if (isFinite(containerWidth)) this._containerWidth = containerWidth
|
|
83
|
-
if (isFinite(containerHeight)) this._containerHeight = containerHeight
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
render (duration = this.config.duration): void {
|
|
87
|
-
this._render(duration)
|
|
88
|
-
|
|
89
|
-
// While transition is in progress, we add the 'animating' attribute to the component's SVG group
|
|
90
|
-
const ANIMATING_ATTR = 'animating'
|
|
91
|
-
if (duration) {
|
|
92
|
-
this.g.attr(ANIMATING_ATTR, '')
|
|
93
|
-
const transition = this.g
|
|
94
|
-
.transition(ANIMATING_ATTR)
|
|
95
|
-
.duration(duration) as Transition<SVGGElement | HTMLElement, unknown, null, undefined>
|
|
96
|
-
|
|
97
|
-
transition.on('end interrupt', () => {
|
|
98
|
-
this.g.attr(ANIMATING_ATTR, null)
|
|
99
|
-
})
|
|
100
|
-
}
|
|
101
|
-
this._setUpComponentEventsThrottled()
|
|
102
|
-
this._setCustomAttributesThrottled()
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
get bleed (): Spacing {
|
|
106
|
-
return { top: 0, bottom: 0, left: 0, right: 0 }
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
110
|
-
_render (duration = this.config.duration): void {
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
private _setCustomAttributes (): void {
|
|
114
|
-
const attributeMap = this.config.attributes
|
|
115
|
-
|
|
116
|
-
Object.keys(attributeMap).forEach(className => {
|
|
117
|
-
Object.keys(attributeMap[className]).forEach(attr => {
|
|
118
|
-
(this.g as Selection<SVGGElement | HTMLElement, unknown, null, undefined>)
|
|
119
|
-
.selectAll(`.${className}`)
|
|
120
|
-
.attr(attr, attributeMap[className][attr])
|
|
121
|
-
})
|
|
122
|
-
})
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
private _setUpComponentEvents (): void {
|
|
126
|
-
// Set up default events
|
|
127
|
-
this._bindEvents(this.events)
|
|
128
|
-
|
|
129
|
-
// Set up user-defined events
|
|
130
|
-
this._bindEvents(this.config.events, '.user')
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
private _bindEvents (events = this.events, suffix = ''): void {
|
|
134
|
-
Object.keys(events).forEach(className => {
|
|
135
|
-
Object.keys(events[className]).forEach(eventType => {
|
|
136
|
-
const selection = (this.g as Selection<SVGGElement | HTMLElement, unknown, null, undefined>).selectAll(`.${className}`)
|
|
137
|
-
selection.on(eventType + suffix, (event: Event, d) => {
|
|
138
|
-
const els = selection.nodes()
|
|
139
|
-
const i = els.indexOf(event.currentTarget as SVGGElement | HTMLElement)
|
|
140
|
-
return events[className][eventType](d, event, i, els)
|
|
141
|
-
})
|
|
142
|
-
})
|
|
143
|
-
})
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
public destroy (): void {
|
|
147
|
-
this.g?.remove()
|
|
148
|
-
this.element = undefined
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
public isDestroyed (): boolean {
|
|
152
|
-
return !this.element
|
|
153
|
-
}
|
|
154
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type VisEventType = 'touchstart' | 'touchmove' | 'touchend' | 'mouseover' | 'mousemove' | 'mousedown' | 'mouseup'
|
|
2
|
-
| 'click' | 'auxclick' | 'contextmenu' | 'dblclick' | 'mouseenter' | 'mouseleave' | 'mouseout' | 'scroll'
|
|
3
|
-
| 'select' | 'wheel' | 'pointerdown' | 'pointerup' | 'pointerout' | 'pointermove'
|
|
4
|
-
|
|
5
|
-
export type VisEventCallback<Datum = any> =
|
|
6
|
-
((data: Datum, event: MouseEvent, i: number, els: (SVGElement | HTMLElement)[]) => void) |
|
|
7
|
-
((data: Datum, event: WheelEvent, i: number, els: (SVGElement | HTMLElement)[]) => void) |
|
|
8
|
-
((data: Datum, event: PointerEvent, i: number, els: (SVGElement | HTMLElement)[]) => void) |
|
|
9
|
-
((data: Datum, event: TouchEvent, i: number, els: (SVGElement | HTMLElement)[]) => void);
|
package/src/core/config/index.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isPlainObject, merge } from 'utils/data'
|
|
2
|
-
|
|
3
|
-
export class Config {
|
|
4
|
-
init<T> (config: T): this {
|
|
5
|
-
Object.keys(config).forEach(key => {
|
|
6
|
-
if (isPlainObject(this[key]) && isPlainObject(config[key])) this[key] = merge(this[key], config[key])
|
|
7
|
-
else this[key] = config[key]
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
return this
|
|
11
|
-
}
|
|
12
|
-
}
|