@unovis/ts 1.1.1-beta.6 → 1.1.1-beta.7
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/declaration.d.ts +1 -0
- package/index.ts +1 -0
- package/licences.txt +43 -0
- package/maps.ts +1 -0
- package/package.json +1 -1
- package/rollup.config.js +71 -0
- package/rules/ts-getter-setter.js +35 -0
- package/src/components/area/config.ts +29 -0
- package/src/components/area/index.ts +133 -0
- package/{components/area/style.js → src/components/area/style.ts} +9 -10
- package/src/components/area/types.ts +2 -0
- package/src/components/axis/config.ts +76 -0
- package/src/components/axis/index.ts +363 -0
- package/{components/axis/style.js → src/components/axis/style.ts} +27 -22
- package/src/components/axis/types.ts +4 -0
- package/src/components/brush/config.ts +51 -0
- package/src/components/brush/index.ts +233 -0
- package/{components/brush/style.js → src/components/brush/style.ts} +15 -14
- package/src/components/brush/types.ts +8 -0
- package/src/components/bullet-legend/config.ts +38 -0
- package/src/components/bullet-legend/index.ts +104 -0
- package/{components/bullet-legend/style.js → src/components/bullet-legend/style.ts} +18 -16
- package/src/components/bullet-legend/types.ts +7 -0
- package/src/components/chord-diagram/config.ts +53 -0
- package/src/components/chord-diagram/index.ts +401 -0
- package/src/components/chord-diagram/modules/label.ts +155 -0
- package/src/components/chord-diagram/modules/link.ts +91 -0
- package/src/components/chord-diagram/modules/node.ts +80 -0
- package/{components/chord-diagram/style.js → src/components/chord-diagram/style.ts} +39 -30
- package/src/components/chord-diagram/types.ts +68 -0
- package/src/components/crosshair/config.ts +48 -0
- package/src/components/crosshair/index.ts +220 -0
- package/{components/crosshair/style.js → src/components/crosshair/style.ts} +12 -12
- package/src/components/crosshair/types.ts +15 -0
- package/src/components/donut/config.ts +65 -0
- package/src/components/donut/index.ts +148 -0
- package/src/components/donut/modules/arc.ts +86 -0
- package/{components/donut/style.js → src/components/donut/style.ts} +20 -18
- package/src/components/donut/types.ts +17 -0
- package/src/components/flow-legend/config.ts +31 -0
- package/src/components/flow-legend/index.ts +103 -0
- package/{components/flow-legend/style.js → src/components/flow-legend/style.ts} +25 -21
- package/src/components/flow-legend/types.ts +10 -0
- package/src/components/free-brush/config.ts +54 -0
- package/src/components/free-brush/index.ts +207 -0
- package/{components/free-brush/style.js → src/components/free-brush/style.ts} +12 -12
- package/src/components/free-brush/types.ts +8 -0
- package/src/components/graph/config.ts +280 -0
- package/src/components/graph/index.ts +809 -0
- package/src/components/graph/modules/layout-helpers.ts +96 -0
- package/src/components/graph/modules/layout.ts +502 -0
- package/src/components/graph/modules/link/helper.ts +105 -0
- package/src/components/graph/modules/link/index.ts +302 -0
- package/{components/graph/modules/link/style.js → src/components/graph/modules/link/style.ts} +45 -34
- package/src/components/graph/modules/node/helper.ts +162 -0
- package/src/components/graph/modules/node/index.ts +343 -0
- package/{components/graph/modules/node/style.js → src/components/graph/modules/node/style.ts} +72 -52
- package/src/components/graph/modules/panel/helper.ts +160 -0
- package/src/components/graph/modules/panel/index.ts +137 -0
- package/{components/graph/modules/panel/style.js → src/components/graph/modules/panel/style.ts} +42 -32
- package/src/components/graph/modules/shape.ts +108 -0
- package/src/components/graph/modules/zoom-levels.ts +6 -0
- package/src/components/graph/style.ts +72 -0
- package/src/components/graph/types.ts +152 -0
- package/src/components/grouped-bar/config.ts +40 -0
- package/src/components/grouped-bar/index.ts +325 -0
- package/{components/grouped-bar/style.js → src/components/grouped-bar/style.ts} +15 -14
- package/src/components/leaflet-flow-map/config.ts +60 -0
- package/src/components/leaflet-flow-map/index.ts +279 -0
- package/src/components/leaflet-flow-map/renderer-utils.ts +14 -0
- package/src/components/leaflet-flow-map/renderer.ts +146 -0
- package/{components/leaflet-flow-map/shaders.js → src/components/leaflet-flow-map/shaders.ts} +4 -7
- package/src/components/leaflet-flow-map/types.ts +18 -0
- package/src/components/leaflet-map/config.ts +234 -0
- package/src/components/leaflet-map/index.ts +808 -0
- package/src/components/leaflet-map/leaflet.css +625 -0
- package/src/components/leaflet-map/modules/clusterBackground.ts +34 -0
- package/src/components/leaflet-map/modules/donut.ts +37 -0
- package/src/components/leaflet-map/modules/map.ts +178 -0
- package/src/components/leaflet-map/modules/node.ts +208 -0
- package/src/components/leaflet-map/modules/selectionRing.ts +63 -0
- package/src/components/leaflet-map/modules/utils.ts +290 -0
- package/{components → src/components}/leaflet-map/renderer/leaflet-maplibre-gl.js +76 -78
- package/src/components/leaflet-map/renderer/map-style.ts +24 -0
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json +35 -0
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json +35 -0
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json +2185 -0
- package/src/components/leaflet-map/renderer/mapboxgl-layer.ts +43 -0
- package/src/components/leaflet-map/renderer/mapboxgl-utils.ts +40 -0
- package/{components → src/components}/leaflet-map/renderer/maplibre-gl.css.js +2 -4
- package/src/components/leaflet-map/style.ts +217 -0
- package/src/components/leaflet-map/types.ts +75 -0
- package/src/components/line/config.ts +34 -0
- package/src/components/line/index.ts +188 -0
- package/{components/line/style.js → src/components/line/style.ts} +18 -16
- package/src/components/line/types.ts +3 -0
- package/src/components/nested-donut/config.ts +75 -0
- package/src/components/nested-donut/index.ts +176 -0
- package/src/components/nested-donut/modules/arc.ts +78 -0
- package/src/components/nested-donut/modules/label.ts +63 -0
- package/src/components/nested-donut/style.ts +82 -0
- package/src/components/nested-donut/types.ts +29 -0
- package/src/components/sankey/config.ts +195 -0
- package/src/components/sankey/index.ts +387 -0
- package/src/components/sankey/modules/label.ts +228 -0
- package/src/components/sankey/modules/link.ts +141 -0
- package/src/components/sankey/modules/node.ts +221 -0
- package/{components/sankey/style.js → src/components/sankey/style.ts} +60 -44
- package/src/components/sankey/types.ts +95 -0
- package/src/components/scatter/config.ts +49 -0
- package/src/components/scatter/index.ts +220 -0
- package/src/components/scatter/modules/point.ts +123 -0
- package/src/components/scatter/modules/utils.ts +150 -0
- package/{components/scatter/style.js → src/components/scatter/style.ts} +15 -14
- package/src/components/scatter/types.ts +21 -0
- package/src/components/stacked-bar/config.ts +42 -0
- package/src/components/stacked-bar/index.ts +267 -0
- package/{components/stacked-bar/style.js → src/components/stacked-bar/style.ts} +15 -14
- package/src/components/stacked-bar/types.ts +5 -0
- package/src/components/timeline/config.ts +49 -0
- package/src/components/timeline/index.ts +302 -0
- package/{components/timeline/style.js → src/components/timeline/style.ts} +39 -30
- package/src/components/tooltip/config.ts +69 -0
- package/src/components/tooltip/index.ts +220 -0
- package/{components → src/components}/tooltip/style.js +11 -14
- package/src/components/topojson-map/config.ts +124 -0
- package/src/components/topojson-map/index.ts +436 -0
- package/{components/topojson-map/style.js → src/components/topojson-map/style.ts} +33 -26
- package/src/components/topojson-map/types.ts +123 -0
- package/src/components/topojson-map/utils.ts +29 -0
- package/src/components/vis-controls/config.ts +16 -0
- package/src/components/vis-controls/index.ts +68 -0
- package/{components/vis-controls/style.js → src/components/vis-controls/style.ts} +34 -27
- package/src/components/vis-controls/types.ts +14 -0
- package/src/components/xy-labels/config.ts +56 -0
- package/src/components/xy-labels/index.ts +109 -0
- package/src/components/xy-labels/modules/label.ts +140 -0
- package/{components/xy-labels/style.js → src/components/xy-labels/style.ts} +15 -14
- package/src/components/xy-labels/types.ts +26 -0
- package/src/components.ts +56 -0
- package/src/containers/single-container/config.ts +15 -0
- package/src/containers/single-container/index.ts +150 -0
- package/src/containers/xy-container/config.ts +112 -0
- package/src/containers/xy-container/index.ts +407 -0
- package/src/containers.ts +6 -0
- package/src/core/component/config.ts +61 -0
- package/src/core/component/index.ts +154 -0
- package/src/core/component/types.ts +9 -0
- package/src/core/config/index.ts +12 -0
- package/src/core/container/config.ts +56 -0
- package/src/core/container/index.ts +136 -0
- package/src/core/xy-component/config.ts +46 -0
- package/src/core/xy-component/index.ts +90 -0
- package/src/data-models/core.ts +15 -0
- package/src/data-models/graph.ts +138 -0
- package/src/data-models/map-graph.ts +72 -0
- package/src/data-models/map.ts +18 -0
- package/src/data-models/series.ts +16 -0
- package/src/index.ts +7 -0
- package/src/maps/china-provinces.json +1 -0
- package/src/maps/fr-regions.json +1 -0
- package/src/maps/germany-regions.json +1 -0
- package/src/maps/ind-regions.json +1 -0
- package/src/maps/uk-regions.json +1 -0
- package/src/maps/us-counties.json +1 -0
- package/src/maps/us-states.json +1 -0
- package/src/maps/world-110m-alpha.json +1 -0
- package/src/maps/world-simple.json +1 -0
- package/src/maps/world-simplest.json +1 -0
- package/src/maps.ts +34 -0
- package/src/styles/colors.ts +28 -0
- package/src/styles/index.ts +38 -0
- package/{styles/sizes.js → src/styles/sizes.ts} +6 -8
- package/src/types/accessor.ts +5 -0
- package/src/types/component.ts +15 -0
- package/src/types/curve.ts +62 -0
- package/src/types/data.ts +5 -0
- package/src/types/direction.ts +6 -0
- package/src/types/graph.ts +40 -0
- package/src/types/map.ts +5 -0
- package/src/types/misc.ts +10 -0
- package/src/types/position.ts +23 -0
- package/src/types/scale.ts +47 -0
- package/src/types/shape.ts +7 -0
- package/src/types/spacing.ts +6 -0
- package/src/types/svg.ts +32 -0
- package/src/types/symbol.ts +21 -0
- package/src/types/text.ts +71 -0
- package/src/types.ts +31 -0
- package/src/utils/color.ts +41 -0
- package/src/utils/d3.ts +15 -0
- package/src/utils/data.ts +328 -0
- package/src/utils/html.ts +13 -0
- package/src/utils/map.ts +29 -0
- package/src/utils/misc.ts +54 -0
- package/src/utils/path.ts +196 -0
- package/src/utils/scale.ts +1 -0
- package/src/utils/style.ts +37 -0
- package/src/utils/svg.ts +49 -0
- package/src/utils/text.ts +529 -0
- package/src/utils/type.ts +9 -0
- package/tsconfig.json +29 -0
- package/components/area/config.d.ts +0 -25
- package/components/area/config.js +0 -16
- package/components/area/config.js.map +0 -1
- package/components/area/index.d.ts +0 -19
- package/components/area/index.js +0 -102
- package/components/area/index.js.map +0 -1
- package/components/area/style.d.ts +0 -3
- package/components/area/style.js.map +0 -1
- package/components/area/types.d.ts +0 -6
- package/components/axis/config.d.ts +0 -71
- package/components/axis/config.js +0 -32
- package/components/axis/config.js.map +0 -1
- package/components/axis/index.d.ts +0 -44
- package/components/axis/index.js +0 -305
- package/components/axis/index.js.map +0 -1
- package/components/axis/style.d.ts +0 -9
- package/components/axis/style.js.map +0 -1
- package/components/axis/types.d.ts +0 -4
- package/components/axis/types.js +0 -8
- package/components/axis/types.js.map +0 -1
- package/components/brush/config.d.ts +0 -42
- package/components/brush/config.js +0 -24
- package/components/brush/config.js.map +0 -1
- package/components/brush/index.d.ts +0 -28
- package/components/brush/index.js +0 -199
- package/components/brush/index.js.map +0 -1
- package/components/brush/style.d.ts +0 -5
- package/components/brush/style.js.map +0 -1
- package/components/brush/types.d.ts +0 -7
- package/components/brush/types.js +0 -8
- package/components/brush/types.js.map +0 -1
- package/components/bullet-legend/config.d.ts +0 -34
- package/components/bullet-legend/config.js +0 -16
- package/components/bullet-legend/config.js.map +0 -1
- package/components/bullet-legend/index.d.ts +0 -19
- package/components/bullet-legend/index.js +0 -79
- package/components/bullet-legend/index.js.map +0 -1
- package/components/bullet-legend/style.d.ts +0 -6
- package/components/bullet-legend/style.js.map +0 -1
- package/components/bullet-legend/types.d.ts +0 -7
- package/components/bullet-legend/types.js +0 -2
- package/components/bullet-legend/types.js.map +0 -1
- package/components/chord-diagram/config.d.ts +0 -44
- package/components/chord-diagram/config.js +0 -25
- package/components/chord-diagram/config.js.map +0 -1
- package/components/chord-diagram/index.d.ts +0 -42
- package/components/chord-diagram/index.js +0 -305
- package/components/chord-diagram/index.js.map +0 -1
- package/components/chord-diagram/modules/label.d.ts +0 -8
- package/components/chord-diagram/modules/label.js +0 -115
- package/components/chord-diagram/modules/label.js.map +0 -1
- package/components/chord-diagram/modules/link.d.ts +0 -21
- package/components/chord-diagram/modules/link.js +0 -63
- package/components/chord-diagram/modules/link.js.map +0 -1
- package/components/chord-diagram/modules/node.d.ts +0 -17
- package/components/chord-diagram/modules/node.js +0 -52
- package/components/chord-diagram/modules/node.js.map +0 -1
- package/components/chord-diagram/style.d.ts +0 -13
- package/components/chord-diagram/style.js.map +0 -1
- package/components/chord-diagram/types.d.ts +0 -58
- package/components/chord-diagram/types.js +0 -8
- package/components/chord-diagram/types.js.map +0 -1
- package/components/crosshair/config.d.ts +0 -43
- package/components/crosshair/config.js +0 -19
- package/components/crosshair/config.js.map +0 -1
- package/components/crosshair/index.d.ts +0 -35
- package/components/crosshair/index.js +0 -183
- package/components/crosshair/index.js.map +0 -1
- package/components/crosshair/style.d.ts +0 -4
- package/components/crosshair/style.js.map +0 -1
- package/components/crosshair/types.d.ts +0 -13
- package/components/crosshair/types.js +0 -2
- package/components/crosshair/types.js.map +0 -1
- package/components/donut/config.d.ts +0 -59
- package/components/donut/config.js +0 -28
- package/components/donut/config.js.map +0 -1
- package/components/donut/index.d.ts +0 -21
- package/components/donut/index.js +0 -107
- package/components/donut/index.js.map +0 -1
- package/components/donut/modules/arc.d.ts +0 -10
- package/components/donut/modules/arc.js +0 -59
- package/components/donut/modules/arc.js.map +0 -1
- package/components/donut/style.d.ts +0 -7
- package/components/donut/style.js.map +0 -1
- package/components/donut/types.d.ts +0 -20
- package/components/flow-legend/config.d.ts +0 -29
- package/components/flow-legend/config.js +0 -18
- package/components/flow-legend/config.js.map +0 -1
- package/components/flow-legend/index.d.ts +0 -16
- package/components/flow-legend/index.js +0 -75
- package/components/flow-legend/index.js.map +0 -1
- package/components/flow-legend/style.d.ts +0 -8
- package/components/flow-legend/style.js.map +0 -1
- package/components/flow-legend/types.d.ts +0 -9
- package/components/flow-legend/types.js +0 -8
- package/components/flow-legend/types.js.map +0 -1
- package/components/free-brush/config.d.ts +0 -45
- package/components/free-brush/config.js +0 -24
- package/components/free-brush/config.js.map +0 -1
- package/components/free-brush/index.d.ts +0 -20
- package/components/free-brush/index.js +0 -192
- package/components/free-brush/index.js.map +0 -1
- package/components/free-brush/style.d.ts +0 -4
- package/components/free-brush/style.js.map +0 -1
- package/components/free-brush/types.d.ts +0 -7
- package/components/free-brush/types.js +0 -9
- package/components/free-brush/types.js.map +0 -1
- package/components/graph/config.d.ts +0 -238
- package/components/graph/config.js +0 -84
- package/components/graph/config.js.map +0 -1
- package/components/graph/index.d.ts +0 -126
- package/components/graph/index.js +0 -656
- package/components/graph/index.js.map +0 -1
- package/components/graph/modules/layout-helpers.d.ts +0 -21
- package/components/graph/modules/layout-helpers.js +0 -69
- package/components/graph/modules/layout-helpers.js.map +0 -1
- package/components/graph/modules/layout.d.ts +0 -10
- package/components/graph/modules/layout.js +0 -399
- package/components/graph/modules/layout.js.map +0 -1
- package/components/graph/modules/link/helper.d.ts +0 -25
- package/components/graph/modules/link/helper.js +0 -74
- package/components/graph/modules/link/helper.js.map +0 -1
- package/components/graph/modules/link/index.d.ts +0 -11
- package/components/graph/modules/link/index.js +0 -212
- package/components/graph/modules/link/index.js.map +0 -1
- package/components/graph/modules/link/style.d.ts +0 -15
- package/components/graph/modules/link/style.js.map +0 -1
- package/components/graph/modules/node/helper.d.ts +0 -21
- package/components/graph/modules/node/helper.js +0 -126
- package/components/graph/modules/node/helper.js.map +0 -1
- package/components/graph/modules/node/index.d.ts +0 -11
- package/components/graph/modules/node/index.js +0 -252
- package/components/graph/modules/node/index.js.map +0 -1
- package/components/graph/modules/node/style.d.ts +0 -24
- package/components/graph/modules/node/style.js.map +0 -1
- package/components/graph/modules/panel/helper.d.ts +0 -18
- package/components/graph/modules/panel/helper.js +0 -111
- package/components/graph/modules/panel/helper.js.map +0 -1
- package/components/graph/modules/panel/index.d.ts +0 -7
- package/components/graph/modules/panel/index.js +0 -98
- package/components/graph/modules/panel/index.js.map +0 -1
- package/components/graph/modules/panel/style.d.ts +0 -14
- package/components/graph/modules/panel/style.js.map +0 -1
- package/components/graph/modules/shape.d.ts +0 -6
- package/components/graph/modules/shape.js +0 -80
- package/components/graph/modules/shape.js.map +0 -1
- package/components/graph/modules/zoom-levels.d.ts +0 -6
- package/components/graph/modules/zoom-levels.js +0 -10
- package/components/graph/modules/zoom-levels.js.map +0 -1
- package/components/graph/style.d.ts +0 -6
- package/components/graph/style.js +0 -66
- package/components/graph/style.js.map +0 -1
- package/components/graph/types.d.ts +0 -125
- package/components/graph/types.js +0 -30
- package/components/graph/types.js.map +0 -1
- package/components/grouped-bar/config.d.ts +0 -36
- package/components/grouped-bar/config.js +0 -20
- package/components/grouped-bar/config.js.map +0 -1
- package/components/grouped-bar/index.d.ts +0 -32
- package/components/grouped-bar/index.js +0 -249
- package/components/grouped-bar/index.js.map +0 -1
- package/components/grouped-bar/style.d.ts +0 -5
- package/components/grouped-bar/style.js.map +0 -1
- package/components/leaflet-flow-map/config.d.ts +0 -46
- package/components/leaflet-flow-map/config.js +0 -25
- package/components/leaflet-flow-map/config.js.map +0 -1
- package/components/leaflet-flow-map/index.d.ts +0 -52
- package/components/leaflet-flow-map/index.js +0 -220
- package/components/leaflet-flow-map/index.js.map +0 -1
- package/components/leaflet-flow-map/renderer-utils.d.ts +0 -5
- package/components/leaflet-flow-map/renderer-utils.js +0 -15
- package/components/leaflet-flow-map/renderer-utils.js.map +0 -1
- package/components/leaflet-flow-map/renderer.d.ts +0 -26
- package/components/leaflet-flow-map/renderer.js +0 -117
- package/components/leaflet-flow-map/renderer.js.map +0 -1
- package/components/leaflet-flow-map/shaders.d.ts +0 -2
- package/components/leaflet-flow-map/shaders.js.map +0 -1
- package/components/leaflet-flow-map/types.d.ts +0 -23
- package/components/leaflet-map/config.d.ts +0 -193
- package/components/leaflet-map/config.js +0 -71
- package/components/leaflet-map/config.js.map +0 -1
- package/components/leaflet-map/index.d.ts +0 -130
- package/components/leaflet-map/index.js +0 -690
- package/components/leaflet-map/index.js.map +0 -1
- package/components/leaflet-map/leaflet.css.js +0 -5
- package/components/leaflet-map/leaflet.css.js.map +0 -1
- package/components/leaflet-map/modules/clusterBackground.d.ts +0 -5
- package/components/leaflet-map/modules/clusterBackground.js +0 -27
- package/components/leaflet-map/modules/clusterBackground.js.map +0 -1
- package/components/leaflet-map/modules/donut.d.ts +0 -3
- package/components/leaflet-map/modules/donut.js +0 -25
- package/components/leaflet-map/modules/donut.js.map +0 -1
- package/components/leaflet-map/modules/map.d.ts +0 -14
- package/components/leaflet-map/modules/map.js +0 -154
- package/components/leaflet-map/modules/map.js.map +0 -1
- package/components/leaflet-map/modules/node.d.ts +0 -9
- package/components/leaflet-map/modules/node.js +0 -162
- package/components/leaflet-map/modules/node.js.map +0 -1
- package/components/leaflet-map/modules/selectionRing.d.ts +0 -7
- package/components/leaflet-map/modules/selectionRing.js +0 -41
- package/components/leaflet-map/modules/selectionRing.js.map +0 -1
- package/components/leaflet-map/modules/utils.d.ts +0 -50
- package/components/leaflet-map/modules/utils.js +0 -210
- package/components/leaflet-map/modules/utils.js.map +0 -1
- package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +0 -1
- package/components/leaflet-map/renderer/map-style.d.ts +0 -4
- package/components/leaflet-map/renderer/map-style.js +0 -15
- package/components/leaflet-map/renderer/map-style.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js +0 -40
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js +0 -40
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js +0 -4981
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +0 -8
- package/components/leaflet-map/renderer/mapboxgl-layer.js +0 -27
- package/components/leaflet-map/renderer/mapboxgl-layer.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +0 -4
- package/components/leaflet-map/renderer/mapboxgl-utils.js +0 -39
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +0 -1
- package/components/leaflet-map/renderer/maplibre-gl.css.js.map +0 -1
- package/components/leaflet-map/style.d.ts +0 -52
- package/components/leaflet-map/style.js +0 -183
- package/components/leaflet-map/style.js.map +0 -1
- package/components/leaflet-map/types.d.ts +0 -75
- package/components/leaflet-map/types.js +0 -15
- package/components/leaflet-map/types.js.map +0 -1
- package/components/line/config.d.ts +0 -30
- package/components/line/config.js +0 -17
- package/components/line/config.js.map +0 -1
- package/components/line/index.d.ts +0 -27
- package/components/line/index.js +0 -152
- package/components/line/index.js.map +0 -1
- package/components/line/style.d.ts +0 -6
- package/components/line/style.js.map +0 -1
- package/components/line/types.d.ts +0 -12
- package/components/nested-donut/config.d.ts +0 -59
- package/components/nested-donut/config.js +0 -19
- package/components/nested-donut/config.js.map +0 -1
- package/components/nested-donut/index.d.ts +0 -38
- package/components/nested-donut/index.js +0 -133
- package/components/nested-donut/index.js.map +0 -1
- package/components/nested-donut/modules/arc.d.ts +0 -17
- package/components/nested-donut/modules/arc.js +0 -50
- package/components/nested-donut/modules/arc.js.map +0 -1
- package/components/nested-donut/modules/label.d.ts +0 -7
- package/components/nested-donut/modules/label.js +0 -34
- package/components/nested-donut/modules/label.js.map +0 -1
- package/components/nested-donut/style.d.ts +0 -26
- package/components/nested-donut/style.js +0 -70
- package/components/nested-donut/style.js.map +0 -1
- package/components/nested-donut/types.d.ts +0 -24
- package/components/nested-donut/types.js +0 -11
- package/components/nested-donut/types.js.map +0 -1
- package/components/sankey/config.d.ts +0 -162
- package/components/sankey/config.js +0 -65
- package/components/sankey/config.js.map +0 -1
- package/components/sankey/index.d.ts +0 -59
- package/components/sankey/index.js +0 -306
- package/components/sankey/index.js.map +0 -1
- package/components/sankey/modules/label.d.ts +0 -23
- package/components/sankey/modules/label.js +0 -168
- package/components/sankey/modules/label.js.map +0 -1
- package/components/sankey/modules/link.d.ts +0 -14
- package/components/sankey/modules/link.js +0 -108
- package/components/sankey/modules/link.js.map +0 -1
- package/components/sankey/modules/node.d.ts +0 -10
- package/components/sankey/modules/node.js +0 -156
- package/components/sankey/modules/node.js.map +0 -1
- package/components/sankey/style.d.ts +0 -20
- package/components/sankey/style.js.map +0 -1
- package/components/sankey/types.d.ts +0 -84
- package/components/sankey/types.js +0 -34
- package/components/sankey/types.js.map +0 -1
- package/components/scatter/config.d.ts +0 -44
- package/components/scatter/config.js +0 -23
- package/components/scatter/config.js.map +0 -1
- package/components/scatter/index.d.ts +0 -28
- package/components/scatter/index.js +0 -167
- package/components/scatter/index.js.map +0 -1
- package/components/scatter/modules/point.d.ts +0 -7
- package/components/scatter/modules/point.js +0 -86
- package/components/scatter/modules/point.js.map +0 -1
- package/components/scatter/modules/utils.d.ts +0 -11
- package/components/scatter/modules/utils.js +0 -112
- package/components/scatter/modules/utils.js.map +0 -1
- package/components/scatter/style.d.ts +0 -5
- package/components/scatter/style.js.map +0 -1
- package/components/scatter/types.d.ts +0 -19
- package/components/stacked-bar/config.d.ts +0 -38
- package/components/stacked-bar/config.js +0 -20
- package/components/stacked-bar/config.js.map +0 -1
- package/components/stacked-bar/index.d.ts +0 -28
- package/components/stacked-bar/index.js +0 -208
- package/components/stacked-bar/index.js.map +0 -1
- package/components/stacked-bar/style.d.ts +0 -5
- package/components/stacked-bar/style.js.map +0 -1
- package/components/stacked-bar/types.d.ts +0 -5
- package/components/timeline/config.d.ts +0 -43
- package/components/timeline/config.js +0 -24
- package/components/timeline/config.js.map +0 -1
- package/components/timeline/index.d.ts +0 -41
- package/components/timeline/index.js +0 -244
- package/components/timeline/index.js.map +0 -1
- package/components/timeline/style.d.ts +0 -13
- package/components/timeline/style.js.map +0 -1
- package/components/tooltip/config.d.ts +0 -68
- package/components/tooltip/config.js +0 -20
- package/components/tooltip/config.js.map +0 -1
- package/components/tooltip/index.d.ts +0 -36
- package/components/tooltip/index.js +0 -184
- package/components/tooltip/index.js.map +0 -1
- package/components/tooltip/style.js.map +0 -1
- package/components/topojson-map/config.d.ts +0 -99
- package/components/topojson-map/config.js +0 -42
- package/components/topojson-map/config.js.map +0 -1
- package/components/topojson-map/index.d.ts +0 -52
- package/components/topojson-map/index.js +0 -355
- package/components/topojson-map/index.js.map +0 -1
- package/components/topojson-map/style.d.ts +0 -11
- package/components/topojson-map/style.js.map +0 -1
- package/components/topojson-map/types.d.ts +0 -78
- package/components/topojson-map/types.js +0 -80
- package/components/topojson-map/types.js.map +0 -1
- package/components/topojson-map/utils.d.ts +0 -3
- package/components/topojson-map/utils.js +0 -30
- package/components/topojson-map/utils.js.map +0 -1
- package/components/vis-controls/config.d.ts +0 -12
- package/components/vis-controls/config.js +0 -13
- package/components/vis-controls/config.js.map +0 -1
- package/components/vis-controls/index.d.ts +0 -14
- package/components/vis-controls/index.js +0 -52
- package/components/vis-controls/index.js.map +0 -1
- package/components/vis-controls/style.d.ts +0 -11
- package/components/vis-controls/style.js.map +0 -1
- package/components/vis-controls/types.d.ts +0 -13
- package/components/vis-controls/types.js +0 -8
- package/components/vis-controls/types.js.map +0 -1
- package/components/xy-labels/config.d.ts +0 -48
- package/components/xy-labels/config.js +0 -25
- package/components/xy-labels/config.js.map +0 -1
- package/components/xy-labels/index.d.ts +0 -15
- package/components/xy-labels/index.js +0 -87
- package/components/xy-labels/index.js.map +0 -1
- package/components/xy-labels/modules/label.d.ts +0 -9
- package/components/xy-labels/modules/label.js +0 -107
- package/components/xy-labels/modules/label.js.map +0 -1
- package/components/xy-labels/style.d.ts +0 -5
- package/components/xy-labels/style.js.map +0 -1
- package/components/xy-labels/types.d.ts +0 -23
- package/components/xy-labels/types.js +0 -9
- package/components/xy-labels/types.js.map +0 -1
- package/components.d.ts +0 -51
- package/components.js +0 -29
- package/components.js.map +0 -1
- package/containers/single-container/config.d.ts +0 -12
- package/containers/single-container/config.js +0 -12
- package/containers/single-container/config.js.map +0 -1
- package/containers/single-container/index.d.ts +0 -19
- package/containers/single-container/index.js +0 -128
- package/containers/single-container/index.js.map +0 -1
- package/containers/xy-container/config.d.ts +0 -99
- package/containers/xy-container/config.js +0 -30
- package/containers/xy-container/config.js.map +0 -1
- package/containers/xy-container/index.d.ts +0 -34
- package/containers/xy-container/index.js +0 -330
- package/containers/xy-container/index.js.map +0 -1
- package/containers.d.ts +0 -6
- package/containers.js +0 -4
- package/containers.js.map +0 -1
- package/core/component/config.d.ts +0 -58
- package/core/component/config.js +0 -14
- package/core/component/config.js.map +0 -1
- package/core/component/index.d.ts +0 -43
- package/core/component/index.js +0 -118
- package/core/component/index.js.map +0 -1
- package/core/component/types.d.ts +0 -2
- package/core/component/types.js +0 -2
- package/core/component/types.js.map +0 -1
- package/core/config/index.d.ts +0 -3
- package/core/config/index.js +0 -16
- package/core/config/index.js.map +0 -1
- package/core/container/config.d.ts +0 -48
- package/core/container/config.js +0 -29
- package/core/container/config.js.map +0 -1
- package/core/container/index.d.ts +0 -26
- package/core/container/index.js +0 -105
- package/core/container/index.js.map +0 -1
- package/core/xy-component/config.d.ts +0 -38
- package/core/xy-component/config.js +0 -20
- package/core/xy-component/config.js.map +0 -1
- package/core/xy-component/index.d.ts +0 -27
- package/core/xy-component/index.js +0 -74
- package/core/xy-component/index.js.map +0 -1
- package/data-models/core.d.ts +0 -6
- package/data-models/core.js +0 -14
- package/data-models/core.js.map +0 -1
- package/data-models/graph.d.ts +0 -24
- package/data-models/graph.js +0 -107
- package/data-models/graph.js.map +0 -1
- package/data-models/map-graph.d.ts +0 -21
- package/data-models/map-graph.js +0 -62
- package/data-models/map-graph.js.map +0 -1
- package/data-models/map.d.ts +0 -5
- package/data-models/map.js +0 -12
- package/data-models/map.js.map +0 -1
- package/data-models/series.d.ts +0 -6
- package/data-models/series.js +0 -19
- package/data-models/series.js.map +0 -1
- package/index.d.ts +0 -7
- package/index.js +0 -55
- package/index.js.map +0 -1
- package/maps/china-provinces.json.js +0 -140373
- package/maps/fr-regions.json.js +0 -14162
- package/maps/germany-regions.json.js +0 -35760
- package/maps/ind-regions.json.js +0 -290584
- package/maps/uk-regions.json.js +0 -96233
- package/maps/us-counties.json.js +0 -206318
- package/maps/us-states.json.js +0 -16345
- package/maps/world-110m-alpha.json.js +0 -251366
- package/maps/world-simple.json.js +0 -89428
- package/maps/world-simplest.json.js +0 -28175
- package/maps.d.ts +0 -60
- package/maps.js +0 -23
- package/styles/colors.d.ts +0 -7
- package/styles/colors.js +0 -24
- package/styles/colors.js.map +0 -1
- package/styles/index.d.ts +0 -7
- package/styles/index.js +0 -38
- package/styles/index.js.map +0 -1
- package/styles/sizes.d.ts +0 -2
- package/styles/sizes.js.map +0 -1
- package/types/accessor.d.ts +0 -5
- package/types/accessor.js +0 -2
- package/types/accessor.js.map +0 -1
- package/types/component.d.ts +0 -13
- package/types/component.js +0 -14
- package/types/component.js.map +0 -1
- package/types/curve.d.ts +0 -40
- package/types/curve.js +0 -46
- package/types/curve.js.map +0 -1
- package/types/data.d.ts +0 -7
- package/types/data.js +0 -2
- package/types/data.js.map +0 -1
- package/types/direction.d.ts +0 -6
- package/types/direction.js +0 -10
- package/types/direction.js.map +0 -1
- package/types/graph.d.ts +0 -35
- package/types/graph.js +0 -2
- package/types/graph.js.map +0 -1
- package/types/map.d.ts +0 -4
- package/types/map.js +0 -2
- package/types/map.js.map +0 -1
- package/types/misc.d.ts +0 -8
- package/types/position.d.ts +0 -20
- package/types/position.js +0 -27
- package/types/position.js.map +0 -1
- package/types/scale.d.ts +0 -23
- package/types/scale.js +0 -27
- package/types/scale.js.map +0 -1
- package/types/shape.d.ts +0 -7
- package/types/shape.js +0 -11
- package/types/shape.js.map +0 -1
- package/types/spacing.d.ts +0 -6
- package/types/spacing.js +0 -2
- package/types/spacing.js.map +0 -1
- package/types/svg.d.ts +0 -18
- package/types/svg.js +0 -22
- package/types/svg.js.map +0 -1
- package/types/symbol.d.ts +0 -18
- package/types/symbol.js +0 -24
- package/types/symbol.js.map +0 -1
- package/types/text.d.ts +0 -47
- package/types/text.js +0 -26
- package/types/text.js.map +0 -1
- package/types.d.ts +0 -27
- package/types.js +0 -30
- package/types.js.map +0 -1
- package/utils/color.d.ts +0 -10
- package/utils/color.js +0 -32
- package/utils/color.js.map +0 -1
- package/utils/d3.d.ts +0 -3
- package/utils/d3.js +0 -16
- package/utils/d3.js.map +0 -1
- package/utils/data.d.ts +0 -45
- package/utils/data.js +0 -274
- package/utils/data.js.map +0 -1
- package/utils/html.d.ts +0 -1
- package/utils/html.js +0 -16
- package/utils/html.js.map +0 -1
- package/utils/map.d.ts +0 -2
- package/utils/map.js +0 -20
- package/utils/map.js.map +0 -1
- package/utils/misc.d.ts +0 -9
- package/utils/misc.js +0 -47
- package/utils/misc.js.map +0 -1
- package/utils/path.d.ts +0 -23
- package/utils/path.js +0 -144
- package/utils/path.js.map +0 -1
- package/utils/scale.d.ts +0 -1
- package/utils/style.d.ts +0 -6
- package/utils/style.js +0 -24
- package/utils/style.js.map +0 -1
- package/utils/svg.d.ts +0 -3
- package/utils/text.d.ts +0 -139
- package/utils/text.js +0 -443
- package/utils/text.js.map +0 -1
- package/utils/type.d.ts +0 -5
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { select } from 'd3-selection';
|
|
2
|
-
import { color } from 'd3-color';
|
|
3
|
-
import { getColor } from '../../utils/color.js';
|
|
4
|
-
import { BulletLegendConfig } from './config.js';
|
|
5
|
-
import * as style from './style.js';
|
|
6
|
-
import { root, item, bullet, label, clickable } from './style.js';
|
|
7
|
-
|
|
8
|
-
class BulletLegend {
|
|
9
|
-
constructor(element, config) {
|
|
10
|
-
this._colorAccessor = (d) => d.color;
|
|
11
|
-
this._container = element;
|
|
12
|
-
// Create SVG element for visualizations
|
|
13
|
-
this.div = select(this._container)
|
|
14
|
-
.append('div')
|
|
15
|
-
.attr('class', root);
|
|
16
|
-
this.element = this.div.node();
|
|
17
|
-
if (config)
|
|
18
|
-
this.update(config);
|
|
19
|
-
}
|
|
20
|
-
update(config) {
|
|
21
|
-
this.prevConfig = this.config;
|
|
22
|
-
this.config = new BulletLegendConfig().init(config);
|
|
23
|
-
this.render();
|
|
24
|
-
}
|
|
25
|
-
render() {
|
|
26
|
-
const { config } = this;
|
|
27
|
-
const legendItems = this.div.selectAll(`.${item}`)
|
|
28
|
-
.data(config.items);
|
|
29
|
-
const legendItemsEnter = legendItems.enter()
|
|
30
|
-
.append('div')
|
|
31
|
-
.attr('class', item)
|
|
32
|
-
.on('click', this._onItemClick.bind(this));
|
|
33
|
-
legendItemsEnter.append('span')
|
|
34
|
-
.attr('class', bullet)
|
|
35
|
-
.style('width', config.bulletSize)
|
|
36
|
-
.style('height', config.bulletSize);
|
|
37
|
-
legendItemsEnter.append('span')
|
|
38
|
-
.attr('class', label)
|
|
39
|
-
.classed(config.labelClassName, true)
|
|
40
|
-
.style('max-width', config.labelMaxWidth)
|
|
41
|
-
.style('font-size', config.labelFontSize);
|
|
42
|
-
const legendItemsMerged = legendItemsEnter.merge(legendItems);
|
|
43
|
-
legendItemsMerged
|
|
44
|
-
.classed(clickable, d => !!config.onLegendItemClick && this._isItemClickable(d))
|
|
45
|
-
.style('display', (d) => d.hidden ? 'none' : null);
|
|
46
|
-
const legendBulletsToUpdate = legendItemsMerged.select(`.${bullet}`);
|
|
47
|
-
legendBulletsToUpdate.style('background-color', (d, i) => getColor(d, this._colorAccessor, i))
|
|
48
|
-
.style('border-color', (d, i) => getColor(d, this._colorAccessor, i));
|
|
49
|
-
legendBulletsToUpdate.each((d, i, elements) => {
|
|
50
|
-
if (d.inactive) {
|
|
51
|
-
const bulletColor = window.getComputedStyle(elements[i]).getPropertyValue('background-color');
|
|
52
|
-
const transparentColor = color(bulletColor);
|
|
53
|
-
transparentColor.opacity = 0.4;
|
|
54
|
-
select(elements[i])
|
|
55
|
-
.style('background-color', transparentColor.toString());
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
legendItemsMerged.select(`.${label}`)
|
|
59
|
-
.text((d) => d.name);
|
|
60
|
-
legendItems.exit().remove();
|
|
61
|
-
}
|
|
62
|
-
_isItemClickable(item) {
|
|
63
|
-
return item.pointer === undefined ? true : item.pointer;
|
|
64
|
-
}
|
|
65
|
-
_onItemClick(event, d) {
|
|
66
|
-
const { config: { onLegendItemClick } } = this;
|
|
67
|
-
const legendItems = this.div.selectAll(`.${item}`).nodes();
|
|
68
|
-
const index = legendItems.indexOf(event.currentTarget);
|
|
69
|
-
if (onLegendItemClick)
|
|
70
|
-
onLegendItemClick(d, index);
|
|
71
|
-
}
|
|
72
|
-
destroy() {
|
|
73
|
-
this.div.remove();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
BulletLegend.selectors = style;
|
|
77
|
-
|
|
78
|
-
export { BulletLegend };
|
|
79
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/bullet-legend/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { color } from 'd3-color'\n\n// Utils\nimport { getColor } from 'utils/color'\n\n// Config\nimport { BulletLegendConfig, BulletLegendConfigInterface } from './config'\n\n// Local Types\nimport { BulletLegendItemInterface } from './types'\n\n// Styles\nimport * as s from './style'\n\nexport class BulletLegend {\n static selectors = s\n div: Selection<HTMLDivElement, unknown, null, undefined>\n element: HTMLElement\n prevConfig: BulletLegendConfig\n config: BulletLegendConfig\n protected _container: HTMLElement\n\n private _colorAccessor = (d: BulletLegendItemInterface): string => d.color\n\n constructor (element: HTMLElement, config?: BulletLegendConfigInterface) {\n this._container = element\n\n // Create SVG element for visualizations\n this.div = select(this._container)\n .append('div')\n .attr('class', s.root)\n\n this.element = this.div.node()\n\n if (config) this.update(config)\n }\n\n update (config: BulletLegendConfigInterface): void {\n this.prevConfig = this.config\n this.config = new BulletLegendConfig().init(config)\n this.render()\n }\n\n render (): void {\n const { config } = this\n const legendItems = this.div.selectAll<HTMLDivElement, unknown>(`.${s.item}`)\n .data(config.items)\n\n const legendItemsEnter = legendItems.enter()\n .append('div')\n .attr('class', s.item)\n .on('click', this._onItemClick.bind(this))\n\n legendItemsEnter.append('span')\n .attr('class', s.bullet)\n .style('width', config.bulletSize)\n .style('height', config.bulletSize)\n\n legendItemsEnter.append('span')\n .attr('class', s.label)\n .classed(config.labelClassName, true)\n .style('max-width', config.labelMaxWidth)\n .style('font-size', config.labelFontSize)\n\n const legendItemsMerged = legendItemsEnter.merge(legendItems)\n legendItemsMerged\n .classed(s.clickable, d => !!config.onLegendItemClick && this._isItemClickable(d))\n .style('display', (d: BulletLegendItemInterface) => d.hidden ? 'none' : null)\n const legendBulletsToUpdate = legendItemsMerged.select(`.${s.bullet}`)\n legendBulletsToUpdate.style('background-color', (d: BulletLegendItemInterface, i) => getColor(d, this._colorAccessor, i))\n .style('border-color', (d: BulletLegendItemInterface, i) => getColor(d, this._colorAccessor, i))\n legendBulletsToUpdate.each((d, i, elements) => {\n if (d.inactive) {\n const bulletColor = window.getComputedStyle(elements[i] as Element).getPropertyValue('background-color')\n const transparentColor = color(bulletColor)\n transparentColor.opacity = 0.4\n select(elements[i])\n .style('background-color', transparentColor.toString())\n }\n })\n\n legendItemsMerged.select(`.${s.label}`)\n .text((d: BulletLegendItemInterface) => d.name)\n\n legendItems.exit().remove()\n }\n\n _isItemClickable (item: BulletLegendItemInterface): boolean {\n return item.pointer === undefined ? true : item.pointer\n }\n\n _onItemClick (event: MouseEvent, d: BulletLegendItemInterface): void {\n const { config: { onLegendItemClick } } = this\n\n const legendItems = this.div.selectAll(`.${s.item}`).nodes() as HTMLElement[]\n const index = legendItems.indexOf(event.currentTarget as HTMLElement)\n if (onLegendItemClick) onLegendItemClick(d, index)\n }\n\n public destroy (): void {\n this.div.remove()\n }\n}\n"],"names":["s.root","s.item","s.bullet","s.label","s.clickable","s"],"mappings":";;;;;;;MAea,YAAY,CAAA;IAUvB,WAAa,CAAA,OAAoB,EAAE,MAAoC,EAAA;QAF/D,IAAc,CAAA,cAAA,GAAG,CAAC,CAA4B,KAAa,CAAC,CAAC,KAAK,CAAA;AAGxE,QAAA,IAAI,CAAC,UAAU,GAAG,OAAO,CAAA;;QAGzB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;aAC/B,MAAM,CAAC,KAAK,CAAC;AACb,aAAA,IAAI,CAAC,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9B,gBAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;qBAChB,KAAK,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAA;AAC1D,aAAA;AACH,SAAC,CAAC,CAAA;QAEF,iBAAiB,CAAC,MAAM,CAAC,CAAA,CAAA,EAAIC,KAAO,EAAE,CAAC;aACpC,IAAI,CAAC,CAAC,CAA4B,KAAK,CAAC,CAAC,IAAI,CAAC,CAAA;AAEjD,QAAA,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAA;KAC5B;AAED,IAAA,gBAAgB,CAAE,IAA+B,EAAA;AAC/C,QAAA,OAAO,IAAI,CAAC,OAAO,KAAK,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC,OAAO,CAAA;KACxD;IAED,YAAY,CAAE,KAAiB,EAAE,CAA4B,EAAA;QAC3D,MAAM,EAAE,MAAM,EAAE,EAAE,iBAAiB,EAAE,EAAE,GAAG,IAAI,CAAA;AAE9C,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAI,CAAA,EAAAF,IAAM,CAAA,CAAE,CAAC,CAAC,KAAK,EAAmB,CAAA;QAC7E,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,aAA4B,CAAC,CAAA;AACrE,QAAA,IAAI,iBAAiB;AAAE,YAAA,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;KACnD;IAEM,OAAO,GAAA;AACZ,QAAA,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;KAClB;;AAtFM,YAAS,CAAA,SAAA,GAAGI,KAAC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/bullet-legend/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const root = css`\n label: bullet-legend-component;\n`\n\nexport const variables = injectGlobal`\n :root {\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n /* --vis-legend-font-family: */\n\n --vis-legend-label-color: #6c778c;\n --vis-legend-label-max-width: 300px;\n --vis-legend-label-font-size: 12px;\n --vis-legend-bullet-size: 9px;\n --vis-legend-bullet-inactive-color: #eee;\n --vis-legend-item-spacing: 20px;\n --vis-legend-bullet-label-spacing: 8px;\n\n --vis-dark-legend-label-color: #eee;\n --vis-dark-legend-bullet-inactive-color: #6c778c;\n }\n\n body.theme-dark ${`.${root}`} {\n --vis-legend-label-color: var(--vis-dark-legend-label-color);\n --vis-legend-bullet-inactive-color: var(--vis-dark-legend-bullet-inactive-color);\n }\n`\n\nexport const item = css`\n label: legendItem;\n display: inline;\n font-family: var(--vis-legend-font-family, var(--vis-font-family));\n margin-right: var(--vis-legend-item-spacing);\n white-space: nowrap;\n cursor: default;\n user-select: none;\n`\n\nexport const clickable = css`\n cursor: pointer;\n`\n\nexport const label = css`\n label: legendItemLabel;\n font-size: var(--vis-legend-label-font-size);\n display: inline-block;\n vertical-align: middle;\n color: var(--vis-legend-label-color);\n max-width: var(--vis-legend-label-max-width);\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n`\n\nexport const bullet = css`\n label: legendItemBullet;\n border-radius: 100%;\n background-color: var(--vis-legend-bullet-inactive-color);\n border: 1px solid;\n display: inline-block;\n margin-right: var(--vis-legend-bullet-label-spacing);\n width: var(--vis-legend-bullet-size);\n height: var(--vis-legend-bullet-size);\n vertical-align: middle;\n\n .inactive {\n\n }\n`\n"],"names":[],"mappings":";;AAEO,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,SAAS,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;AAiBjB,kBAAA,EAAA,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;;EAI7B;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;;;;;;;EAQtB;AAEM,MAAM,SAAS,GAAG,GAAG,CAAA,CAAA;;EAE3B;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;EAUvB;AAEM,MAAM,MAAM,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ComponentConfigInterface, ComponentConfig } from "../../core/component/config";
|
|
2
|
-
import { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from "../../types/accessor";
|
|
3
|
-
import { ChordInputLink, ChordInputNode, ChordLabelAlignment, ChordNodeDatum } from './types';
|
|
4
|
-
export interface ChordDiagramConfigInterface<N extends ChordInputNode, L extends ChordInputLink> extends ComponentConfigInterface {
|
|
5
|
-
/** Link color accessor function. Default: `var(--vis-chord-diagram-link-fill-color)` */
|
|
6
|
-
linkColor?: ColorAccessor<L>;
|
|
7
|
-
/** Link value accessor function. Default: `l => l.value` */
|
|
8
|
-
linkValue?: NumericAccessor<L>;
|
|
9
|
-
/** Array of node hierarchy levels. Data records are supposed to have corresponding properties, e.g. ['level1', 'level2']. Default: `[]` */
|
|
10
|
-
nodeLevels?: string[];
|
|
11
|
-
/** Node width in pixels. Default: `15` */
|
|
12
|
-
nodeWidth?: number;
|
|
13
|
-
/** Node color accessor function ot constant value. Default: `d => d.color` */
|
|
14
|
-
nodeColor?: ColorAccessor<ChordNodeDatum<N>>;
|
|
15
|
-
/** Node label accessor function. Default: `d => d.label ?? d.key` */
|
|
16
|
-
nodeLabel?: StringAccessor<ChordNodeDatum<N>>;
|
|
17
|
-
/** Node label color accessor function. Default: `undefined` */
|
|
18
|
-
nodeLabelColor?: StringAccessor<ChordNodeDatum<N>>;
|
|
19
|
-
/** Node label alignment. Default: `ChordLabelAlignment.Along` */
|
|
20
|
-
nodeLabelAlignment?: GenericAccessor<ChordLabelAlignment | string, ChordNodeDatum<N>>;
|
|
21
|
-
/** Pad angle in radians. Constant value or accessor function. Default: `0.02` */
|
|
22
|
-
padAngle?: NumericAccessor<N>;
|
|
23
|
-
/** Corner radius constant value or accessor function. Default: `2` */
|
|
24
|
-
cornerRadius?: NumericAccessor<N>;
|
|
25
|
-
/** Angular range of the diagram. Default: `[0, 2 * Math.PI]` */
|
|
26
|
-
angleRange?: [number, number];
|
|
27
|
-
/** The exponent property of the radius scale. Default: `2` */
|
|
28
|
-
radiusScaleExponent?: number;
|
|
29
|
-
}
|
|
30
|
-
export declare class ChordDiagramConfig<N extends ChordInputNode, L extends ChordInputLink> extends ComponentConfig implements ChordDiagramConfigInterface<N, L> {
|
|
31
|
-
duration: number;
|
|
32
|
-
linkColor: any;
|
|
33
|
-
linkValue: (d: L) => number;
|
|
34
|
-
nodeLevels: any[];
|
|
35
|
-
nodeWidth: number;
|
|
36
|
-
nodeColor: (d: ChordNodeDatum<N>) => string;
|
|
37
|
-
nodeLabel: (d: ChordNodeDatum<N>) => string;
|
|
38
|
-
nodeLabelColor: any;
|
|
39
|
-
nodeLabelAlignment: ChordLabelAlignment;
|
|
40
|
-
padAngle: number;
|
|
41
|
-
cornerRadius: number;
|
|
42
|
-
angleRange: [number, number];
|
|
43
|
-
radiusScaleExponent: number;
|
|
44
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentConfig } from '../../core/component/config.js';
|
|
2
|
-
import { ChordLabelAlignment } from './types.js';
|
|
3
|
-
|
|
4
|
-
/* eslint-disable dot-notation */
|
|
5
|
-
class ChordDiagramConfig extends ComponentConfig {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.duration = 800;
|
|
9
|
-
this.linkColor = undefined;
|
|
10
|
-
this.linkValue = (d) => d['value'];
|
|
11
|
-
this.nodeLevels = [];
|
|
12
|
-
this.nodeWidth = 15;
|
|
13
|
-
this.nodeColor = (d) => d['color'];
|
|
14
|
-
this.nodeLabel = (d) => { var _a; return (_a = d['label']) !== null && _a !== void 0 ? _a : d['key']; };
|
|
15
|
-
this.nodeLabelColor = undefined;
|
|
16
|
-
this.nodeLabelAlignment = ChordLabelAlignment.Along;
|
|
17
|
-
this.padAngle = 0.02;
|
|
18
|
-
this.cornerRadius = 2;
|
|
19
|
-
this.angleRange = [0, 2 * Math.PI];
|
|
20
|
-
this.radiusScaleExponent = 2;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { ChordDiagramConfig };
|
|
25
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/chord-diagram/config.ts"],"sourcesContent":["/* eslint-disable dot-notation */\n\n// Core\nimport { ComponentConfigInterface, ComponentConfig } from 'core/component/config'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\n\n// Local Types\nimport { ChordInputLink, ChordInputNode, ChordLabelAlignment, ChordNodeDatum } from './types'\n\nexport interface ChordDiagramConfigInterface<N extends ChordInputNode, L extends ChordInputLink> extends ComponentConfigInterface {\n /** Link color accessor function. Default: `var(--vis-chord-diagram-link-fill-color)` */\n linkColor?: ColorAccessor<L>;\n /** Link value accessor function. Default: `l => l.value` */\n linkValue?: NumericAccessor<L>;\n /** Array of node hierarchy levels. Data records are supposed to have corresponding properties, e.g. ['level1', 'level2']. Default: `[]` */\n nodeLevels?: string[];\n /** Node width in pixels. Default: `15` */\n nodeWidth?: number;\n /** Node color accessor function ot constant value. Default: `d => d.color` */\n nodeColor?: ColorAccessor<ChordNodeDatum<N>>;\n /** Node label accessor function. Default: `d => d.label ?? d.key` */\n nodeLabel?: StringAccessor<ChordNodeDatum<N>>;\n /** Node label color accessor function. Default: `undefined` */\n nodeLabelColor?: StringAccessor<ChordNodeDatum<N>>;\n /** Node label alignment. Default: `ChordLabelAlignment.Along` */\n nodeLabelAlignment?: GenericAccessor<ChordLabelAlignment | string, ChordNodeDatum<N>>;\n /** Pad angle in radians. Constant value or accessor function. Default: `0.02` */\n padAngle?: NumericAccessor<N>;\n /** Corner radius constant value or accessor function. Default: `2` */\n cornerRadius?: NumericAccessor<N>;\n /** Angular range of the diagram. Default: `[0, 2 * Math.PI]` */\n angleRange?: [number, number];\n /** The exponent property of the radius scale. Default: `2` */\n radiusScaleExponent?: number;\n}\n\nexport class ChordDiagramConfig<N extends ChordInputNode, L extends ChordInputLink> extends ComponentConfig implements ChordDiagramConfigInterface<N, L> {\n duration = 800\n linkColor = undefined\n linkValue = (d: L): number => d['value']\n nodeLevels = []\n nodeWidth = 15\n nodeColor = (d: ChordNodeDatum<N>): string => d['color']\n nodeLabel = (d: ChordNodeDatum<N>): string => d['label'] ?? d['key']\n nodeLabelColor = undefined\n nodeLabelAlignment = ChordLabelAlignment.Along\n padAngle = 0.02\n cornerRadius = 2\n angleRange: [number, number] = [0, 2 * Math.PI]\n radiusScaleExponent = 2\n}\n"],"names":[],"mappings":";;;AAAA;AAsCM,MAAO,kBAAuE,SAAQ,eAAe,CAAA;AAA3G,IAAA,WAAA,GAAA;;QACE,IAAQ,CAAA,QAAA,GAAG,GAAG,CAAA;QACd,IAAS,CAAA,SAAA,GAAG,SAAS,CAAA;QACrB,IAAS,CAAA,SAAA,GAAG,CAAC,CAAI,KAAa,CAAC,CAAC,OAAO,CAAC,CAAA;QACxC,IAAU,CAAA,UAAA,GAAG,EAAE,CAAA;QACf,IAAS,CAAA,SAAA,GAAG,EAAE,CAAA;QACd,IAAS,CAAA,SAAA,GAAG,CAAC,CAAoB,KAAa,CAAC,CAAC,OAAO,CAAC,CAAA;AACxD,QAAA,IAAA,CAAA,SAAS,GAAG,CAAC,CAAoB,KAAY,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAA,CAAC,CAAC,OAAO,CAAC,mCAAI,CAAC,CAAC,KAAK,CAAC,CAAA,EAAA,CAAA;QACpE,IAAc,CAAA,cAAA,GAAG,SAAS,CAAA;AAC1B,QAAA,IAAA,CAAA,kBAAkB,GAAG,mBAAmB,CAAC,KAAK,CAAA;QAC9C,IAAQ,CAAA,QAAA,GAAG,IAAI,CAAA;QACf,IAAY,CAAA,YAAA,GAAG,CAAC,CAAA;QAChB,IAAU,CAAA,UAAA,GAAqB,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAA;QAC/C,IAAmB,CAAA,mBAAA,GAAG,CAAC,CAAA;KACxB;AAAA;;;;"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Selection } from 'd3-selection';
|
|
2
|
-
import { ScalePower } from 'd3-scale';
|
|
3
|
-
import { ComponentCore } from "../../core/component";
|
|
4
|
-
import { GraphDataModel } from "../../data-models/graph";
|
|
5
|
-
import { Spacing } from "../../types/spacing";
|
|
6
|
-
import { ChordInputNode, ChordInputLink, ChordDiagramData, ChordNode, ChordRibbon } from './types';
|
|
7
|
-
import { ChordDiagramConfig, ChordDiagramConfigInterface } from './config';
|
|
8
|
-
import * as s from './style';
|
|
9
|
-
export declare class ChordDiagram<N extends ChordInputNode, L extends ChordInputLink> extends ComponentCore<ChordDiagramData<N, L>, ChordDiagramConfig<N, L>, ChordDiagramConfigInterface<N, L>> {
|
|
10
|
-
static selectors: typeof s;
|
|
11
|
-
config: ChordDiagramConfig<N, L>;
|
|
12
|
-
datamodel: GraphDataModel<N, L>;
|
|
13
|
-
nodeGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>;
|
|
14
|
-
linkGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>;
|
|
15
|
-
labelGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>;
|
|
16
|
-
arcGen: import("d3-shape").Arc<any, ChordNode<N>>;
|
|
17
|
-
radiusScale: ScalePower<number, number>;
|
|
18
|
-
private _nodes;
|
|
19
|
-
private _links;
|
|
20
|
-
private _rootNode;
|
|
21
|
-
events: {
|
|
22
|
-
[x: string]: {
|
|
23
|
-
mouseover: (d: ChordNode<N>) => void;
|
|
24
|
-
mouseout: () => void;
|
|
25
|
-
} | {
|
|
26
|
-
mouseover: (d: ChordRibbon<N>) => void;
|
|
27
|
-
mouseout: () => void;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
constructor(config?: ChordDiagramConfigInterface<N, L>);
|
|
31
|
-
get bleed(): Spacing;
|
|
32
|
-
_render(customDuration?: number): void;
|
|
33
|
-
private _getHierarchyNodes;
|
|
34
|
-
private _getRibbons;
|
|
35
|
-
private _convertRadialToCartesian;
|
|
36
|
-
private _calculateRadialPosition;
|
|
37
|
-
private _onNodeMouseOver;
|
|
38
|
-
private _onNodeMouseOut;
|
|
39
|
-
private _onLinkMouseOver;
|
|
40
|
-
private _onLinkMouseOut;
|
|
41
|
-
private _highlightOnHover;
|
|
42
|
-
}
|
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import { nest } from 'd3-collection';
|
|
2
|
-
import { partition, hierarchy } from 'd3-hierarchy';
|
|
3
|
-
import { arc, line } from 'd3-shape';
|
|
4
|
-
import { scalePow } from 'd3-scale';
|
|
5
|
-
import { max } from 'd3-array';
|
|
6
|
-
import { ComponentCore } from '../../core/component/index.js';
|
|
7
|
-
import { GraphDataModel } from '../../data-models/graph.js';
|
|
8
|
-
import { getValue, getString, isNumber, getNumber, groupBy } from '../../utils/data.js';
|
|
9
|
-
import { estimateStringPixelLength } from '../../utils/text.js';
|
|
10
|
-
import { Curve } from '../../types/curve.js';
|
|
11
|
-
import { ChordLabelAlignment } from './types.js';
|
|
12
|
-
import { ChordDiagramConfig } from './config.js';
|
|
13
|
-
import { createNode, updateNode, removeNode } from './modules/node.js';
|
|
14
|
-
import { LABEL_PADDING, createLabel, updateLabel, removeLabel } from './modules/label.js';
|
|
15
|
-
import { createLink, updateLink, removeLink } from './modules/link.js';
|
|
16
|
-
import * as style from './style.js';
|
|
17
|
-
import { links, nodes, labels, link, node, gLabel, labelExit, hoveredNode, hoveredLink, transparent } from './style.js';
|
|
18
|
-
|
|
19
|
-
class ChordDiagram extends ComponentCore {
|
|
20
|
-
constructor(config) {
|
|
21
|
-
super();
|
|
22
|
-
this.config = new ChordDiagramConfig();
|
|
23
|
-
this.datamodel = new GraphDataModel();
|
|
24
|
-
this.arcGen = arc();
|
|
25
|
-
this.radiusScale = scalePow();
|
|
26
|
-
this._nodes = [];
|
|
27
|
-
this._links = [];
|
|
28
|
-
this.events = {
|
|
29
|
-
[ChordDiagram.selectors.node]: {
|
|
30
|
-
mouseover: this._onNodeMouseOver.bind(this),
|
|
31
|
-
mouseout: this._onNodeMouseOut.bind(this),
|
|
32
|
-
},
|
|
33
|
-
[ChordDiagram.selectors.link]: {
|
|
34
|
-
mouseover: this._onLinkMouseOver.bind(this),
|
|
35
|
-
mouseout: this._onLinkMouseOut.bind(this),
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
if (config)
|
|
39
|
-
this.config.init(config);
|
|
40
|
-
this.linkGroup = this.g.append('g').attr('class', links);
|
|
41
|
-
this.nodeGroup = this.g.append('g').attr('class', nodes);
|
|
42
|
-
this.labelGroup = this.g.append('g').attr('class', labels);
|
|
43
|
-
}
|
|
44
|
-
get bleed() {
|
|
45
|
-
const { config } = this;
|
|
46
|
-
let top = 0;
|
|
47
|
-
let bottom = 0;
|
|
48
|
-
let right = 0;
|
|
49
|
-
let left = 0;
|
|
50
|
-
const padding = 4 + LABEL_PADDING * 2;
|
|
51
|
-
this._nodes.forEach(n => {
|
|
52
|
-
var _a;
|
|
53
|
-
const nodeLabelAlignment = getValue(n.data, config.nodeLabelAlignment);
|
|
54
|
-
if (n.height === 0 && nodeLabelAlignment === ChordLabelAlignment.Perpendicular) {
|
|
55
|
-
const labelWidth = estimateStringPixelLength((_a = getString(n.data, config.nodeLabel)) !== null && _a !== void 0 ? _a : '', 16);
|
|
56
|
-
const [x, y] = this.arcGen.centroid(n);
|
|
57
|
-
if (x < 0)
|
|
58
|
-
left = Math.max(left, labelWidth);
|
|
59
|
-
else
|
|
60
|
-
right = Math.max(right, labelWidth);
|
|
61
|
-
if (y < 0)
|
|
62
|
-
top = Math.max(top, labelWidth);
|
|
63
|
-
else
|
|
64
|
-
bottom = Math.max(bottom, labelWidth);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
left += padding;
|
|
68
|
-
right += padding;
|
|
69
|
-
bottom += padding;
|
|
70
|
-
top += padding;
|
|
71
|
-
return { top, bottom, left, right };
|
|
72
|
-
}
|
|
73
|
-
_render(customDuration) {
|
|
74
|
-
super._render(customDuration);
|
|
75
|
-
const { config, config: { radiusScaleExponent }, radiusScale } = this;
|
|
76
|
-
const nodes = this._getHierarchyNodes();
|
|
77
|
-
const duration = isNumber(customDuration) ? customDuration : config.duration;
|
|
78
|
-
this.arcGen
|
|
79
|
-
.startAngle(d => d.x0)
|
|
80
|
-
.endAngle(d => d.x1)
|
|
81
|
-
.cornerRadius(d => getNumber(d, config.cornerRadius))
|
|
82
|
-
.innerRadius(d => this.radiusScale(d.y1) - getNumber(d, config.nodeWidth))
|
|
83
|
-
.outerRadius(d => this.radiusScale(d.y1));
|
|
84
|
-
const linkLineGen = line().curve(Curve.catmullRom.alpha(0.25));
|
|
85
|
-
const hierarchyData = nodes;
|
|
86
|
-
const partitionData = partition().size([config.angleRange[1], 1])(hierarchyData);
|
|
87
|
-
this._calculateRadialPosition(partitionData);
|
|
88
|
-
const size = Math.min(this._width, this._height);
|
|
89
|
-
const radius = size / 2 - max([this.bleed.top, this.bleed.bottom, this.bleed.left, this.bleed.right]);
|
|
90
|
-
const labelWidth = size - radius - config.nodeWidth;
|
|
91
|
-
radiusScale
|
|
92
|
-
.exponent(radiusScaleExponent)
|
|
93
|
-
.range([0, radius]);
|
|
94
|
-
const partitionDataWithRoot = partitionData.descendants();
|
|
95
|
-
this._rootNode = partitionDataWithRoot.find(d => d.depth === 0);
|
|
96
|
-
this._nodes = partitionDataWithRoot.filter(d => d.depth !== 0); // Filter out the root node
|
|
97
|
-
this._links = this._getRibbons(partitionData);
|
|
98
|
-
// Create Node and Link state objects
|
|
99
|
-
this._nodes.forEach((node, i) => {
|
|
100
|
-
// Add hierarchy data for non leaf nodes
|
|
101
|
-
if (node.children) {
|
|
102
|
-
node.data = Object.assign(node.data, {
|
|
103
|
-
depth: node.depth,
|
|
104
|
-
height: node.height,
|
|
105
|
-
value: node.value,
|
|
106
|
-
ancestors: node.ancestors().map(d => d.data.key),
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
node.x0 = Number.isNaN(node.x0) ? 0 : node.x0;
|
|
110
|
-
node.x1 = Number.isNaN(node.x1) ? 0 : node.x1;
|
|
111
|
-
node.uid = `${this.uid}-n${i}`;
|
|
112
|
-
node._state = {};
|
|
113
|
-
});
|
|
114
|
-
this._links.forEach(link => { link._state = {}; });
|
|
115
|
-
// Center the view
|
|
116
|
-
this.g.attr('transform', `translate(${this._width / 2},${this._height / 2})`);
|
|
117
|
-
// Links
|
|
118
|
-
const linksSelection = this.linkGroup
|
|
119
|
-
.selectAll(`.${link}`)
|
|
120
|
-
.data(this._links, d => String(d.data._id));
|
|
121
|
-
const linksEnter = linksSelection.enter().append('path')
|
|
122
|
-
.attr('class', link)
|
|
123
|
-
.call(createLink, linkLineGen);
|
|
124
|
-
const linksMerged = linksSelection.merge(linksEnter);
|
|
125
|
-
linksMerged.call(updateLink, config, linkLineGen, duration);
|
|
126
|
-
linksSelection.exit()
|
|
127
|
-
.call(removeLink, duration);
|
|
128
|
-
// Nodes
|
|
129
|
-
const nodesSelection = this.nodeGroup
|
|
130
|
-
.selectAll(`.${node}`)
|
|
131
|
-
.data(this._nodes, d => String(d.uid));
|
|
132
|
-
const nodesEnter = nodesSelection.enter().append('path')
|
|
133
|
-
.attr('class', node)
|
|
134
|
-
.call(createNode, config);
|
|
135
|
-
const nodesMerged = nodesSelection.merge(nodesEnter);
|
|
136
|
-
nodesMerged.call(updateNode, config, this.arcGen, duration);
|
|
137
|
-
nodesSelection.exit()
|
|
138
|
-
.call(removeNode, duration);
|
|
139
|
-
// Labels
|
|
140
|
-
const labels = this.labelGroup
|
|
141
|
-
.selectAll(`.${gLabel}`)
|
|
142
|
-
.data(this._nodes, d => String(d.uid));
|
|
143
|
-
const labelEnter = labels.enter().append('g')
|
|
144
|
-
.attr('class', gLabel)
|
|
145
|
-
.call(createLabel, config, radiusScale);
|
|
146
|
-
const labelsMerged = labels.merge(labelEnter);
|
|
147
|
-
labelsMerged.call(updateLabel, config, labelWidth, radiusScale, duration);
|
|
148
|
-
labels.exit()
|
|
149
|
-
.attr('class', labelExit)
|
|
150
|
-
.call(removeLabel, duration);
|
|
151
|
-
}
|
|
152
|
-
_getHierarchyNodes() {
|
|
153
|
-
const { config, datamodel: { nodes, links } } = this;
|
|
154
|
-
nodes.forEach(n => { delete n._state.value; });
|
|
155
|
-
links.forEach(l => {
|
|
156
|
-
delete l._state.points;
|
|
157
|
-
l.source._state.value = (l.source._state.value || 0) + getNumber(l, config.linkValue);
|
|
158
|
-
l.target._state.value = (l.target._state.value || 0) + getNumber(l, config.linkValue);
|
|
159
|
-
});
|
|
160
|
-
// TODO: Replace with d3-group
|
|
161
|
-
const nestGen = nest();
|
|
162
|
-
config.nodeLevels.forEach(levelAccessor => {
|
|
163
|
-
nestGen.key(d => d[levelAccessor]);
|
|
164
|
-
});
|
|
165
|
-
const root = { key: 'root', values: nestGen.entries(nodes) };
|
|
166
|
-
const hierarchyNodes = hierarchy(root, d => d.values)
|
|
167
|
-
.sum((d) => { var _a; return (_a = d._state) === null || _a === void 0 ? void 0 : _a.value; });
|
|
168
|
-
return hierarchyNodes;
|
|
169
|
-
}
|
|
170
|
-
_getRibbons(partitionData) {
|
|
171
|
-
const { config, datamodel: { links } } = this;
|
|
172
|
-
const findNode = (nodes, id) => nodes.find(n => n.data._id === id);
|
|
173
|
-
const leafNodes = partitionData.leaves();
|
|
174
|
-
const groupedBySource = groupBy(links, d => d.source._id);
|
|
175
|
-
const groupedByTarget = groupBy(links, d => d.target._id);
|
|
176
|
-
const getNodesInRibbon = (source, target, partitionHeight, nodes = []) => {
|
|
177
|
-
nodes[source.height] = source;
|
|
178
|
-
nodes[partitionHeight * 2 - target.height] = target;
|
|
179
|
-
if (source.parent && target.parent)
|
|
180
|
-
getNodesInRibbon(source.parent, target.parent, partitionHeight, nodes);
|
|
181
|
-
return nodes;
|
|
182
|
-
};
|
|
183
|
-
const calculatePoints = (links, type, depth) => {
|
|
184
|
-
links.forEach(link => {
|
|
185
|
-
var _a;
|
|
186
|
-
if (!link._state.points)
|
|
187
|
-
link._state.points = [];
|
|
188
|
-
const sourceLeaf = findNode(leafNodes, link.source._id);
|
|
189
|
-
const targetLeaf = findNode(leafNodes, link.target._id);
|
|
190
|
-
const nodesInRibbon = getNodesInRibbon(type === 'out' ? sourceLeaf : targetLeaf, type === 'out' ? targetLeaf : sourceLeaf, partitionData.height);
|
|
191
|
-
const currNode = nodesInRibbon[depth];
|
|
192
|
-
const len = currNode.x1 - currNode.x0;
|
|
193
|
-
const x0 = (_a = currNode._prevX1) !== null && _a !== void 0 ? _a : currNode.x0;
|
|
194
|
-
const x1 = x0 + len * getNumber(link, config.linkValue) / currNode.value;
|
|
195
|
-
currNode._prevX1 = x1;
|
|
196
|
-
const pointIdx = type === 'out' ? depth : partitionData.height * 2 - 1 - depth;
|
|
197
|
-
link._state.points[pointIdx] = this._convertRadialToCartesian(Math.min(x0, x1), Math.max(x0, x1), currNode.y1, config.nodeWidth);
|
|
198
|
-
});
|
|
199
|
-
};
|
|
200
|
-
leafNodes.forEach(leafNode => {
|
|
201
|
-
const outLinks = groupedBySource[leafNode.data._id] || [];
|
|
202
|
-
const inLinks = groupedByTarget[leafNode.data._id] || [];
|
|
203
|
-
for (let depth = 0; depth < partitionData.height; depth += 1) {
|
|
204
|
-
calculatePoints(outLinks, 'out', depth);
|
|
205
|
-
calculatePoints(inLinks, 'in', depth);
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
const ribbons = links.map(l => {
|
|
209
|
-
const sourceNode = findNode(leafNodes, l.source._id);
|
|
210
|
-
const targetNode = findNode(leafNodes, l.target._id);
|
|
211
|
-
return {
|
|
212
|
-
source: sourceNode,
|
|
213
|
-
target: targetNode,
|
|
214
|
-
data: l,
|
|
215
|
-
points: l._state.points,
|
|
216
|
-
_state: {},
|
|
217
|
-
};
|
|
218
|
-
});
|
|
219
|
-
return ribbons;
|
|
220
|
-
}
|
|
221
|
-
_convertRadialToCartesian(x0, x1, y, nodeWidth) {
|
|
222
|
-
const r = Math.max(this.radiusScale(y) - nodeWidth, 0);
|
|
223
|
-
const a0 = x0 - Math.PI / 2;
|
|
224
|
-
const a1 = x1 - Math.PI / 2;
|
|
225
|
-
return {
|
|
226
|
-
a0,
|
|
227
|
-
a1,
|
|
228
|
-
r,
|
|
229
|
-
x0: r * Math.cos(a0),
|
|
230
|
-
x1: r * Math.cos(a1),
|
|
231
|
-
y0: r * Math.sin(a0),
|
|
232
|
-
y1: r * Math.sin(a1),
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
_calculateRadialPosition(hierarchyNode, scalingCoeff = 0.95, nodePadding = 0.02) {
|
|
236
|
-
if (!hierarchyNode.children)
|
|
237
|
-
return;
|
|
238
|
-
// Calculate x0 and x1
|
|
239
|
-
const nodeLength = (hierarchyNode.x1 - hierarchyNode.x0);
|
|
240
|
-
const scaledNodeLength = nodeLength * scalingCoeff;
|
|
241
|
-
const delta = nodeLength - scaledNodeLength;
|
|
242
|
-
let x0 = hierarchyNode.x0 + delta / 2;
|
|
243
|
-
for (const node of hierarchyNode.children) {
|
|
244
|
-
const childX0 = x0;
|
|
245
|
-
const childX1 = x0 + (node.value / hierarchyNode.value) * scaledNodeLength - nodePadding / 2;
|
|
246
|
-
const childNodeLength = childX1 - childX0;
|
|
247
|
-
const scaledChildNodeLength = childNodeLength * scalingCoeff;
|
|
248
|
-
const childDelta = childNodeLength - scaledChildNodeLength;
|
|
249
|
-
node.x0 = childX0 + childDelta / 2;
|
|
250
|
-
node.x1 = node.x0 + scaledChildNodeLength;
|
|
251
|
-
x0 = childX1 + nodePadding / 2 + childDelta / 2;
|
|
252
|
-
}
|
|
253
|
-
// Go deeper in the hierarchy
|
|
254
|
-
for (const node of hierarchyNode.children) {
|
|
255
|
-
this._calculateRadialPosition(node, scalingCoeff, nodePadding);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
_onNodeMouseOver(d) {
|
|
259
|
-
let ribbons;
|
|
260
|
-
if (d.children) {
|
|
261
|
-
const leaves = d.leaves();
|
|
262
|
-
ribbons = this._links.filter(l => leaves.find(leaf => l.source.data.id === leaf.data.id || l.target.data.id === leaf.data.id));
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
const leaf = d;
|
|
266
|
-
ribbons = this._links.filter(l => l.source.data.id === leaf.data.id || l.target.data.id === leaf.data.id);
|
|
267
|
-
}
|
|
268
|
-
this._highlightOnHover(ribbons);
|
|
269
|
-
}
|
|
270
|
-
_onNodeMouseOut() {
|
|
271
|
-
this._highlightOnHover();
|
|
272
|
-
}
|
|
273
|
-
_onLinkMouseOver(d) {
|
|
274
|
-
this._highlightOnHover([d]);
|
|
275
|
-
}
|
|
276
|
-
_onLinkMouseOut() {
|
|
277
|
-
this._highlightOnHover();
|
|
278
|
-
}
|
|
279
|
-
_highlightOnHover(links) {
|
|
280
|
-
if (links) {
|
|
281
|
-
links.forEach(l => {
|
|
282
|
-
l._state.hovered = true;
|
|
283
|
-
const sourcePath = l.source.path(this._rootNode);
|
|
284
|
-
const targetPath = l.target.path(this._rootNode);
|
|
285
|
-
sourcePath.forEach(n => { if (n.depth)
|
|
286
|
-
n._state.hovered = true; });
|
|
287
|
-
targetPath.forEach(n => { if (n.depth)
|
|
288
|
-
n._state.hovered = true; });
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
else {
|
|
292
|
-
this._nodes.forEach(n => { delete n._state.hovered; });
|
|
293
|
-
this._links.forEach(l => { delete l._state.hovered; });
|
|
294
|
-
}
|
|
295
|
-
this.nodeGroup.selectAll(`.${node}`)
|
|
296
|
-
.classed(hoveredNode, d => d._state.hovered);
|
|
297
|
-
this.linkGroup.selectAll(`.${link}`)
|
|
298
|
-
.classed(hoveredLink, d => d._state.hovered);
|
|
299
|
-
this.g.classed(transparent, !!links);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
ChordDiagram.selectors = style;
|
|
303
|
-
|
|
304
|
-
export { ChordDiagram };
|
|
305
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/chord-diagram/index.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport { nest } from 'd3-collection'\nimport { HierarchyNode, hierarchy, partition } from 'd3-hierarchy'\nimport { arc, line } from 'd3-shape'\nimport { scalePow, ScalePower } from 'd3-scale'\nimport { max } from 'd3-array'\n\n// Core\nimport { ComponentCore } from 'core/component'\nimport { GraphDataModel } from 'data-models/graph'\n\n// Utils\nimport { getNumber, isNumber, groupBy, getString, getValue } from 'utils/data'\nimport { estimateStringPixelLength } from 'utils/text'\n\n// Types\nimport { GraphNodeCore } from 'types/graph'\nimport { Spacing } from 'types/spacing'\nimport { Curve } from 'types/curve'\n\n// Local Types\nimport {\n ChordInputNode,\n ChordInputLink,\n ChordDiagramData,\n ChordHierarchyNode,\n ChordNode,\n ChordRibbon,\n ChordLabelAlignment,\n ChordLeafNode,\n ChordRibbonPoint,\n ChordNodeDatum,\n} from './types'\n\n// Config\nimport { ChordDiagramConfig, ChordDiagramConfigInterface } from './config'\n\n// Modules\nimport { createNode, updateNode, removeNode } from './modules/node'\nimport { createLabel, updateLabel, removeLabel, LABEL_PADDING } from './modules/label'\nimport { createLink, updateLink, removeLink } from './modules/link'\n\n// Styles\nimport * as s from './style'\n\nexport class ChordDiagram<\n N extends ChordInputNode,\n L extends ChordInputLink,\n> extends ComponentCore<\n ChordDiagramData<N, L>,\n ChordDiagramConfig<N, L>,\n ChordDiagramConfigInterface<N, L>\n > {\n static selectors = s\n config: ChordDiagramConfig<N, L> = new ChordDiagramConfig()\n datamodel: GraphDataModel<N, L> = new GraphDataModel()\n\n nodeGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n linkGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n labelGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n arcGen = arc<ChordNode<N>>()\n radiusScale: ScalePower<number, number> = scalePow()\n private _nodes: ChordNode<N>[] = []\n private _links: ChordRibbon<N>[] = []\n private _rootNode: ChordNode<N>\n\n events = {\n [ChordDiagram.selectors.node]: {\n mouseover: this._onNodeMouseOver.bind(this),\n mouseout: this._onNodeMouseOut.bind(this),\n },\n [ChordDiagram.selectors.link]: {\n mouseover: this._onLinkMouseOver.bind(this),\n mouseout: this._onLinkMouseOut.bind(this),\n },\n }\n\n constructor (config?: ChordDiagramConfigInterface<N, L>) {\n super()\n if (config) this.config.init(config)\n this.linkGroup = this.g.append('g').attr('class', s.links)\n this.nodeGroup = this.g.append('g').attr('class', s.nodes)\n this.labelGroup = this.g.append('g').attr('class', s.labels)\n }\n\n get bleed (): Spacing {\n const { config } = this\n let top = 0; let bottom = 0; let right = 0; let left = 0\n const padding = 4 + LABEL_PADDING * 2\n this._nodes.forEach(n => {\n const nodeLabelAlignment = getValue(n.data, config.nodeLabelAlignment)\n if (n.height === 0 && nodeLabelAlignment === ChordLabelAlignment.Perpendicular) {\n const labelWidth = estimateStringPixelLength(getString(n.data as N, config.nodeLabel) ?? '', 16)\n const [x, y] = this.arcGen.centroid(n)\n\n if (x < 0) left = Math.max(left, labelWidth)\n else right = Math.max(right, labelWidth)\n\n if (y < 0) top = Math.max(top, labelWidth)\n else bottom = Math.max(bottom, labelWidth)\n }\n })\n left += padding\n right += padding\n bottom += padding\n top += padding\n return { top, bottom, left, right }\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config, config: { radiusScaleExponent }, radiusScale } = this\n const nodes = this._getHierarchyNodes()\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n this.arcGen\n .startAngle(d => d.x0)\n .endAngle(d => d.x1)\n .cornerRadius(d => getNumber(d, config.cornerRadius))\n .innerRadius(d => this.radiusScale(d.y1) - getNumber(d, config.nodeWidth))\n .outerRadius(d => this.radiusScale(d.y1))\n\n const linkLineGen = line().curve(Curve.catmullRom.alpha(0.25))\n\n const hierarchyData = nodes\n\n const partitionData = partition<N | ChordHierarchyNode<N>>().size([config.angleRange[1], 1])(hierarchyData) as ChordNode<N>\n this._calculateRadialPosition(partitionData)\n\n const size = Math.min(this._width, this._height)\n const radius = size / 2 - max([this.bleed.top, this.bleed.bottom, this.bleed.left, this.bleed.right])\n const labelWidth = size - radius - config.nodeWidth\n\n radiusScale\n .exponent(radiusScaleExponent)\n .range([0, radius])\n\n const partitionDataWithRoot = partitionData.descendants()\n this._rootNode = partitionDataWithRoot.find(d => d.depth === 0)\n this._nodes = partitionDataWithRoot.filter(d => d.depth !== 0) // Filter out the root node\n this._links = this._getRibbons(partitionData)\n\n // Create Node and Link state objects\n this._nodes.forEach((node, i) => {\n // Add hierarchy data for non leaf nodes\n if (node.children) {\n node.data = Object.assign(node.data, {\n depth: node.depth,\n height: node.height,\n value: node.value,\n ancestors: node.ancestors().map(d => (d.data as ChordHierarchyNode<N>).key),\n })\n }\n node.x0 = Number.isNaN(node.x0) ? 0 : node.x0\n node.x1 = Number.isNaN(node.x1) ? 0 : node.x1\n node.uid = `${this.uid}-n${i}`\n node._state = {}\n })\n this._links.forEach(link => { link._state = {} })\n\n // Center the view\n this.g.attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n\n // Links\n const linksSelection = this.linkGroup\n .selectAll<SVGPathElement, ChordRibbon<N>>(`.${s.link}`)\n .data(this._links, d => String(d.data._id))\n\n const linksEnter = linksSelection.enter().append('path')\n .attr('class', s.link)\n .call(createLink, linkLineGen)\n\n const linksMerged = linksSelection.merge(linksEnter)\n linksMerged.call(updateLink, config, linkLineGen, duration)\n\n linksSelection.exit()\n .call(removeLink, duration)\n\n // Nodes\n const nodesSelection = this.nodeGroup\n .selectAll<SVGPathElement, ChordNode<N>>(`.${s.node}`)\n .data(this._nodes, d => String(d.uid))\n\n const nodesEnter = nodesSelection.enter().append('path')\n .attr('class', s.node)\n .call(createNode, config)\n\n const nodesMerged = nodesSelection.merge(nodesEnter)\n nodesMerged.call(updateNode, config, this.arcGen, duration)\n\n nodesSelection.exit()\n .call(removeNode, duration)\n\n // Labels\n const labels = this.labelGroup\n .selectAll<SVGGElement, ChordNode<N>>(`.${s.gLabel}`)\n .data(this._nodes, d => String(d.uid))\n\n const labelEnter = labels.enter().append('g')\n .attr('class', s.gLabel)\n .call(createLabel, config, radiusScale)\n\n const labelsMerged = labels.merge(labelEnter)\n labelsMerged.call(updateLabel, config, labelWidth, radiusScale, duration)\n\n labels.exit()\n .attr('class', s.labelExit)\n .call(removeLabel, duration)\n }\n\n private _getHierarchyNodes (): HierarchyNode<ChordNodeDatum<N>> {\n const { config, datamodel: { nodes, links } } = this\n nodes.forEach(n => { delete n._state.value })\n links.forEach(l => {\n delete l._state.points\n l.source._state.value = (l.source._state.value || 0) + getNumber(l, config.linkValue)\n l.target._state.value = (l.target._state.value || 0) + getNumber(l, config.linkValue)\n })\n\n // TODO: Replace with d3-group\n const nestGen = nest<N>()\n config.nodeLevels.forEach(levelAccessor => {\n nestGen.key(d => d[levelAccessor])\n })\n const root = { key: 'root', values: nestGen.entries(nodes) }\n const hierarchyNodes = hierarchy(root, d => d.values)\n .sum((d) => (d as unknown as GraphNodeCore<N, L>)._state?.value)\n\n return hierarchyNodes\n }\n\n private _getRibbons (partitionData: ChordNode<N>): ChordRibbon<N>[] {\n const { config, datamodel: { links } } = this\n const findNode = (\n nodes: ChordLeafNode<N>[],\n id: string\n ): ChordLeafNode<N> => nodes.find(n => n.data._id === id)\n const leafNodes = partitionData.leaves() as ChordLeafNode<N>[]\n\n type LinksArrayType = typeof links\n const groupedBySource: Record<string, LinksArrayType> = groupBy(links, d => d.source._id)\n const groupedByTarget: Record<string, LinksArrayType> = groupBy(links, d => d.target._id)\n\n const getNodesInRibbon = (\n source: ChordLeafNode<N>,\n target: ChordLeafNode<N>,\n partitionHeight: number,\n nodes: ChordLeafNode<N>[] = []\n ): ChordNode<N>[] => {\n nodes[source.height] = source\n nodes[partitionHeight * 2 - target.height] = target\n if (source.parent && target.parent) getNodesInRibbon(source.parent, target.parent, partitionHeight, nodes)\n return nodes\n }\n\n const calculatePoints = (\n links: LinksArrayType,\n type: 'in' | 'out',\n depth: number\n ): void => {\n links.forEach(link => {\n if (!link._state.points) link._state.points = []\n const sourceLeaf = findNode(leafNodes, link.source._id)\n const targetLeaf = findNode(leafNodes, link.target._id)\n const nodesInRibbon = getNodesInRibbon(\n type === 'out' ? sourceLeaf : targetLeaf,\n type === 'out' ? targetLeaf : sourceLeaf,\n partitionData.height)\n const currNode = nodesInRibbon[depth]\n const len = currNode.x1 - currNode.x0\n const x0 = currNode._prevX1 ?? currNode.x0\n const x1 = x0 + len * getNumber(link, config.linkValue) / currNode.value\n currNode._prevX1 = x1\n\n const pointIdx = type === 'out' ? depth : partitionData.height * 2 - 1 - depth\n link._state.points[pointIdx] = this._convertRadialToCartesian(\n Math.min(x0, x1),\n Math.max(x0, x1),\n currNode.y1,\n config.nodeWidth\n )\n })\n }\n\n leafNodes.forEach(leafNode => {\n const outLinks = groupedBySource[leafNode.data._id] || []\n const inLinks = groupedByTarget[leafNode.data._id] || []\n for (let depth = 0; depth < partitionData.height; depth += 1) {\n calculatePoints(outLinks, 'out', depth)\n calculatePoints(inLinks, 'in', depth)\n }\n })\n\n const ribbons = links.map(l => {\n const sourceNode = findNode(leafNodes, l.source._id)\n const targetNode = findNode(leafNodes, l.target._id)\n\n return {\n source: sourceNode,\n target: targetNode,\n data: l,\n points: l._state.points,\n _state: {},\n }\n })\n\n return ribbons\n }\n\n private _convertRadialToCartesian (x0: number, x1: number, y: number, nodeWidth: number): ChordRibbonPoint {\n const r = Math.max(this.radiusScale(y) - nodeWidth, 0)\n const a0 = x0 - Math.PI / 2\n const a1 = x1 - Math.PI / 2\n\n return {\n a0,\n a1,\n r,\n x0: r * Math.cos(a0),\n x1: r * Math.cos(a1),\n y0: r * Math.sin(a0),\n y1: r * Math.sin(a1),\n }\n }\n\n private _calculateRadialPosition (\n hierarchyNode: ChordNode<N>,\n scalingCoeff = 0.95,\n nodePadding = 0.02\n ): void {\n if (!hierarchyNode.children) return\n\n // Calculate x0 and x1\n const nodeLength = (hierarchyNode.x1 - hierarchyNode.x0)\n const scaledNodeLength = nodeLength * scalingCoeff\n const delta = nodeLength - scaledNodeLength\n let x0 = hierarchyNode.x0 + delta / 2\n for (const node of hierarchyNode.children) {\n const childX0 = x0\n const childX1 = x0 + (node.value / hierarchyNode.value) * scaledNodeLength - nodePadding / 2\n const childNodeLength = childX1 - childX0\n const scaledChildNodeLength = childNodeLength * scalingCoeff\n const childDelta = childNodeLength - scaledChildNodeLength\n node.x0 = childX0 + childDelta / 2\n node.x1 = node.x0 + scaledChildNodeLength\n x0 = childX1 + nodePadding / 2 + childDelta / 2\n }\n // Go deeper in the hierarchy\n for (const node of hierarchyNode.children) {\n this._calculateRadialPosition(node, scalingCoeff, nodePadding)\n }\n }\n\n private _onNodeMouseOver (d: ChordNode<N>): void {\n let ribbons: ChordRibbon<N>[]\n if (d.children) {\n const leaves = d.leaves() as ChordLeafNode<N>[]\n ribbons = this._links.filter(l =>\n leaves.find(leaf => l.source.data.id === leaf.data.id || l.target.data.id === leaf.data.id)\n )\n } else {\n const leaf = d as ChordLeafNode<N>\n ribbons = this._links.filter(l => l.source.data.id === leaf.data.id || l.target.data.id === leaf.data.id)\n }\n this._highlightOnHover(ribbons)\n }\n\n private _onNodeMouseOut (): void {\n this._highlightOnHover()\n }\n\n private _onLinkMouseOver (d: ChordRibbon<N>): void {\n this._highlightOnHover([d])\n }\n\n private _onLinkMouseOut (): void {\n this._highlightOnHover()\n }\n\n private _highlightOnHover (links?: ChordRibbon<N>[]): void {\n if (links) {\n links.forEach(l => {\n l._state.hovered = true\n const sourcePath = (l.source as ChordNode<N>).path(this._rootNode)\n const targetPath = (l.target as ChordNode<N>).path(this._rootNode)\n sourcePath.forEach(n => { if (n.depth) n._state.hovered = true })\n targetPath.forEach(n => { if (n.depth) n._state.hovered = true })\n })\n } else {\n this._nodes.forEach(n => { delete n._state.hovered })\n this._links.forEach(l => { delete l._state.hovered })\n }\n\n this.nodeGroup.selectAll<SVGPathElement, ChordNode<N>>(`.${s.node}`)\n .classed(s.hoveredNode, d => d._state.hovered)\n this.linkGroup.selectAll<SVGPathElement, ChordRibbon<N>>(`.${s.link}`)\n .classed(s.hoveredLink, d => d._state.hovered)\n\n this.g.classed(s.transparent, !!links)\n }\n}\n"],"names":["s.links","s.nodes","s.labels","s.link","s.node","s.gLabel","s.labelExit","s.hoveredNode","s.hoveredLink","s.transparent","s"],"mappings":";;;;;;;;;;;;;;;;;;AA6CM,MAAO,YAGX,SAAQ,aAIP,CAAA;AAyBD,IAAA,WAAA,CAAa,MAA0C,EAAA;AACrD,QAAA,KAAK,EAAE,CAAA;AAxBT,QAAA,IAAA,CAAA,MAAM,GAA6B,IAAI,kBAAkB,EAAE,CAAA;AAC3D,QAAA,IAAA,CAAA,SAAS,GAAyB,IAAI,cAAc,EAAE,CAAA;QAKtD,IAAM,CAAA,MAAA,GAAG,GAAG,EAAgB,CAAA;QAC5B,IAAW,CAAA,WAAA,GAA+B,QAAQ,EAAE,CAAA;QAC5C,IAAM,CAAA,MAAA,GAAmB,EAAE,CAAA;QAC3B,IAAM,CAAA,MAAA,GAAqB,EAAE,CAAA;AAGrC,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,GAAG;gBAC7B,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC3C,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;AAC1C,aA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AACL,YAAA,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAG,EAAG,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAA,EAAE,CAAC,CAAA;AACrD,YAAA,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAG,EAAG,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAA,EAAE,CAAC,CAAA;AACtD,SAAA;QAED,IAAI,CAAC,SAAS,CAAC,SAAS,CAA+B,IAAIF,IAAM,CAAA,CAAE,CAAC;AACjE,aAAA,OAAO,CAACG,WAAa,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAChD,IAAI,CAAC,SAAS,CAAC,SAAS,CAAiC,IAAIJ,IAAM,CAAA,CAAE,CAAC;AACnE,aAAA,OAAO,CAACK,WAAa,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AAEhD,QAAA,IAAI,CAAC,CAAC,CAAC,OAAO,CAACC,WAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAA;KACvC;;AA1VM,YAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Selection } from 'd3-selection';
|
|
2
|
-
import { ScaleContinuousNumeric } from 'd3-scale';
|
|
3
|
-
import { ChordDiagramConfig } from '../config';
|
|
4
|
-
import { ChordInputLink, ChordInputNode, ChordNode } from '../types';
|
|
5
|
-
export declare const LABEL_PADDING = 3;
|
|
6
|
-
export declare function createLabel<N extends ChordInputNode, L extends ChordInputLink>(selection: Selection<SVGGElement, ChordNode<N>, SVGGElement, unknown>, config: ChordDiagramConfig<N, L>, radiusScale: ScaleContinuousNumeric<number, number>): void;
|
|
7
|
-
export declare function updateLabel<N extends ChordInputNode, L extends ChordInputLink>(selection: Selection<SVGGElement, ChordNode<N>, SVGGElement, unknown>, config: ChordDiagramConfig<N, L>, width: number, radiusScale: ScaleContinuousNumeric<number, number>, duration: number): void;
|
|
8
|
-
export declare function removeLabel(selection: Selection<SVGGElement, unknown, SVGGElement, unknown>, duration: number): void;
|