@unovis/ts 1.1.1-beta.7 → 1.1.1-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/area/config.d.ts +25 -0
- package/components/area/config.js +16 -0
- package/components/area/config.js.map +1 -0
- package/components/area/index.d.ts +19 -0
- package/components/area/index.js +102 -0
- package/components/area/index.js.map +1 -0
- package/components/area/style.d.ts +3 -0
- package/{src/components/area/style.ts → components/area/style.js} +10 -9
- package/components/area/style.js.map +1 -0
- package/components/area/types.d.ts +6 -0
- package/components/axis/config.d.ts +71 -0
- package/components/axis/config.js +32 -0
- package/components/axis/config.js.map +1 -0
- package/components/axis/index.d.ts +44 -0
- package/components/axis/index.js +305 -0
- package/components/axis/index.js.map +1 -0
- package/components/axis/style.d.ts +9 -0
- package/{src/components/axis/style.ts → components/axis/style.js} +22 -27
- package/components/axis/style.js.map +1 -0
- package/components/axis/types.d.ts +4 -0
- package/components/axis/types.js +8 -0
- package/components/axis/types.js.map +1 -0
- package/components/brush/config.d.ts +42 -0
- package/components/brush/config.js +24 -0
- package/components/brush/config.js.map +1 -0
- package/components/brush/index.d.ts +28 -0
- package/components/brush/index.js +199 -0
- package/components/brush/index.js.map +1 -0
- package/components/brush/style.d.ts +5 -0
- package/{src/components/brush/style.ts → components/brush/style.js} +14 -15
- package/components/brush/style.js.map +1 -0
- package/components/brush/types.d.ts +7 -0
- package/components/brush/types.js +8 -0
- package/components/brush/types.js.map +1 -0
- package/components/bullet-legend/config.d.ts +34 -0
- package/components/bullet-legend/config.js +16 -0
- package/components/bullet-legend/config.js.map +1 -0
- package/components/bullet-legend/index.d.ts +19 -0
- package/components/bullet-legend/index.js +79 -0
- package/components/bullet-legend/index.js.map +1 -0
- package/components/bullet-legend/style.d.ts +6 -0
- package/{src/components/bullet-legend/style.ts → components/bullet-legend/style.js} +16 -18
- package/components/bullet-legend/style.js.map +1 -0
- package/components/bullet-legend/types.d.ts +7 -0
- package/components/bullet-legend/types.js +2 -0
- package/components/bullet-legend/types.js.map +1 -0
- package/components/chord-diagram/config.d.ts +44 -0
- package/components/chord-diagram/config.js +25 -0
- package/components/chord-diagram/config.js.map +1 -0
- package/components/chord-diagram/index.d.ts +42 -0
- package/components/chord-diagram/index.js +305 -0
- package/components/chord-diagram/index.js.map +1 -0
- package/components/chord-diagram/modules/label.d.ts +8 -0
- package/components/chord-diagram/modules/label.js +115 -0
- package/components/chord-diagram/modules/label.js.map +1 -0
- package/components/chord-diagram/modules/link.d.ts +21 -0
- package/components/chord-diagram/modules/link.js +63 -0
- package/components/chord-diagram/modules/link.js.map +1 -0
- package/components/chord-diagram/modules/node.d.ts +17 -0
- package/components/chord-diagram/modules/node.js +52 -0
- package/components/chord-diagram/modules/node.js.map +1 -0
- package/components/chord-diagram/style.d.ts +13 -0
- package/{src/components/chord-diagram/style.ts → components/chord-diagram/style.js} +30 -39
- package/components/chord-diagram/style.js.map +1 -0
- package/components/chord-diagram/types.d.ts +58 -0
- package/components/chord-diagram/types.js +8 -0
- package/components/chord-diagram/types.js.map +1 -0
- package/components/crosshair/config.d.ts +43 -0
- package/components/crosshair/config.js +19 -0
- package/components/crosshair/config.js.map +1 -0
- package/components/crosshair/index.d.ts +35 -0
- package/components/crosshair/index.js +183 -0
- package/components/crosshair/index.js.map +1 -0
- package/components/crosshair/style.d.ts +4 -0
- package/{src/components/crosshair/style.ts → components/crosshair/style.js} +12 -12
- package/components/crosshair/style.js.map +1 -0
- package/components/crosshair/types.d.ts +13 -0
- package/components/crosshair/types.js +2 -0
- package/components/crosshair/types.js.map +1 -0
- package/components/donut/config.d.ts +59 -0
- package/components/donut/config.js +28 -0
- package/components/donut/config.js.map +1 -0
- package/components/donut/index.d.ts +21 -0
- package/components/donut/index.js +107 -0
- package/components/donut/index.js.map +1 -0
- package/components/donut/modules/arc.d.ts +10 -0
- package/components/donut/modules/arc.js +59 -0
- package/components/donut/modules/arc.js.map +1 -0
- package/components/donut/style.d.ts +7 -0
- package/{src/components/donut/style.ts → components/donut/style.js} +18 -20
- package/components/donut/style.js.map +1 -0
- package/components/donut/types.d.ts +20 -0
- package/components/flow-legend/config.d.ts +29 -0
- package/components/flow-legend/config.js +18 -0
- package/components/flow-legend/config.js.map +1 -0
- package/components/flow-legend/index.d.ts +16 -0
- package/components/flow-legend/index.js +75 -0
- package/components/flow-legend/index.js.map +1 -0
- package/components/flow-legend/style.d.ts +8 -0
- package/{src/components/flow-legend/style.ts → components/flow-legend/style.js} +21 -25
- package/components/flow-legend/style.js.map +1 -0
- package/components/flow-legend/types.d.ts +9 -0
- package/components/flow-legend/types.js +8 -0
- package/components/flow-legend/types.js.map +1 -0
- package/components/free-brush/config.d.ts +45 -0
- package/components/free-brush/config.js +24 -0
- package/components/free-brush/config.js.map +1 -0
- package/components/free-brush/index.d.ts +20 -0
- package/components/free-brush/index.js +192 -0
- package/components/free-brush/index.js.map +1 -0
- package/components/free-brush/style.d.ts +4 -0
- package/{src/components/free-brush/style.ts → components/free-brush/style.js} +12 -12
- package/components/free-brush/style.js.map +1 -0
- package/components/free-brush/types.d.ts +7 -0
- package/components/free-brush/types.js +9 -0
- package/components/free-brush/types.js.map +1 -0
- package/components/graph/config.d.ts +238 -0
- package/components/graph/config.js +84 -0
- package/components/graph/config.js.map +1 -0
- package/components/graph/index.d.ts +126 -0
- package/components/graph/index.js +656 -0
- package/components/graph/index.js.map +1 -0
- package/components/graph/modules/layout-helpers.d.ts +21 -0
- package/components/graph/modules/layout-helpers.js +69 -0
- package/components/graph/modules/layout-helpers.js.map +1 -0
- package/components/graph/modules/layout.d.ts +10 -0
- package/components/graph/modules/layout.js +399 -0
- package/components/graph/modules/layout.js.map +1 -0
- package/components/graph/modules/link/helper.d.ts +25 -0
- package/components/graph/modules/link/helper.js +74 -0
- package/components/graph/modules/link/helper.js.map +1 -0
- package/components/graph/modules/link/index.d.ts +11 -0
- package/components/graph/modules/link/index.js +212 -0
- package/components/graph/modules/link/index.js.map +1 -0
- package/components/graph/modules/link/style.d.ts +15 -0
- package/{src/components/graph/modules/link/style.ts → components/graph/modules/link/style.js} +34 -45
- package/components/graph/modules/link/style.js.map +1 -0
- package/components/graph/modules/node/helper.d.ts +21 -0
- package/components/graph/modules/node/helper.js +126 -0
- package/components/graph/modules/node/helper.js.map +1 -0
- package/components/graph/modules/node/index.d.ts +11 -0
- package/components/graph/modules/node/index.js +252 -0
- package/components/graph/modules/node/index.js.map +1 -0
- package/components/graph/modules/node/style.d.ts +24 -0
- package/{src/components/graph/modules/node/style.ts → components/graph/modules/node/style.js} +52 -72
- package/components/graph/modules/node/style.js.map +1 -0
- package/components/graph/modules/panel/helper.d.ts +18 -0
- package/components/graph/modules/panel/helper.js +111 -0
- package/components/graph/modules/panel/helper.js.map +1 -0
- package/components/graph/modules/panel/index.d.ts +7 -0
- package/components/graph/modules/panel/index.js +98 -0
- package/components/graph/modules/panel/index.js.map +1 -0
- package/components/graph/modules/panel/style.d.ts +14 -0
- package/{src/components/graph/modules/panel/style.ts → components/graph/modules/panel/style.js} +32 -42
- package/components/graph/modules/panel/style.js.map +1 -0
- package/components/graph/modules/shape.d.ts +6 -0
- package/components/graph/modules/shape.js +80 -0
- package/components/graph/modules/shape.js.map +1 -0
- package/components/graph/modules/zoom-levels.d.ts +6 -0
- package/components/graph/modules/zoom-levels.js +10 -0
- package/components/graph/modules/zoom-levels.js.map +1 -0
- package/components/graph/style.d.ts +6 -0
- package/components/graph/style.js +66 -0
- package/components/graph/style.js.map +1 -0
- package/components/graph/types.d.ts +125 -0
- package/components/graph/types.js +30 -0
- package/components/graph/types.js.map +1 -0
- package/components/grouped-bar/config.d.ts +36 -0
- package/components/grouped-bar/config.js +20 -0
- package/components/grouped-bar/config.js.map +1 -0
- package/components/grouped-bar/index.d.ts +32 -0
- package/components/grouped-bar/index.js +249 -0
- package/components/grouped-bar/index.js.map +1 -0
- package/components/grouped-bar/style.d.ts +5 -0
- package/{src/components/grouped-bar/style.ts → components/grouped-bar/style.js} +14 -15
- package/components/grouped-bar/style.js.map +1 -0
- package/components/leaflet-flow-map/config.d.ts +46 -0
- package/components/leaflet-flow-map/config.js +25 -0
- package/components/leaflet-flow-map/config.js.map +1 -0
- package/components/leaflet-flow-map/index.d.ts +52 -0
- package/components/leaflet-flow-map/index.js +220 -0
- package/components/leaflet-flow-map/index.js.map +1 -0
- package/components/leaflet-flow-map/renderer-utils.d.ts +5 -0
- package/components/leaflet-flow-map/renderer-utils.js +15 -0
- package/components/leaflet-flow-map/renderer-utils.js.map +1 -0
- package/components/leaflet-flow-map/renderer.d.ts +26 -0
- package/components/leaflet-flow-map/renderer.js +117 -0
- package/components/leaflet-flow-map/renderer.js.map +1 -0
- package/components/leaflet-flow-map/shaders.d.ts +2 -0
- package/{src/components/leaflet-flow-map/shaders.ts → components/leaflet-flow-map/shaders.js} +7 -4
- package/components/leaflet-flow-map/shaders.js.map +1 -0
- package/components/leaflet-flow-map/types.d.ts +23 -0
- package/components/leaflet-map/config.d.ts +193 -0
- package/components/leaflet-map/config.js +71 -0
- package/components/leaflet-map/config.js.map +1 -0
- package/components/leaflet-map/index.d.ts +130 -0
- package/components/leaflet-map/index.js +690 -0
- package/components/leaflet-map/index.js.map +1 -0
- package/components/leaflet-map/leaflet.css.js +5 -0
- package/components/leaflet-map/leaflet.css.js.map +1 -0
- package/components/leaflet-map/modules/clusterBackground.d.ts +5 -0
- package/components/leaflet-map/modules/clusterBackground.js +27 -0
- package/components/leaflet-map/modules/clusterBackground.js.map +1 -0
- package/components/leaflet-map/modules/donut.d.ts +3 -0
- package/components/leaflet-map/modules/donut.js +25 -0
- package/components/leaflet-map/modules/donut.js.map +1 -0
- package/components/leaflet-map/modules/map.d.ts +14 -0
- package/components/leaflet-map/modules/map.js +154 -0
- package/components/leaflet-map/modules/map.js.map +1 -0
- package/components/leaflet-map/modules/node.d.ts +9 -0
- package/components/leaflet-map/modules/node.js +162 -0
- package/components/leaflet-map/modules/node.js.map +1 -0
- package/components/leaflet-map/modules/selectionRing.d.ts +7 -0
- package/components/leaflet-map/modules/selectionRing.js +41 -0
- package/components/leaflet-map/modules/selectionRing.js.map +1 -0
- package/components/leaflet-map/modules/utils.d.ts +50 -0
- package/components/leaflet-map/modules/utils.js +210 -0
- package/components/leaflet-map/modules/utils.js.map +1 -0
- package/{src/components → components}/leaflet-map/renderer/leaflet-maplibre-gl.js +78 -76
- package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +1 -0
- package/components/leaflet-map/renderer/map-style.d.ts +4 -0
- package/components/leaflet-map/renderer/map-style.js +15 -0
- package/components/leaflet-map/renderer/map-style.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js +40 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js +40 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js +4981 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +8 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.js +27 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +4 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.js +39 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -0
- package/{src/components → components}/leaflet-map/renderer/maplibre-gl.css.js +4 -2
- package/components/leaflet-map/renderer/maplibre-gl.css.js.map +1 -0
- package/components/leaflet-map/style.d.ts +52 -0
- package/components/leaflet-map/style.js +183 -0
- package/components/leaflet-map/style.js.map +1 -0
- package/components/leaflet-map/types.d.ts +75 -0
- package/components/leaflet-map/types.js +15 -0
- package/components/leaflet-map/types.js.map +1 -0
- package/components/line/config.d.ts +30 -0
- package/components/line/config.js +17 -0
- package/components/line/config.js.map +1 -0
- package/components/line/index.d.ts +27 -0
- package/components/line/index.js +152 -0
- package/components/line/index.js.map +1 -0
- package/components/line/style.d.ts +6 -0
- package/{src/components/line/style.ts → components/line/style.js} +16 -18
- package/components/line/style.js.map +1 -0
- package/components/line/types.d.ts +12 -0
- package/components/nested-donut/config.d.ts +59 -0
- package/components/nested-donut/config.js +19 -0
- package/components/nested-donut/config.js.map +1 -0
- package/components/nested-donut/index.d.ts +38 -0
- package/components/nested-donut/index.js +133 -0
- package/components/nested-donut/index.js.map +1 -0
- package/components/nested-donut/modules/arc.d.ts +17 -0
- package/components/nested-donut/modules/arc.js +50 -0
- package/components/nested-donut/modules/arc.js.map +1 -0
- package/components/nested-donut/modules/label.d.ts +7 -0
- package/components/nested-donut/modules/label.js +34 -0
- package/components/nested-donut/modules/label.js.map +1 -0
- package/components/nested-donut/style.d.ts +26 -0
- package/components/nested-donut/style.js +70 -0
- package/components/nested-donut/style.js.map +1 -0
- package/components/nested-donut/types.d.ts +24 -0
- package/components/nested-donut/types.js +11 -0
- package/components/nested-donut/types.js.map +1 -0
- package/components/sankey/config.d.ts +162 -0
- package/components/sankey/config.js +65 -0
- package/components/sankey/config.js.map +1 -0
- package/components/sankey/index.d.ts +59 -0
- package/components/sankey/index.js +306 -0
- package/components/sankey/index.js.map +1 -0
- package/components/sankey/modules/label.d.ts +23 -0
- package/components/sankey/modules/label.js +168 -0
- package/components/sankey/modules/label.js.map +1 -0
- package/components/sankey/modules/link.d.ts +14 -0
- package/components/sankey/modules/link.js +108 -0
- package/components/sankey/modules/link.js.map +1 -0
- package/components/sankey/modules/node.d.ts +10 -0
- package/components/sankey/modules/node.js +156 -0
- package/components/sankey/modules/node.js.map +1 -0
- package/components/sankey/style.d.ts +20 -0
- package/{src/components/sankey/style.ts → components/sankey/style.js} +44 -60
- package/components/sankey/style.js.map +1 -0
- package/components/sankey/types.d.ts +84 -0
- package/components/sankey/types.js +34 -0
- package/components/sankey/types.js.map +1 -0
- package/components/scatter/config.d.ts +44 -0
- package/components/scatter/config.js +23 -0
- package/components/scatter/config.js.map +1 -0
- package/components/scatter/index.d.ts +28 -0
- package/components/scatter/index.js +167 -0
- package/components/scatter/index.js.map +1 -0
- package/components/scatter/modules/point.d.ts +7 -0
- package/components/scatter/modules/point.js +86 -0
- package/components/scatter/modules/point.js.map +1 -0
- package/components/scatter/modules/utils.d.ts +11 -0
- package/components/scatter/modules/utils.js +112 -0
- package/components/scatter/modules/utils.js.map +1 -0
- package/components/scatter/style.d.ts +5 -0
- package/{src/components/scatter/style.ts → components/scatter/style.js} +14 -15
- package/components/scatter/style.js.map +1 -0
- package/components/scatter/types.d.ts +19 -0
- package/components/stacked-bar/config.d.ts +38 -0
- package/components/stacked-bar/config.js +20 -0
- package/components/stacked-bar/config.js.map +1 -0
- package/components/stacked-bar/index.d.ts +28 -0
- package/components/stacked-bar/index.js +208 -0
- package/components/stacked-bar/index.js.map +1 -0
- package/components/stacked-bar/style.d.ts +5 -0
- package/{src/components/stacked-bar/style.ts → components/stacked-bar/style.js} +14 -15
- package/components/stacked-bar/style.js.map +1 -0
- package/components/stacked-bar/types.d.ts +5 -0
- package/components/timeline/config.d.ts +43 -0
- package/components/timeline/config.js +24 -0
- package/components/timeline/config.js.map +1 -0
- package/components/timeline/index.d.ts +41 -0
- package/components/timeline/index.js +244 -0
- package/components/timeline/index.js.map +1 -0
- package/components/timeline/style.d.ts +13 -0
- package/{src/components/timeline/style.ts → components/timeline/style.js} +30 -39
- package/components/timeline/style.js.map +1 -0
- package/components/tooltip/config.d.ts +68 -0
- package/components/tooltip/config.js +20 -0
- package/components/tooltip/config.js.map +1 -0
- package/components/tooltip/index.d.ts +36 -0
- package/components/tooltip/index.js +184 -0
- package/components/tooltip/index.js.map +1 -0
- package/{src/components → components}/tooltip/style.js +14 -11
- package/components/tooltip/style.js.map +1 -0
- package/components/topojson-map/config.d.ts +99 -0
- package/components/topojson-map/config.js +42 -0
- package/components/topojson-map/config.js.map +1 -0
- package/components/topojson-map/index.d.ts +52 -0
- package/components/topojson-map/index.js +355 -0
- package/components/topojson-map/index.js.map +1 -0
- package/components/topojson-map/style.d.ts +11 -0
- package/{src/components/topojson-map/style.ts → components/topojson-map/style.js} +26 -33
- package/components/topojson-map/style.js.map +1 -0
- package/components/topojson-map/types.d.ts +78 -0
- package/components/topojson-map/types.js +80 -0
- package/components/topojson-map/types.js.map +1 -0
- package/components/topojson-map/utils.d.ts +3 -0
- package/components/topojson-map/utils.js +30 -0
- package/components/topojson-map/utils.js.map +1 -0
- package/components/vis-controls/config.d.ts +12 -0
- package/components/vis-controls/config.js +13 -0
- package/components/vis-controls/config.js.map +1 -0
- package/components/vis-controls/index.d.ts +14 -0
- package/components/vis-controls/index.js +52 -0
- package/components/vis-controls/index.js.map +1 -0
- package/components/vis-controls/style.d.ts +11 -0
- package/{src/components/vis-controls/style.ts → components/vis-controls/style.js} +27 -34
- package/components/vis-controls/style.js.map +1 -0
- package/components/vis-controls/types.d.ts +13 -0
- package/components/vis-controls/types.js +8 -0
- package/components/vis-controls/types.js.map +1 -0
- package/components/xy-labels/config.d.ts +48 -0
- package/components/xy-labels/config.js +25 -0
- package/components/xy-labels/config.js.map +1 -0
- package/components/xy-labels/index.d.ts +15 -0
- package/components/xy-labels/index.js +87 -0
- package/components/xy-labels/index.js.map +1 -0
- package/components/xy-labels/modules/label.d.ts +9 -0
- package/components/xy-labels/modules/label.js +107 -0
- package/components/xy-labels/modules/label.js.map +1 -0
- package/components/xy-labels/style.d.ts +5 -0
- package/{src/components/xy-labels/style.ts → components/xy-labels/style.js} +14 -15
- package/components/xy-labels/style.js.map +1 -0
- package/components/xy-labels/types.d.ts +23 -0
- package/components/xy-labels/types.js +9 -0
- package/components/xy-labels/types.js.map +1 -0
- package/components.d.ts +51 -0
- package/components.js +29 -0
- package/components.js.map +1 -0
- package/containers/single-container/config.d.ts +12 -0
- package/containers/single-container/config.js +12 -0
- package/containers/single-container/config.js.map +1 -0
- package/containers/single-container/index.d.ts +19 -0
- package/containers/single-container/index.js +128 -0
- package/containers/single-container/index.js.map +1 -0
- package/containers/xy-container/config.d.ts +99 -0
- package/containers/xy-container/config.js +30 -0
- package/containers/xy-container/config.js.map +1 -0
- package/containers/xy-container/index.d.ts +34 -0
- package/containers/xy-container/index.js +330 -0
- package/containers/xy-container/index.js.map +1 -0
- package/containers.d.ts +6 -0
- package/containers.js +4 -0
- package/containers.js.map +1 -0
- package/core/component/config.d.ts +58 -0
- package/core/component/config.js +14 -0
- package/core/component/config.js.map +1 -0
- package/core/component/index.d.ts +43 -0
- package/core/component/index.js +118 -0
- package/core/component/index.js.map +1 -0
- package/core/component/types.d.ts +2 -0
- package/core/component/types.js +2 -0
- package/core/component/types.js.map +1 -0
- package/core/config/index.d.ts +3 -0
- package/core/config/index.js +16 -0
- package/core/config/index.js.map +1 -0
- package/core/container/config.d.ts +48 -0
- package/core/container/config.js +29 -0
- package/core/container/config.js.map +1 -0
- package/core/container/index.d.ts +26 -0
- package/core/container/index.js +106 -0
- package/core/container/index.js.map +1 -0
- package/core/xy-component/config.d.ts +38 -0
- package/core/xy-component/config.js +20 -0
- package/core/xy-component/config.js.map +1 -0
- package/core/xy-component/index.d.ts +27 -0
- package/core/xy-component/index.js +74 -0
- package/core/xy-component/index.js.map +1 -0
- package/data-models/core.d.ts +6 -0
- package/data-models/core.js +14 -0
- package/data-models/core.js.map +1 -0
- package/data-models/graph.d.ts +24 -0
- package/data-models/graph.js +107 -0
- package/data-models/graph.js.map +1 -0
- package/data-models/map-graph.d.ts +21 -0
- package/data-models/map-graph.js +62 -0
- package/data-models/map-graph.js.map +1 -0
- package/data-models/map.d.ts +5 -0
- package/data-models/map.js +12 -0
- package/data-models/map.js.map +1 -0
- package/data-models/series.d.ts +6 -0
- package/data-models/series.js +19 -0
- package/data-models/series.js.map +1 -0
- package/index.d.ts +7 -0
- package/index.js +55 -0
- package/index.js.map +1 -0
- package/maps/china-provinces.json.js +140373 -0
- package/maps/fr-regions.json.js +14162 -0
- package/maps/germany-regions.json.js +35760 -0
- package/maps/ind-regions.json.js +290584 -0
- package/maps/uk-regions.json.js +96233 -0
- package/maps/us-counties.json.js +206318 -0
- package/maps/us-states.json.js +16345 -0
- package/maps/world-110m-alpha.json.js +251366 -0
- package/maps/world-simple.json.js +89428 -0
- package/maps/world-simplest.json.js +28175 -0
- package/maps.d.ts +60 -0
- package/maps.js +23 -0
- package/package.json +1 -1
- package/styles/colors.d.ts +7 -0
- package/styles/colors.js +24 -0
- package/styles/colors.js.map +1 -0
- package/styles/index.d.ts +7 -0
- package/styles/index.js +38 -0
- package/styles/index.js.map +1 -0
- package/styles/sizes.d.ts +2 -0
- package/{src/styles/sizes.ts → styles/sizes.js} +8 -6
- package/styles/sizes.js.map +1 -0
- package/types/accessor.d.ts +5 -0
- package/types/accessor.js +2 -0
- package/types/accessor.js.map +1 -0
- package/types/component.d.ts +13 -0
- package/types/component.js +14 -0
- package/types/component.js.map +1 -0
- package/types/curve.d.ts +40 -0
- package/types/curve.js +46 -0
- package/types/curve.js.map +1 -0
- package/types/data.d.ts +7 -0
- package/types/data.js +2 -0
- package/types/data.js.map +1 -0
- package/types/direction.d.ts +6 -0
- package/types/direction.js +10 -0
- package/types/direction.js.map +1 -0
- package/types/graph.d.ts +35 -0
- package/types/graph.js +2 -0
- package/types/graph.js.map +1 -0
- package/types/map.d.ts +4 -0
- package/types/map.js +2 -0
- package/types/map.js.map +1 -0
- package/types/misc.d.ts +8 -0
- package/types/position.d.ts +20 -0
- package/types/position.js +27 -0
- package/types/position.js.map +1 -0
- package/types/scale.d.ts +23 -0
- package/types/scale.js +27 -0
- package/types/scale.js.map +1 -0
- package/types/shape.d.ts +7 -0
- package/types/shape.js +11 -0
- package/types/shape.js.map +1 -0
- package/types/spacing.d.ts +6 -0
- package/types/spacing.js +2 -0
- package/types/spacing.js.map +1 -0
- package/types/svg.d.ts +18 -0
- package/types/svg.js +22 -0
- package/types/svg.js.map +1 -0
- package/types/symbol.d.ts +18 -0
- package/types/symbol.js +24 -0
- package/types/symbol.js.map +1 -0
- package/types/text.d.ts +47 -0
- package/types/text.js +26 -0
- package/types/text.js.map +1 -0
- package/types.d.ts +27 -0
- package/types.js +30 -0
- package/types.js.map +1 -0
- package/utils/color.d.ts +10 -0
- package/utils/color.js +32 -0
- package/utils/color.js.map +1 -0
- package/utils/d3.d.ts +3 -0
- package/utils/d3.js +16 -0
- package/utils/d3.js.map +1 -0
- package/utils/data.d.ts +45 -0
- package/utils/data.js +274 -0
- package/utils/data.js.map +1 -0
- package/utils/html.d.ts +1 -0
- package/utils/html.js +16 -0
- package/utils/html.js.map +1 -0
- package/utils/map.d.ts +2 -0
- package/utils/map.js +20 -0
- package/utils/map.js.map +1 -0
- package/utils/misc.d.ts +9 -0
- package/utils/misc.js +47 -0
- package/utils/misc.js.map +1 -0
- package/utils/path.d.ts +23 -0
- package/utils/path.js +144 -0
- package/utils/path.js.map +1 -0
- package/utils/scale.d.ts +1 -0
- package/utils/style.d.ts +6 -0
- package/utils/style.js +24 -0
- package/utils/style.js.map +1 -0
- package/utils/svg.d.ts +3 -0
- package/utils/text.d.ts +139 -0
- package/utils/text.js +443 -0
- package/utils/text.js.map +1 -0
- package/utils/type.d.ts +5 -0
- package/declaration.d.ts +0 -1
- package/index.ts +0 -1
- package/licences.txt +0 -43
- package/maps.ts +0 -1
- package/rollup.config.js +0 -71
- package/rules/ts-getter-setter.js +0 -35
- package/src/components/area/config.ts +0 -29
- package/src/components/area/index.ts +0 -133
- package/src/components/area/types.ts +0 -2
- package/src/components/axis/config.ts +0 -76
- package/src/components/axis/index.ts +0 -363
- package/src/components/axis/types.ts +0 -4
- package/src/components/brush/config.ts +0 -51
- package/src/components/brush/index.ts +0 -233
- package/src/components/brush/types.ts +0 -8
- package/src/components/bullet-legend/config.ts +0 -38
- package/src/components/bullet-legend/index.ts +0 -104
- package/src/components/bullet-legend/types.ts +0 -7
- package/src/components/chord-diagram/config.ts +0 -53
- package/src/components/chord-diagram/index.ts +0 -401
- package/src/components/chord-diagram/modules/label.ts +0 -155
- package/src/components/chord-diagram/modules/link.ts +0 -91
- package/src/components/chord-diagram/modules/node.ts +0 -80
- package/src/components/chord-diagram/types.ts +0 -68
- package/src/components/crosshair/config.ts +0 -48
- package/src/components/crosshair/index.ts +0 -220
- package/src/components/crosshair/types.ts +0 -15
- package/src/components/donut/config.ts +0 -65
- package/src/components/donut/index.ts +0 -148
- package/src/components/donut/modules/arc.ts +0 -86
- package/src/components/donut/types.ts +0 -17
- package/src/components/flow-legend/config.ts +0 -31
- package/src/components/flow-legend/index.ts +0 -103
- package/src/components/flow-legend/types.ts +0 -10
- package/src/components/free-brush/config.ts +0 -54
- package/src/components/free-brush/index.ts +0 -207
- package/src/components/free-brush/types.ts +0 -8
- package/src/components/graph/config.ts +0 -280
- package/src/components/graph/index.ts +0 -809
- package/src/components/graph/modules/layout-helpers.ts +0 -96
- package/src/components/graph/modules/layout.ts +0 -502
- package/src/components/graph/modules/link/helper.ts +0 -105
- package/src/components/graph/modules/link/index.ts +0 -302
- package/src/components/graph/modules/node/helper.ts +0 -162
- package/src/components/graph/modules/node/index.ts +0 -343
- package/src/components/graph/modules/panel/helper.ts +0 -160
- package/src/components/graph/modules/panel/index.ts +0 -137
- package/src/components/graph/modules/shape.ts +0 -108
- package/src/components/graph/modules/zoom-levels.ts +0 -6
- package/src/components/graph/style.ts +0 -72
- package/src/components/graph/types.ts +0 -152
- package/src/components/grouped-bar/config.ts +0 -40
- package/src/components/grouped-bar/index.ts +0 -325
- package/src/components/leaflet-flow-map/config.ts +0 -60
- package/src/components/leaflet-flow-map/index.ts +0 -279
- package/src/components/leaflet-flow-map/renderer-utils.ts +0 -14
- package/src/components/leaflet-flow-map/renderer.ts +0 -146
- package/src/components/leaflet-flow-map/types.ts +0 -18
- package/src/components/leaflet-map/config.ts +0 -234
- package/src/components/leaflet-map/index.ts +0 -808
- package/src/components/leaflet-map/leaflet.css +0 -625
- package/src/components/leaflet-map/modules/clusterBackground.ts +0 -34
- package/src/components/leaflet-map/modules/donut.ts +0 -37
- package/src/components/leaflet-map/modules/map.ts +0 -178
- package/src/components/leaflet-map/modules/node.ts +0 -208
- package/src/components/leaflet-map/modules/selectionRing.ts +0 -63
- package/src/components/leaflet-map/modules/utils.ts +0 -290
- package/src/components/leaflet-map/renderer/map-style.ts +0 -24
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json +0 -35
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json +0 -35
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json +0 -2185
- package/src/components/leaflet-map/renderer/mapboxgl-layer.ts +0 -43
- package/src/components/leaflet-map/renderer/mapboxgl-utils.ts +0 -40
- package/src/components/leaflet-map/style.ts +0 -217
- package/src/components/leaflet-map/types.ts +0 -75
- package/src/components/line/config.ts +0 -34
- package/src/components/line/index.ts +0 -188
- package/src/components/line/types.ts +0 -3
- package/src/components/nested-donut/config.ts +0 -75
- package/src/components/nested-donut/index.ts +0 -176
- package/src/components/nested-donut/modules/arc.ts +0 -78
- package/src/components/nested-donut/modules/label.ts +0 -63
- package/src/components/nested-donut/style.ts +0 -82
- package/src/components/nested-donut/types.ts +0 -29
- package/src/components/sankey/config.ts +0 -195
- package/src/components/sankey/index.ts +0 -387
- package/src/components/sankey/modules/label.ts +0 -228
- package/src/components/sankey/modules/link.ts +0 -141
- package/src/components/sankey/modules/node.ts +0 -221
- package/src/components/sankey/types.ts +0 -95
- package/src/components/scatter/config.ts +0 -49
- package/src/components/scatter/index.ts +0 -220
- package/src/components/scatter/modules/point.ts +0 -123
- package/src/components/scatter/modules/utils.ts +0 -150
- package/src/components/scatter/types.ts +0 -21
- package/src/components/stacked-bar/config.ts +0 -42
- package/src/components/stacked-bar/index.ts +0 -267
- package/src/components/stacked-bar/types.ts +0 -5
- package/src/components/timeline/config.ts +0 -49
- package/src/components/timeline/index.ts +0 -302
- package/src/components/tooltip/config.ts +0 -69
- package/src/components/tooltip/index.ts +0 -220
- package/src/components/topojson-map/config.ts +0 -124
- package/src/components/topojson-map/index.ts +0 -436
- package/src/components/topojson-map/types.ts +0 -123
- package/src/components/topojson-map/utils.ts +0 -29
- package/src/components/vis-controls/config.ts +0 -16
- package/src/components/vis-controls/index.ts +0 -68
- package/src/components/vis-controls/types.ts +0 -14
- package/src/components/xy-labels/config.ts +0 -56
- package/src/components/xy-labels/index.ts +0 -109
- package/src/components/xy-labels/modules/label.ts +0 -140
- package/src/components/xy-labels/types.ts +0 -26
- package/src/components.ts +0 -56
- package/src/containers/single-container/config.ts +0 -15
- package/src/containers/single-container/index.ts +0 -150
- package/src/containers/xy-container/config.ts +0 -112
- package/src/containers/xy-container/index.ts +0 -407
- package/src/containers.ts +0 -6
- package/src/core/component/config.ts +0 -61
- package/src/core/component/index.ts +0 -154
- package/src/core/component/types.ts +0 -9
- package/src/core/config/index.ts +0 -12
- package/src/core/container/config.ts +0 -56
- package/src/core/container/index.ts +0 -136
- package/src/core/xy-component/config.ts +0 -46
- package/src/core/xy-component/index.ts +0 -90
- package/src/data-models/core.ts +0 -15
- package/src/data-models/graph.ts +0 -138
- package/src/data-models/map-graph.ts +0 -72
- package/src/data-models/map.ts +0 -18
- package/src/data-models/series.ts +0 -16
- package/src/index.ts +0 -7
- package/src/maps/china-provinces.json +0 -1
- package/src/maps/fr-regions.json +0 -1
- package/src/maps/germany-regions.json +0 -1
- package/src/maps/ind-regions.json +0 -1
- package/src/maps/uk-regions.json +0 -1
- package/src/maps/us-counties.json +0 -1
- package/src/maps/us-states.json +0 -1
- package/src/maps/world-110m-alpha.json +0 -1
- package/src/maps/world-simple.json +0 -1
- package/src/maps/world-simplest.json +0 -1
- package/src/maps.ts +0 -34
- package/src/styles/colors.ts +0 -28
- package/src/styles/index.ts +0 -38
- package/src/types/accessor.ts +0 -5
- package/src/types/component.ts +0 -15
- package/src/types/curve.ts +0 -62
- package/src/types/data.ts +0 -5
- package/src/types/direction.ts +0 -6
- package/src/types/graph.ts +0 -40
- package/src/types/map.ts +0 -5
- package/src/types/misc.ts +0 -10
- package/src/types/position.ts +0 -23
- package/src/types/scale.ts +0 -47
- package/src/types/shape.ts +0 -7
- package/src/types/spacing.ts +0 -6
- package/src/types/svg.ts +0 -32
- package/src/types/symbol.ts +0 -21
- package/src/types/text.ts +0 -71
- package/src/types.ts +0 -31
- package/src/utils/color.ts +0 -41
- package/src/utils/d3.ts +0 -15
- package/src/utils/data.ts +0 -328
- package/src/utils/html.ts +0 -13
- package/src/utils/map.ts +0 -29
- package/src/utils/misc.ts +0 -54
- package/src/utils/path.ts +0 -196
- package/src/utils/scale.ts +0 -1
- package/src/utils/style.ts +0 -37
- package/src/utils/svg.ts +0 -49
- package/src/utils/text.ts +0 -529
- package/src/utils/type.ts +0 -9
- package/tsconfig.json +0 -29
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Config } from 'core/config'
|
|
2
|
-
|
|
3
|
-
// Local Types
|
|
4
|
-
import { BulletLegendItemInterface } from './types'
|
|
5
|
-
|
|
6
|
-
export interface BulletLegendConfigInterface {
|
|
7
|
-
/** Legend items. Array of `BulletLegendItemInterface`:
|
|
8
|
-
* ```
|
|
9
|
-
* {
|
|
10
|
-
* name: string | number;
|
|
11
|
-
* color?: string;
|
|
12
|
-
* inactive?: boolean;
|
|
13
|
-
* hidden?: boolean;
|
|
14
|
-
* pointer?: boolean;
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
* Default: `[]` */
|
|
18
|
-
items: BulletLegendItemInterface[];
|
|
19
|
-
/** Apply a specific class to the labels. Default: `''` */
|
|
20
|
-
labelClassName?: string;
|
|
21
|
-
/** Callback function for the legend item click. Default: `undefined` */
|
|
22
|
-
onLegendItemClick?: ((d: BulletLegendItemInterface, i: number) => void);
|
|
23
|
-
/** Label text (<span> element) font-size CSS. Default: `null` */
|
|
24
|
-
labelFontSize?: string | null;
|
|
25
|
-
/** Label text (<span> element) max-width CSS property. Default: `null` */
|
|
26
|
-
labelMaxWidth?: string | null;
|
|
27
|
-
/** Bullet circle size, mapped to the width and height CSS properties. Default: `null` */
|
|
28
|
-
bulletSize?: string | null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export class BulletLegendConfig extends Config implements BulletLegendConfigInterface {
|
|
32
|
-
items: BulletLegendItemInterface[] = []
|
|
33
|
-
labelClassName = ''
|
|
34
|
-
onLegendItemClick = undefined
|
|
35
|
-
labelFontSize = null
|
|
36
|
-
labelMaxWidth = null
|
|
37
|
-
bulletSize = null
|
|
38
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { select, Selection } from 'd3-selection'
|
|
2
|
-
import { color } from 'd3-color'
|
|
3
|
-
|
|
4
|
-
// Utils
|
|
5
|
-
import { getColor } from 'utils/color'
|
|
6
|
-
|
|
7
|
-
// Config
|
|
8
|
-
import { BulletLegendConfig, BulletLegendConfigInterface } from './config'
|
|
9
|
-
|
|
10
|
-
// Local Types
|
|
11
|
-
import { BulletLegendItemInterface } from './types'
|
|
12
|
-
|
|
13
|
-
// Styles
|
|
14
|
-
import * as s from './style'
|
|
15
|
-
|
|
16
|
-
export class BulletLegend {
|
|
17
|
-
static selectors = s
|
|
18
|
-
div: Selection<HTMLDivElement, unknown, null, undefined>
|
|
19
|
-
element: HTMLElement
|
|
20
|
-
prevConfig: BulletLegendConfig
|
|
21
|
-
config: BulletLegendConfig
|
|
22
|
-
protected _container: HTMLElement
|
|
23
|
-
|
|
24
|
-
private _colorAccessor = (d: BulletLegendItemInterface): string => d.color
|
|
25
|
-
|
|
26
|
-
constructor (element: HTMLElement, config?: BulletLegendConfigInterface) {
|
|
27
|
-
this._container = element
|
|
28
|
-
|
|
29
|
-
// Create SVG element for visualizations
|
|
30
|
-
this.div = select(this._container)
|
|
31
|
-
.append('div')
|
|
32
|
-
.attr('class', s.root)
|
|
33
|
-
|
|
34
|
-
this.element = this.div.node()
|
|
35
|
-
|
|
36
|
-
if (config) this.update(config)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
update (config: BulletLegendConfigInterface): void {
|
|
40
|
-
this.prevConfig = this.config
|
|
41
|
-
this.config = new BulletLegendConfig().init(config)
|
|
42
|
-
this.render()
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
render (): void {
|
|
46
|
-
const { config } = this
|
|
47
|
-
const legendItems = this.div.selectAll<HTMLDivElement, unknown>(`.${s.item}`)
|
|
48
|
-
.data(config.items)
|
|
49
|
-
|
|
50
|
-
const legendItemsEnter = legendItems.enter()
|
|
51
|
-
.append('div')
|
|
52
|
-
.attr('class', s.item)
|
|
53
|
-
.on('click', this._onItemClick.bind(this))
|
|
54
|
-
|
|
55
|
-
legendItemsEnter.append('span')
|
|
56
|
-
.attr('class', s.bullet)
|
|
57
|
-
.style('width', config.bulletSize)
|
|
58
|
-
.style('height', config.bulletSize)
|
|
59
|
-
|
|
60
|
-
legendItemsEnter.append('span')
|
|
61
|
-
.attr('class', s.label)
|
|
62
|
-
.classed(config.labelClassName, true)
|
|
63
|
-
.style('max-width', config.labelMaxWidth)
|
|
64
|
-
.style('font-size', config.labelFontSize)
|
|
65
|
-
|
|
66
|
-
const legendItemsMerged = legendItemsEnter.merge(legendItems)
|
|
67
|
-
legendItemsMerged
|
|
68
|
-
.classed(s.clickable, d => !!config.onLegendItemClick && this._isItemClickable(d))
|
|
69
|
-
.style('display', (d: BulletLegendItemInterface) => d.hidden ? 'none' : null)
|
|
70
|
-
const legendBulletsToUpdate = legendItemsMerged.select(`.${s.bullet}`)
|
|
71
|
-
legendBulletsToUpdate.style('background-color', (d: BulletLegendItemInterface, i) => getColor(d, this._colorAccessor, i))
|
|
72
|
-
.style('border-color', (d: BulletLegendItemInterface, i) => getColor(d, this._colorAccessor, i))
|
|
73
|
-
legendBulletsToUpdate.each((d, i, elements) => {
|
|
74
|
-
if (d.inactive) {
|
|
75
|
-
const bulletColor = window.getComputedStyle(elements[i] as Element).getPropertyValue('background-color')
|
|
76
|
-
const transparentColor = color(bulletColor)
|
|
77
|
-
transparentColor.opacity = 0.4
|
|
78
|
-
select(elements[i])
|
|
79
|
-
.style('background-color', transparentColor.toString())
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
legendItemsMerged.select(`.${s.label}`)
|
|
84
|
-
.text((d: BulletLegendItemInterface) => d.name)
|
|
85
|
-
|
|
86
|
-
legendItems.exit().remove()
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
_isItemClickable (item: BulletLegendItemInterface): boolean {
|
|
90
|
-
return item.pointer === undefined ? true : item.pointer
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
_onItemClick (event: MouseEvent, d: BulletLegendItemInterface): void {
|
|
94
|
-
const { config: { onLegendItemClick } } = this
|
|
95
|
-
|
|
96
|
-
const legendItems = this.div.selectAll(`.${s.item}`).nodes() as HTMLElement[]
|
|
97
|
-
const index = legendItems.indexOf(event.currentTarget as HTMLElement)
|
|
98
|
-
if (onLegendItemClick) onLegendItemClick(d, index)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
public destroy (): void {
|
|
102
|
-
this.div.remove()
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/* eslint-disable dot-notation */
|
|
2
|
-
|
|
3
|
-
// Core
|
|
4
|
-
import { ComponentConfigInterface, ComponentConfig } from 'core/component/config'
|
|
5
|
-
|
|
6
|
-
// Types
|
|
7
|
-
import { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'
|
|
8
|
-
|
|
9
|
-
// Local Types
|
|
10
|
-
import { ChordInputLink, ChordInputNode, ChordLabelAlignment, ChordNodeDatum } from './types'
|
|
11
|
-
|
|
12
|
-
export interface ChordDiagramConfigInterface<N extends ChordInputNode, L extends ChordInputLink> extends ComponentConfigInterface {
|
|
13
|
-
/** Link color accessor function. Default: `var(--vis-chord-diagram-link-fill-color)` */
|
|
14
|
-
linkColor?: ColorAccessor<L>;
|
|
15
|
-
/** Link value accessor function. Default: `l => l.value` */
|
|
16
|
-
linkValue?: NumericAccessor<L>;
|
|
17
|
-
/** Array of node hierarchy levels. Data records are supposed to have corresponding properties, e.g. ['level1', 'level2']. Default: `[]` */
|
|
18
|
-
nodeLevels?: string[];
|
|
19
|
-
/** Node width in pixels. Default: `15` */
|
|
20
|
-
nodeWidth?: number;
|
|
21
|
-
/** Node color accessor function ot constant value. Default: `d => d.color` */
|
|
22
|
-
nodeColor?: ColorAccessor<ChordNodeDatum<N>>;
|
|
23
|
-
/** Node label accessor function. Default: `d => d.label ?? d.key` */
|
|
24
|
-
nodeLabel?: StringAccessor<ChordNodeDatum<N>>;
|
|
25
|
-
/** Node label color accessor function. Default: `undefined` */
|
|
26
|
-
nodeLabelColor?: StringAccessor<ChordNodeDatum<N>>;
|
|
27
|
-
/** Node label alignment. Default: `ChordLabelAlignment.Along` */
|
|
28
|
-
nodeLabelAlignment?: GenericAccessor<ChordLabelAlignment | string, ChordNodeDatum<N>>;
|
|
29
|
-
/** Pad angle in radians. Constant value or accessor function. Default: `0.02` */
|
|
30
|
-
padAngle?: NumericAccessor<N>;
|
|
31
|
-
/** Corner radius constant value or accessor function. Default: `2` */
|
|
32
|
-
cornerRadius?: NumericAccessor<N>;
|
|
33
|
-
/** Angular range of the diagram. Default: `[0, 2 * Math.PI]` */
|
|
34
|
-
angleRange?: [number, number];
|
|
35
|
-
/** The exponent property of the radius scale. Default: `2` */
|
|
36
|
-
radiusScaleExponent?: number;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export class ChordDiagramConfig<N extends ChordInputNode, L extends ChordInputLink> extends ComponentConfig implements ChordDiagramConfigInterface<N, L> {
|
|
40
|
-
duration = 800
|
|
41
|
-
linkColor = undefined
|
|
42
|
-
linkValue = (d: L): number => d['value']
|
|
43
|
-
nodeLevels = []
|
|
44
|
-
nodeWidth = 15
|
|
45
|
-
nodeColor = (d: ChordNodeDatum<N>): string => d['color']
|
|
46
|
-
nodeLabel = (d: ChordNodeDatum<N>): string => d['label'] ?? d['key']
|
|
47
|
-
nodeLabelColor = undefined
|
|
48
|
-
nodeLabelAlignment = ChordLabelAlignment.Along
|
|
49
|
-
padAngle = 0.02
|
|
50
|
-
cornerRadius = 2
|
|
51
|
-
angleRange: [number, number] = [0, 2 * Math.PI]
|
|
52
|
-
radiusScaleExponent = 2
|
|
53
|
-
}
|
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
import { Selection } from 'd3-selection'
|
|
2
|
-
import { nest } from 'd3-collection'
|
|
3
|
-
import { HierarchyNode, hierarchy, partition } from 'd3-hierarchy'
|
|
4
|
-
import { arc, line } from 'd3-shape'
|
|
5
|
-
import { scalePow, ScalePower } from 'd3-scale'
|
|
6
|
-
import { max } from 'd3-array'
|
|
7
|
-
|
|
8
|
-
// Core
|
|
9
|
-
import { ComponentCore } from 'core/component'
|
|
10
|
-
import { GraphDataModel } from 'data-models/graph'
|
|
11
|
-
|
|
12
|
-
// Utils
|
|
13
|
-
import { getNumber, isNumber, groupBy, getString, getValue } from 'utils/data'
|
|
14
|
-
import { estimateStringPixelLength } from 'utils/text'
|
|
15
|
-
|
|
16
|
-
// Types
|
|
17
|
-
import { GraphNodeCore } from 'types/graph'
|
|
18
|
-
import { Spacing } from 'types/spacing'
|
|
19
|
-
import { Curve } from 'types/curve'
|
|
20
|
-
|
|
21
|
-
// Local Types
|
|
22
|
-
import {
|
|
23
|
-
ChordInputNode,
|
|
24
|
-
ChordInputLink,
|
|
25
|
-
ChordDiagramData,
|
|
26
|
-
ChordHierarchyNode,
|
|
27
|
-
ChordNode,
|
|
28
|
-
ChordRibbon,
|
|
29
|
-
ChordLabelAlignment,
|
|
30
|
-
ChordLeafNode,
|
|
31
|
-
ChordRibbonPoint,
|
|
32
|
-
ChordNodeDatum,
|
|
33
|
-
} from './types'
|
|
34
|
-
|
|
35
|
-
// Config
|
|
36
|
-
import { ChordDiagramConfig, ChordDiagramConfigInterface } from './config'
|
|
37
|
-
|
|
38
|
-
// Modules
|
|
39
|
-
import { createNode, updateNode, removeNode } from './modules/node'
|
|
40
|
-
import { createLabel, updateLabel, removeLabel, LABEL_PADDING } from './modules/label'
|
|
41
|
-
import { createLink, updateLink, removeLink } from './modules/link'
|
|
42
|
-
|
|
43
|
-
// Styles
|
|
44
|
-
import * as s from './style'
|
|
45
|
-
|
|
46
|
-
export class ChordDiagram<
|
|
47
|
-
N extends ChordInputNode,
|
|
48
|
-
L extends ChordInputLink,
|
|
49
|
-
> extends ComponentCore<
|
|
50
|
-
ChordDiagramData<N, L>,
|
|
51
|
-
ChordDiagramConfig<N, L>,
|
|
52
|
-
ChordDiagramConfigInterface<N, L>
|
|
53
|
-
> {
|
|
54
|
-
static selectors = s
|
|
55
|
-
config: ChordDiagramConfig<N, L> = new ChordDiagramConfig()
|
|
56
|
-
datamodel: GraphDataModel<N, L> = new GraphDataModel()
|
|
57
|
-
|
|
58
|
-
nodeGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>
|
|
59
|
-
linkGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>
|
|
60
|
-
labelGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>
|
|
61
|
-
arcGen = arc<ChordNode<N>>()
|
|
62
|
-
radiusScale: ScalePower<number, number> = scalePow()
|
|
63
|
-
private _nodes: ChordNode<N>[] = []
|
|
64
|
-
private _links: ChordRibbon<N>[] = []
|
|
65
|
-
private _rootNode: ChordNode<N>
|
|
66
|
-
|
|
67
|
-
events = {
|
|
68
|
-
[ChordDiagram.selectors.node]: {
|
|
69
|
-
mouseover: this._onNodeMouseOver.bind(this),
|
|
70
|
-
mouseout: this._onNodeMouseOut.bind(this),
|
|
71
|
-
},
|
|
72
|
-
[ChordDiagram.selectors.link]: {
|
|
73
|
-
mouseover: this._onLinkMouseOver.bind(this),
|
|
74
|
-
mouseout: this._onLinkMouseOut.bind(this),
|
|
75
|
-
},
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
constructor (config?: ChordDiagramConfigInterface<N, L>) {
|
|
79
|
-
super()
|
|
80
|
-
if (config) this.config.init(config)
|
|
81
|
-
this.linkGroup = this.g.append('g').attr('class', s.links)
|
|
82
|
-
this.nodeGroup = this.g.append('g').attr('class', s.nodes)
|
|
83
|
-
this.labelGroup = this.g.append('g').attr('class', s.labels)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
get bleed (): Spacing {
|
|
87
|
-
const { config } = this
|
|
88
|
-
let top = 0; let bottom = 0; let right = 0; let left = 0
|
|
89
|
-
const padding = 4 + LABEL_PADDING * 2
|
|
90
|
-
this._nodes.forEach(n => {
|
|
91
|
-
const nodeLabelAlignment = getValue(n.data, config.nodeLabelAlignment)
|
|
92
|
-
if (n.height === 0 && nodeLabelAlignment === ChordLabelAlignment.Perpendicular) {
|
|
93
|
-
const labelWidth = estimateStringPixelLength(getString(n.data as N, config.nodeLabel) ?? '', 16)
|
|
94
|
-
const [x, y] = this.arcGen.centroid(n)
|
|
95
|
-
|
|
96
|
-
if (x < 0) left = Math.max(left, labelWidth)
|
|
97
|
-
else right = Math.max(right, labelWidth)
|
|
98
|
-
|
|
99
|
-
if (y < 0) top = Math.max(top, labelWidth)
|
|
100
|
-
else bottom = Math.max(bottom, labelWidth)
|
|
101
|
-
}
|
|
102
|
-
})
|
|
103
|
-
left += padding
|
|
104
|
-
right += padding
|
|
105
|
-
bottom += padding
|
|
106
|
-
top += padding
|
|
107
|
-
return { top, bottom, left, right }
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
_render (customDuration?: number): void {
|
|
111
|
-
super._render(customDuration)
|
|
112
|
-
const { config, config: { radiusScaleExponent }, radiusScale } = this
|
|
113
|
-
const nodes = this._getHierarchyNodes()
|
|
114
|
-
const duration = isNumber(customDuration) ? customDuration : config.duration
|
|
115
|
-
|
|
116
|
-
this.arcGen
|
|
117
|
-
.startAngle(d => d.x0)
|
|
118
|
-
.endAngle(d => d.x1)
|
|
119
|
-
.cornerRadius(d => getNumber(d, config.cornerRadius))
|
|
120
|
-
.innerRadius(d => this.radiusScale(d.y1) - getNumber(d, config.nodeWidth))
|
|
121
|
-
.outerRadius(d => this.radiusScale(d.y1))
|
|
122
|
-
|
|
123
|
-
const linkLineGen = line().curve(Curve.catmullRom.alpha(0.25))
|
|
124
|
-
|
|
125
|
-
const hierarchyData = nodes
|
|
126
|
-
|
|
127
|
-
const partitionData = partition<N | ChordHierarchyNode<N>>().size([config.angleRange[1], 1])(hierarchyData) as ChordNode<N>
|
|
128
|
-
this._calculateRadialPosition(partitionData)
|
|
129
|
-
|
|
130
|
-
const size = Math.min(this._width, this._height)
|
|
131
|
-
const radius = size / 2 - max([this.bleed.top, this.bleed.bottom, this.bleed.left, this.bleed.right])
|
|
132
|
-
const labelWidth = size - radius - config.nodeWidth
|
|
133
|
-
|
|
134
|
-
radiusScale
|
|
135
|
-
.exponent(radiusScaleExponent)
|
|
136
|
-
.range([0, radius])
|
|
137
|
-
|
|
138
|
-
const partitionDataWithRoot = partitionData.descendants()
|
|
139
|
-
this._rootNode = partitionDataWithRoot.find(d => d.depth === 0)
|
|
140
|
-
this._nodes = partitionDataWithRoot.filter(d => d.depth !== 0) // Filter out the root node
|
|
141
|
-
this._links = this._getRibbons(partitionData)
|
|
142
|
-
|
|
143
|
-
// Create Node and Link state objects
|
|
144
|
-
this._nodes.forEach((node, i) => {
|
|
145
|
-
// Add hierarchy data for non leaf nodes
|
|
146
|
-
if (node.children) {
|
|
147
|
-
node.data = Object.assign(node.data, {
|
|
148
|
-
depth: node.depth,
|
|
149
|
-
height: node.height,
|
|
150
|
-
value: node.value,
|
|
151
|
-
ancestors: node.ancestors().map(d => (d.data as ChordHierarchyNode<N>).key),
|
|
152
|
-
})
|
|
153
|
-
}
|
|
154
|
-
node.x0 = Number.isNaN(node.x0) ? 0 : node.x0
|
|
155
|
-
node.x1 = Number.isNaN(node.x1) ? 0 : node.x1
|
|
156
|
-
node.uid = `${this.uid}-n${i}`
|
|
157
|
-
node._state = {}
|
|
158
|
-
})
|
|
159
|
-
this._links.forEach(link => { link._state = {} })
|
|
160
|
-
|
|
161
|
-
// Center the view
|
|
162
|
-
this.g.attr('transform', `translate(${this._width / 2},${this._height / 2})`)
|
|
163
|
-
|
|
164
|
-
// Links
|
|
165
|
-
const linksSelection = this.linkGroup
|
|
166
|
-
.selectAll<SVGPathElement, ChordRibbon<N>>(`.${s.link}`)
|
|
167
|
-
.data(this._links, d => String(d.data._id))
|
|
168
|
-
|
|
169
|
-
const linksEnter = linksSelection.enter().append('path')
|
|
170
|
-
.attr('class', s.link)
|
|
171
|
-
.call(createLink, linkLineGen)
|
|
172
|
-
|
|
173
|
-
const linksMerged = linksSelection.merge(linksEnter)
|
|
174
|
-
linksMerged.call(updateLink, config, linkLineGen, duration)
|
|
175
|
-
|
|
176
|
-
linksSelection.exit()
|
|
177
|
-
.call(removeLink, duration)
|
|
178
|
-
|
|
179
|
-
// Nodes
|
|
180
|
-
const nodesSelection = this.nodeGroup
|
|
181
|
-
.selectAll<SVGPathElement, ChordNode<N>>(`.${s.node}`)
|
|
182
|
-
.data(this._nodes, d => String(d.uid))
|
|
183
|
-
|
|
184
|
-
const nodesEnter = nodesSelection.enter().append('path')
|
|
185
|
-
.attr('class', s.node)
|
|
186
|
-
.call(createNode, config)
|
|
187
|
-
|
|
188
|
-
const nodesMerged = nodesSelection.merge(nodesEnter)
|
|
189
|
-
nodesMerged.call(updateNode, config, this.arcGen, duration)
|
|
190
|
-
|
|
191
|
-
nodesSelection.exit()
|
|
192
|
-
.call(removeNode, duration)
|
|
193
|
-
|
|
194
|
-
// Labels
|
|
195
|
-
const labels = this.labelGroup
|
|
196
|
-
.selectAll<SVGGElement, ChordNode<N>>(`.${s.gLabel}`)
|
|
197
|
-
.data(this._nodes, d => String(d.uid))
|
|
198
|
-
|
|
199
|
-
const labelEnter = labels.enter().append('g')
|
|
200
|
-
.attr('class', s.gLabel)
|
|
201
|
-
.call(createLabel, config, radiusScale)
|
|
202
|
-
|
|
203
|
-
const labelsMerged = labels.merge(labelEnter)
|
|
204
|
-
labelsMerged.call(updateLabel, config, labelWidth, radiusScale, duration)
|
|
205
|
-
|
|
206
|
-
labels.exit()
|
|
207
|
-
.attr('class', s.labelExit)
|
|
208
|
-
.call(removeLabel, duration)
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
private _getHierarchyNodes (): HierarchyNode<ChordNodeDatum<N>> {
|
|
212
|
-
const { config, datamodel: { nodes, links } } = this
|
|
213
|
-
nodes.forEach(n => { delete n._state.value })
|
|
214
|
-
links.forEach(l => {
|
|
215
|
-
delete l._state.points
|
|
216
|
-
l.source._state.value = (l.source._state.value || 0) + getNumber(l, config.linkValue)
|
|
217
|
-
l.target._state.value = (l.target._state.value || 0) + getNumber(l, config.linkValue)
|
|
218
|
-
})
|
|
219
|
-
|
|
220
|
-
// TODO: Replace with d3-group
|
|
221
|
-
const nestGen = nest<N>()
|
|
222
|
-
config.nodeLevels.forEach(levelAccessor => {
|
|
223
|
-
nestGen.key(d => d[levelAccessor])
|
|
224
|
-
})
|
|
225
|
-
const root = { key: 'root', values: nestGen.entries(nodes) }
|
|
226
|
-
const hierarchyNodes = hierarchy(root, d => d.values)
|
|
227
|
-
.sum((d) => (d as unknown as GraphNodeCore<N, L>)._state?.value)
|
|
228
|
-
|
|
229
|
-
return hierarchyNodes
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
private _getRibbons (partitionData: ChordNode<N>): ChordRibbon<N>[] {
|
|
233
|
-
const { config, datamodel: { links } } = this
|
|
234
|
-
const findNode = (
|
|
235
|
-
nodes: ChordLeafNode<N>[],
|
|
236
|
-
id: string
|
|
237
|
-
): ChordLeafNode<N> => nodes.find(n => n.data._id === id)
|
|
238
|
-
const leafNodes = partitionData.leaves() as ChordLeafNode<N>[]
|
|
239
|
-
|
|
240
|
-
type LinksArrayType = typeof links
|
|
241
|
-
const groupedBySource: Record<string, LinksArrayType> = groupBy(links, d => d.source._id)
|
|
242
|
-
const groupedByTarget: Record<string, LinksArrayType> = groupBy(links, d => d.target._id)
|
|
243
|
-
|
|
244
|
-
const getNodesInRibbon = (
|
|
245
|
-
source: ChordLeafNode<N>,
|
|
246
|
-
target: ChordLeafNode<N>,
|
|
247
|
-
partitionHeight: number,
|
|
248
|
-
nodes: ChordLeafNode<N>[] = []
|
|
249
|
-
): ChordNode<N>[] => {
|
|
250
|
-
nodes[source.height] = source
|
|
251
|
-
nodes[partitionHeight * 2 - target.height] = target
|
|
252
|
-
if (source.parent && target.parent) getNodesInRibbon(source.parent, target.parent, partitionHeight, nodes)
|
|
253
|
-
return nodes
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
const calculatePoints = (
|
|
257
|
-
links: LinksArrayType,
|
|
258
|
-
type: 'in' | 'out',
|
|
259
|
-
depth: number
|
|
260
|
-
): void => {
|
|
261
|
-
links.forEach(link => {
|
|
262
|
-
if (!link._state.points) link._state.points = []
|
|
263
|
-
const sourceLeaf = findNode(leafNodes, link.source._id)
|
|
264
|
-
const targetLeaf = findNode(leafNodes, link.target._id)
|
|
265
|
-
const nodesInRibbon = getNodesInRibbon(
|
|
266
|
-
type === 'out' ? sourceLeaf : targetLeaf,
|
|
267
|
-
type === 'out' ? targetLeaf : sourceLeaf,
|
|
268
|
-
partitionData.height)
|
|
269
|
-
const currNode = nodesInRibbon[depth]
|
|
270
|
-
const len = currNode.x1 - currNode.x0
|
|
271
|
-
const x0 = currNode._prevX1 ?? currNode.x0
|
|
272
|
-
const x1 = x0 + len * getNumber(link, config.linkValue) / currNode.value
|
|
273
|
-
currNode._prevX1 = x1
|
|
274
|
-
|
|
275
|
-
const pointIdx = type === 'out' ? depth : partitionData.height * 2 - 1 - depth
|
|
276
|
-
link._state.points[pointIdx] = this._convertRadialToCartesian(
|
|
277
|
-
Math.min(x0, x1),
|
|
278
|
-
Math.max(x0, x1),
|
|
279
|
-
currNode.y1,
|
|
280
|
-
config.nodeWidth
|
|
281
|
-
)
|
|
282
|
-
})
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
leafNodes.forEach(leafNode => {
|
|
286
|
-
const outLinks = groupedBySource[leafNode.data._id] || []
|
|
287
|
-
const inLinks = groupedByTarget[leafNode.data._id] || []
|
|
288
|
-
for (let depth = 0; depth < partitionData.height; depth += 1) {
|
|
289
|
-
calculatePoints(outLinks, 'out', depth)
|
|
290
|
-
calculatePoints(inLinks, 'in', depth)
|
|
291
|
-
}
|
|
292
|
-
})
|
|
293
|
-
|
|
294
|
-
const ribbons = links.map(l => {
|
|
295
|
-
const sourceNode = findNode(leafNodes, l.source._id)
|
|
296
|
-
const targetNode = findNode(leafNodes, l.target._id)
|
|
297
|
-
|
|
298
|
-
return {
|
|
299
|
-
source: sourceNode,
|
|
300
|
-
target: targetNode,
|
|
301
|
-
data: l,
|
|
302
|
-
points: l._state.points,
|
|
303
|
-
_state: {},
|
|
304
|
-
}
|
|
305
|
-
})
|
|
306
|
-
|
|
307
|
-
return ribbons
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
private _convertRadialToCartesian (x0: number, x1: number, y: number, nodeWidth: number): ChordRibbonPoint {
|
|
311
|
-
const r = Math.max(this.radiusScale(y) - nodeWidth, 0)
|
|
312
|
-
const a0 = x0 - Math.PI / 2
|
|
313
|
-
const a1 = x1 - Math.PI / 2
|
|
314
|
-
|
|
315
|
-
return {
|
|
316
|
-
a0,
|
|
317
|
-
a1,
|
|
318
|
-
r,
|
|
319
|
-
x0: r * Math.cos(a0),
|
|
320
|
-
x1: r * Math.cos(a1),
|
|
321
|
-
y0: r * Math.sin(a0),
|
|
322
|
-
y1: r * Math.sin(a1),
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
private _calculateRadialPosition (
|
|
327
|
-
hierarchyNode: ChordNode<N>,
|
|
328
|
-
scalingCoeff = 0.95,
|
|
329
|
-
nodePadding = 0.02
|
|
330
|
-
): void {
|
|
331
|
-
if (!hierarchyNode.children) return
|
|
332
|
-
|
|
333
|
-
// Calculate x0 and x1
|
|
334
|
-
const nodeLength = (hierarchyNode.x1 - hierarchyNode.x0)
|
|
335
|
-
const scaledNodeLength = nodeLength * scalingCoeff
|
|
336
|
-
const delta = nodeLength - scaledNodeLength
|
|
337
|
-
let x0 = hierarchyNode.x0 + delta / 2
|
|
338
|
-
for (const node of hierarchyNode.children) {
|
|
339
|
-
const childX0 = x0
|
|
340
|
-
const childX1 = x0 + (node.value / hierarchyNode.value) * scaledNodeLength - nodePadding / 2
|
|
341
|
-
const childNodeLength = childX1 - childX0
|
|
342
|
-
const scaledChildNodeLength = childNodeLength * scalingCoeff
|
|
343
|
-
const childDelta = childNodeLength - scaledChildNodeLength
|
|
344
|
-
node.x0 = childX0 + childDelta / 2
|
|
345
|
-
node.x1 = node.x0 + scaledChildNodeLength
|
|
346
|
-
x0 = childX1 + nodePadding / 2 + childDelta / 2
|
|
347
|
-
}
|
|
348
|
-
// Go deeper in the hierarchy
|
|
349
|
-
for (const node of hierarchyNode.children) {
|
|
350
|
-
this._calculateRadialPosition(node, scalingCoeff, nodePadding)
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
private _onNodeMouseOver (d: ChordNode<N>): void {
|
|
355
|
-
let ribbons: ChordRibbon<N>[]
|
|
356
|
-
if (d.children) {
|
|
357
|
-
const leaves = d.leaves() as ChordLeafNode<N>[]
|
|
358
|
-
ribbons = this._links.filter(l =>
|
|
359
|
-
leaves.find(leaf => l.source.data.id === leaf.data.id || l.target.data.id === leaf.data.id)
|
|
360
|
-
)
|
|
361
|
-
} else {
|
|
362
|
-
const leaf = d as ChordLeafNode<N>
|
|
363
|
-
ribbons = this._links.filter(l => l.source.data.id === leaf.data.id || l.target.data.id === leaf.data.id)
|
|
364
|
-
}
|
|
365
|
-
this._highlightOnHover(ribbons)
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
private _onNodeMouseOut (): void {
|
|
369
|
-
this._highlightOnHover()
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
private _onLinkMouseOver (d: ChordRibbon<N>): void {
|
|
373
|
-
this._highlightOnHover([d])
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
private _onLinkMouseOut (): void {
|
|
377
|
-
this._highlightOnHover()
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
private _highlightOnHover (links?: ChordRibbon<N>[]): void {
|
|
381
|
-
if (links) {
|
|
382
|
-
links.forEach(l => {
|
|
383
|
-
l._state.hovered = true
|
|
384
|
-
const sourcePath = (l.source as ChordNode<N>).path(this._rootNode)
|
|
385
|
-
const targetPath = (l.target as ChordNode<N>).path(this._rootNode)
|
|
386
|
-
sourcePath.forEach(n => { if (n.depth) n._state.hovered = true })
|
|
387
|
-
targetPath.forEach(n => { if (n.depth) n._state.hovered = true })
|
|
388
|
-
})
|
|
389
|
-
} else {
|
|
390
|
-
this._nodes.forEach(n => { delete n._state.hovered })
|
|
391
|
-
this._links.forEach(l => { delete l._state.hovered })
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
this.nodeGroup.selectAll<SVGPathElement, ChordNode<N>>(`.${s.node}`)
|
|
395
|
-
.classed(s.hoveredNode, d => d._state.hovered)
|
|
396
|
-
this.linkGroup.selectAll<SVGPathElement, ChordRibbon<N>>(`.${s.link}`)
|
|
397
|
-
.classed(s.hoveredLink, d => d._state.hovered)
|
|
398
|
-
|
|
399
|
-
this.g.classed(s.transparent, !!links)
|
|
400
|
-
}
|
|
401
|
-
}
|