@unovis/ts 1.1.1-beta.5 → 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 -46
- 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 -417
- package/utils/text.js.map +0 -1
- package/utils/type.d.ts +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/components/leaflet-map/types.ts"],"sourcesContent":["import { LatLng } from 'leaflet'\nimport Supercluster, { ClusterProperties } from 'supercluster'\nimport { GenericDataRecord } from 'types/data'\n\nexport enum LeafletMapRenderer {\n Raster = 'raster',\n MapLibre = 'maplibre',\n}\n\nexport enum LeafletMapPointShape {\n Square = 'square',\n Circle = 'circle',\n Triangle = 'triangle',\n Ring = 'ring',\n}\n\nexport type LeafletMapPieDatum = {\n value: number;\n name: string;\n color: string;\n className?: string;\n}\n\nexport interface LeafletMapPointStyle {\n color: string;\n className?: string;\n}\n\nexport type LeafletMapPointStyles<D> = { [key in keyof D]?: LeafletMapPointStyle }\n\nexport type PointExpandedClusterProperties<D extends GenericDataRecord> = D & {\n // Expanded cluster related data:\n // eslint-disable-next-line no-use-before-define\n expandedClusterPoint?: LeafletMapPoint<D>;\n r?: number;\n dx?: number;\n dy?: number;\n}\n\nexport type LeafletMapClusterDatum<D extends GenericDataRecord> = Partial<D> & ClusterProperties & {\n clusterIndex?: Supercluster<D>;\n clusterPoints?: D[];\n}\n\nexport type LeafletMapPointDatum<D extends GenericDataRecord> = D & PointExpandedClusterProperties<D> & {\n id: string | number;\n shape: LeafletMapPointShape;\n};\n\nexport type LeafletMapPoint<D extends GenericDataRecord> = {\n geometry: GeoJSON.Point;\n bbox: { x1: number; x2: number; y1: number; y2: number };\n radius: number;\n path: string;\n color: string;\n id: number | string;\n properties: LeafletMapPointDatum<D> | LeafletMapClusterDatum<D>;\n donutData: LeafletMapPieDatum[];\n isCluster: boolean;\n clusterIndex: Supercluster<D, Supercluster.AnyProps>;\n clusterPoints?: D[];\n _zIndex: number;\n}\n\nexport type Bounds = {\n northEast: { lat: number; lng: number };\n southWest: { lat: number; lng: number };\n}\n\nexport type MapZoomState = {\n mapCenter: LatLng;\n zoomLevel: number;\n bounds: Bounds;\n userDriven: boolean;\n}\n"],"names":[],"mappings":"IAIY,mBAGX;AAHD,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAG7B,EAAA,CAAA,CAAA,CAAA;IAEW,qBAKX;AALD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,oBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrB,IAAA,oBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EALW,oBAAoB,KAApB,oBAAoB,GAK/B,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { XYComponentConfigInterface, XYComponentConfig } from "../../core/xy-component/config";
|
|
2
|
-
import { CurveType } from "../../types/curve";
|
|
3
|
-
import { GenericAccessor, StringAccessor } from "../../types/accessor";
|
|
4
|
-
export interface LineConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {
|
|
5
|
-
/** Curve type from the CurveType enum. Default: `CurveType.MonotoneX` */
|
|
6
|
-
curveType?: CurveType;
|
|
7
|
-
/** Line width in pixels. Default: `2` */
|
|
8
|
-
lineWidth?: number;
|
|
9
|
-
/** Line dash array, see SVG's stroke-dasharray. Default: `undefined` */
|
|
10
|
-
lineDashArray?: GenericAccessor<number[], Datum>;
|
|
11
|
-
/** When a data point has an `undefined`, `NaN`, or other no-data value, they'll be replaced with a value specified here.
|
|
12
|
-
* Setting this property to `undefined` will lead to having the line break when there's no data, and continue when
|
|
13
|
-
* the data appears again. If you set it to `null`, the values will be treated as numerical `0` values and the line
|
|
14
|
-
* won't break; however if the whole dataset consists of only `null`s, the line won't be displayed.
|
|
15
|
-
* Default: `undefined`
|
|
16
|
-
*/
|
|
17
|
-
fallbackValue?: number | undefined | null;
|
|
18
|
-
/** Highlight line on hover. Default: `false` */
|
|
19
|
-
highlightOnHover?: boolean;
|
|
20
|
-
/** Optional link cursor. Default: `null` */
|
|
21
|
-
cursor?: StringAccessor<Datum[]>;
|
|
22
|
-
}
|
|
23
|
-
export declare class LineConfig<Datum> extends XYComponentConfig<Datum> implements LineConfigInterface<Datum> {
|
|
24
|
-
curveType: CurveType;
|
|
25
|
-
lineWidth: number;
|
|
26
|
-
lineDashArray: any;
|
|
27
|
-
fallbackValue: any;
|
|
28
|
-
highlightOnHover: boolean;
|
|
29
|
-
cursor: any;
|
|
30
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { XYComponentConfig } from '../../core/xy-component/config.js';
|
|
2
|
-
import { CurveType } from '../../types/curve.js';
|
|
3
|
-
|
|
4
|
-
class LineConfig extends XYComponentConfig {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.curveType = CurveType.MonotoneX;
|
|
8
|
-
this.lineWidth = 2;
|
|
9
|
-
this.lineDashArray = undefined;
|
|
10
|
-
this.fallbackValue = undefined;
|
|
11
|
-
this.highlightOnHover = false;
|
|
12
|
-
this.cursor = null;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { LineConfig };
|
|
17
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/line/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentConfig } from 'core/xy-component/config'\n\n// Types\nimport { CurveType } from 'types/curve'\nimport { GenericAccessor, StringAccessor } from 'types/accessor'\n\nexport interface LineConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {\n /** Curve type from the CurveType enum. Default: `CurveType.MonotoneX` */\n curveType?: CurveType;\n /** Line width in pixels. Default: `2` */\n lineWidth?: number;\n /** Line dash array, see SVG's stroke-dasharray. Default: `undefined` */\n lineDashArray?: GenericAccessor<number[], Datum>;\n /** When a data point has an `undefined`, `NaN`, or other no-data value, they'll be replaced with a value specified here.\n * Setting this property to `undefined` will lead to having the line break when there's no data, and continue when\n * the data appears again. If you set it to `null`, the values will be treated as numerical `0` values and the line\n * won't break; however if the whole dataset consists of only `null`s, the line won't be displayed.\n * Default: `undefined`\n */\n fallbackValue?: number | undefined | null;\n /** Highlight line on hover. Default: `false` */\n highlightOnHover?: boolean;\n /** Optional link cursor. Default: `null` */\n cursor?: StringAccessor<Datum[]>;\n}\n\nexport class LineConfig<Datum> extends XYComponentConfig<Datum> implements LineConfigInterface<Datum> {\n curveType = CurveType.MonotoneX\n lineWidth = 2\n lineDashArray = undefined\n fallbackValue = undefined\n highlightOnHover = false\n cursor = null\n}\n"],"names":[],"mappings":";;;AA0BM,MAAO,UAAkB,SAAQ,iBAAwB,CAAA;AAA/D,IAAA,WAAA,GAAA;;AACE,QAAA,IAAA,CAAA,SAAS,GAAG,SAAS,CAAC,SAAS,CAAA;QAC/B,IAAS,CAAA,SAAA,GAAG,CAAC,CAAA;QACb,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAgB,CAAA,gBAAA,GAAG,KAAK,CAAA;QACxB,IAAM,CAAA,MAAA,GAAG,IAAI,CAAA;KACd;AAAA;;;;"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { CurveFactoryLineOnly, Line as LineGenInterface } from 'd3-shape';
|
|
2
|
-
import { XYComponentCore } from "../../core/xy-component";
|
|
3
|
-
import { Spacing } from "../../types/spacing";
|
|
4
|
-
import { LineConfig, LineConfigInterface } from './config';
|
|
5
|
-
import * as s from './style';
|
|
6
|
-
export declare class Line<Datum> extends XYComponentCore<Datum, LineConfig<Datum>, LineConfigInterface<Datum>> {
|
|
7
|
-
static selectors: typeof s;
|
|
8
|
-
config: LineConfig<Datum>;
|
|
9
|
-
lineGen: LineGenInterface<{
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
defined: boolean;
|
|
13
|
-
}>;
|
|
14
|
-
curve: CurveFactoryLineOnly;
|
|
15
|
-
events: {
|
|
16
|
-
[x: string]: {
|
|
17
|
-
mouseover: (datum: any, i: any, els: any) => void;
|
|
18
|
-
mouseleave: (d: any, i: any, els: any) => void;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
constructor(config?: LineConfigInterface<Datum>);
|
|
22
|
-
get bleed(): Spacing;
|
|
23
|
-
_render(customDuration?: number): void;
|
|
24
|
-
private _emptyPath;
|
|
25
|
-
private _highlight;
|
|
26
|
-
private _resetHighlight;
|
|
27
|
-
}
|
package/components/line/index.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { select } from 'd3-selection';
|
|
2
|
-
import { line } from 'd3-shape';
|
|
3
|
-
import { interpolatePath } from 'd3-interpolate-path';
|
|
4
|
-
import { XYComponentCore } from '../../core/xy-component/index.js';
|
|
5
|
-
import { isNumber, isArray, getNumber, getString, getValue } from '../../utils/data.js';
|
|
6
|
-
import { smartTransition } from '../../utils/d3.js';
|
|
7
|
-
import { getColor } from '../../utils/color.js';
|
|
8
|
-
import { Curve, CurveType } from '../../types/curve.js';
|
|
9
|
-
import { Direction } from '../../types/direction.js';
|
|
10
|
-
import { LineConfig } from './config.js';
|
|
11
|
-
import * as style from './style.js';
|
|
12
|
-
import { line as line$1, linePath, lineSelectionHelper, dim } from './style.js';
|
|
13
|
-
|
|
14
|
-
class Line extends XYComponentCore {
|
|
15
|
-
constructor(config) {
|
|
16
|
-
super();
|
|
17
|
-
this.config = new LineConfig();
|
|
18
|
-
this.curve = Curve[CurveType.MonotoneX];
|
|
19
|
-
this.events = {
|
|
20
|
-
[Line.selectors.line]: {
|
|
21
|
-
mouseover: this._highlight.bind(this),
|
|
22
|
-
mouseleave: this._resetHighlight.bind(this),
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
if (config)
|
|
26
|
-
this.config.init(config);
|
|
27
|
-
}
|
|
28
|
-
get bleed() {
|
|
29
|
-
const { config: { lineWidth } } = this;
|
|
30
|
-
const yDomain = this.yScale.domain();
|
|
31
|
-
const yDirection = this.yScale.range()[0] > this.yScale.range()[1]
|
|
32
|
-
? Direction.North
|
|
33
|
-
: Direction.South;
|
|
34
|
-
const isYDirectionSouth = yDirection === Direction.South;
|
|
35
|
-
const isLineThick = lineWidth > 3;
|
|
36
|
-
const isLineVeryThick = lineWidth >= 10;
|
|
37
|
-
return {
|
|
38
|
-
top: !isLineVeryThick && ((!isYDirectionSouth && (yDomain[1] === 0)) || (isYDirectionSouth && (yDomain[0] === 0))) ? 0 : lineWidth / 2,
|
|
39
|
-
bottom: !isLineVeryThick && ((!isYDirectionSouth && (yDomain[0] === 0)) || (isYDirectionSouth && (yDomain[1] === 0))) ? 0 : lineWidth / 2,
|
|
40
|
-
left: isLineThick ? lineWidth / 2 : 0,
|
|
41
|
-
right: isLineThick ? lineWidth / 2 : 0,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
_render(customDuration) {
|
|
45
|
-
super._render(customDuration);
|
|
46
|
-
const { config, datamodel: { data } } = this;
|
|
47
|
-
const duration = isNumber(customDuration) ? customDuration : config.duration;
|
|
48
|
-
this.curve = Curve[config.curveType];
|
|
49
|
-
this.lineGen = line()
|
|
50
|
-
.x(d => d.x)
|
|
51
|
-
.y(d => d.y)
|
|
52
|
-
.defined(d => d.defined)
|
|
53
|
-
.curve(this.curve);
|
|
54
|
-
const yAccessors = (isArray(config.y) ? config.y : [config.y]);
|
|
55
|
-
const lineDataX = data.map((d, i) => this.xScale(getNumber(d, config.x, i)));
|
|
56
|
-
const lineData = yAccessors.map(a => {
|
|
57
|
-
const ld = data.map((d, i) => {
|
|
58
|
-
const rawValue = getNumber(d, a, i);
|
|
59
|
-
// If `rawValue` is not numerical or if it's not finite (`NaN`, `undefined`, ...), we replace it with `config.fallbackValue`
|
|
60
|
-
const value = (isNumber(rawValue) || (rawValue === null)) && isFinite(rawValue) ? rawValue : config.fallbackValue;
|
|
61
|
-
return {
|
|
62
|
-
x: lineDataX[i],
|
|
63
|
-
y: this.yScale(value !== null && value !== void 0 ? value : 0),
|
|
64
|
-
defined: isFinite(value),
|
|
65
|
-
value,
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
const defined = ld.reduce((def, d) => (d.defined || def), false);
|
|
69
|
-
// If the line consists only of `null` values, we'll still render it but it'll be invisible.
|
|
70
|
-
// Such trick allows us to have better animated transitions.
|
|
71
|
-
const visible = defined && ld.some(d => d.value !== null);
|
|
72
|
-
return {
|
|
73
|
-
values: ld,
|
|
74
|
-
defined,
|
|
75
|
-
visible,
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
const lines = this.g
|
|
79
|
-
.selectAll(`.${line$1}`)
|
|
80
|
-
.data(lineData);
|
|
81
|
-
const linesEnter = lines.enter().append('g')
|
|
82
|
-
.attr('class', line$1);
|
|
83
|
-
linesEnter
|
|
84
|
-
.append('path')
|
|
85
|
-
.attr('class', linePath)
|
|
86
|
-
.attr('d', this._emptyPath())
|
|
87
|
-
.attr('stroke', (d, i) => getColor(data, config.color, i))
|
|
88
|
-
.attr('stroke-opacity', 0)
|
|
89
|
-
.attr('stroke-width', config.lineWidth);
|
|
90
|
-
linesEnter
|
|
91
|
-
.append('path')
|
|
92
|
-
.attr('class', lineSelectionHelper)
|
|
93
|
-
.attr('d', this._emptyPath());
|
|
94
|
-
const linesMerged = linesEnter.merge(lines);
|
|
95
|
-
linesMerged.style('cursor', (d, i) => getString(data, config.cursor, i));
|
|
96
|
-
linesMerged.each((d, i, elements) => {
|
|
97
|
-
var _a;
|
|
98
|
-
const group = select(elements[i]);
|
|
99
|
-
const linePath$1 = group.select(`.${linePath}`);
|
|
100
|
-
const lineSelectionHelper$1 = group.select(`.${lineSelectionHelper}`);
|
|
101
|
-
const isLineVisible = d.visible;
|
|
102
|
-
const dashArray = getValue(d, config.lineDashArray, i);
|
|
103
|
-
const transition = smartTransition(linePath$1, duration)
|
|
104
|
-
.attr('stroke', getColor(data, config.color, i))
|
|
105
|
-
.attr('stroke-width', config.lineWidth)
|
|
106
|
-
.attr('stroke-opacity', isLineVisible ? 1 : 0)
|
|
107
|
-
.style('stroke-dasharray', (_a = dashArray === null || dashArray === void 0 ? void 0 : dashArray.join(' ')) !== null && _a !== void 0 ? _a : null); // We use `.style` because there's also a default CSS-variable for stroke-dasharray
|
|
108
|
-
const hasUndefinedSegments = d.values.some(d => !d.defined);
|
|
109
|
-
const svgPathD = this.lineGen(d.values);
|
|
110
|
-
if (duration && !hasUndefinedSegments) {
|
|
111
|
-
const previous = linePath$1.attr('d') || this._emptyPath();
|
|
112
|
-
const next = svgPathD || this._emptyPath();
|
|
113
|
-
const t = transition;
|
|
114
|
-
t.attrTween('d', () => interpolatePath(previous, next));
|
|
115
|
-
}
|
|
116
|
-
else if (d.visible) {
|
|
117
|
-
transition.attr('d', svgPathD);
|
|
118
|
-
}
|
|
119
|
-
lineSelectionHelper$1
|
|
120
|
-
.attr('d', svgPathD)
|
|
121
|
-
.attr('visibility', isLineVisible ? null : 'hidden');
|
|
122
|
-
});
|
|
123
|
-
smartTransition(lines.exit(), duration)
|
|
124
|
-
.style('opacity', 0)
|
|
125
|
-
.remove();
|
|
126
|
-
}
|
|
127
|
-
_emptyPath() {
|
|
128
|
-
const xRange = this.xScale.range();
|
|
129
|
-
const yRange = this.yScale.range();
|
|
130
|
-
return `M${xRange[0]},${yRange[0]} L${xRange[1]},${yRange[0]}`;
|
|
131
|
-
}
|
|
132
|
-
_highlight(datum, i, els) {
|
|
133
|
-
const { config } = this;
|
|
134
|
-
if (config.highlightOnHover) {
|
|
135
|
-
this.g
|
|
136
|
-
.selectAll(`.${line$1}`)
|
|
137
|
-
.classed(dim, d => d !== datum);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
_resetHighlight(d, i, els) {
|
|
141
|
-
const { config } = this;
|
|
142
|
-
if (config.highlightOnHover) {
|
|
143
|
-
this.g
|
|
144
|
-
.selectAll(`.${line$1}`)
|
|
145
|
-
.classed(dim, false);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
Line.selectors = style;
|
|
150
|
-
|
|
151
|
-
export { Line };
|
|
152
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/line/index.ts"],"sourcesContent":["import { select } from 'd3-selection'\nimport { Transition } from 'd3-transition'\nimport { CurveFactoryLineOnly, Line as LineGenInterface, line } from 'd3-shape'\nimport { interpolatePath } from 'd3-interpolate-path'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { getNumber, getString, getValue, isArray, isNumber } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { getColor } from 'utils/color'\n\n// Types\nimport { NumericAccessor } from 'types/accessor'\nimport { Spacing } from 'types/spacing'\nimport { Curve, CurveType } from 'types/curve'\nimport { Direction } from 'types/direction'\n\n// Local Types\nimport { LineData, LineDatum } from './types'\n\n// Config\nimport { LineConfig, LineConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Line<Datum> extends XYComponentCore<Datum, LineConfig<Datum>, LineConfigInterface<Datum>> {\n static selectors = s\n config: LineConfig<Datum> = new LineConfig()\n lineGen: LineGenInterface<{ x: number; y: number; defined: boolean }>\n curve: CurveFactoryLineOnly = Curve[CurveType.MonotoneX]\n events = {\n [Line.selectors.line]: {\n mouseover: this._highlight.bind(this),\n mouseleave: this._resetHighlight.bind(this),\n },\n }\n\n constructor (config?: LineConfigInterface<Datum>) {\n super()\n if (config) this.config.init(config)\n }\n\n get bleed (): Spacing {\n const { config: { lineWidth } } = this\n const yDomain = this.yScale.domain() as [number, number]\n const yDirection = this.yScale.range()[0] > this.yScale.range()[1]\n ? Direction.North\n : Direction.South\n const isYDirectionSouth = yDirection === Direction.South\n\n const isLineThick = lineWidth > 3\n const isLineVeryThick = lineWidth >= 10\n return {\n top: !isLineVeryThick && (\n (!isYDirectionSouth && (yDomain[1] === 0)) || (isYDirectionSouth && (yDomain[0] === 0))\n ) ? 0 : lineWidth / 2,\n bottom: !isLineVeryThick && (\n (!isYDirectionSouth && (yDomain[0] === 0)) || (isYDirectionSouth && (yDomain[1] === 0))\n ) ? 0 : lineWidth / 2,\n left: isLineThick ? lineWidth / 2 : 0,\n right: isLineThick ? lineWidth / 2 : 0,\n }\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config, datamodel: { data } } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n this.curve = Curve[config.curveType]\n this.lineGen = line<{ x: number; y: number; defined: boolean }>()\n .x(d => d.x)\n .y(d => d.y)\n .defined(d => d.defined)\n .curve(this.curve)\n\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n const lineDataX = data.map((d, i) => this.xScale(getNumber(d, config.x, i)))\n const lineData: LineData[] = yAccessors.map(a => {\n const ld: LineDatum[] = data.map((d, i) => {\n const rawValue = getNumber(d, a, i)\n // If `rawValue` is not numerical or if it's not finite (`NaN`, `undefined`, ...), we replace it with `config.fallbackValue`\n const value = (isNumber(rawValue) || (rawValue === null)) && isFinite(rawValue) ? rawValue : config.fallbackValue\n return {\n x: lineDataX[i],\n y: this.yScale(value ?? 0),\n defined: isFinite(value),\n value,\n }\n })\n\n const defined = ld.reduce((def, d) => (d.defined || def), false)\n // If the line consists only of `null` values, we'll still render it but it'll be invisible.\n // Such trick allows us to have better animated transitions.\n const visible = defined && ld.some(d => d.value !== null)\n return {\n values: ld,\n defined,\n visible,\n }\n })\n\n const lines = this.g\n .selectAll<SVGGElement, LineData>(`.${s.line}`)\n .data(lineData)\n\n const linesEnter = lines.enter().append('g')\n .attr('class', s.line)\n\n linesEnter\n .append('path')\n .attr('class', s.linePath)\n .attr('d', this._emptyPath())\n .attr('stroke', (d, i) => getColor(data, config.color, i))\n .attr('stroke-opacity', 0)\n .attr('stroke-width', config.lineWidth)\n\n linesEnter\n .append('path')\n .attr('class', s.lineSelectionHelper)\n .attr('d', this._emptyPath())\n\n const linesMerged = linesEnter.merge(lines)\n linesMerged.style('cursor', (d, i) => getString(data, config.cursor, i))\n linesMerged.each((d, i, elements) => {\n const group = select(elements[i])\n const linePath = group.select<SVGPathElement>(`.${s.linePath}`)\n const lineSelectionHelper = group.select(`.${s.lineSelectionHelper}`)\n\n const isLineVisible = d.visible\n const dashArray = getValue<LineData, number[]>(d, config.lineDashArray, i)\n const transition = smartTransition(linePath, duration)\n .attr('stroke', getColor(data, config.color, i))\n .attr('stroke-width', config.lineWidth)\n .attr('stroke-opacity', isLineVisible ? 1 : 0)\n .style('stroke-dasharray', dashArray?.join(' ') ?? null) // We use `.style` because there's also a default CSS-variable for stroke-dasharray\n\n const hasUndefinedSegments = d.values.some(d => !d.defined)\n const svgPathD = this.lineGen(d.values)\n\n if (duration && !hasUndefinedSegments) {\n const previous = linePath.attr('d') || this._emptyPath()\n const next = svgPathD || this._emptyPath()\n const t = transition as Transition<SVGPathElement, LineData, SVGGElement, LineData>\n t.attrTween('d', () => interpolatePath(previous, next))\n } else if (d.visible) {\n transition.attr('d', svgPathD)\n }\n\n lineSelectionHelper\n .attr('d', svgPathD)\n .attr('visibility', isLineVisible ? null : 'hidden')\n })\n\n smartTransition(lines.exit(), duration)\n .style('opacity', 0)\n .remove()\n }\n\n private _emptyPath (): string {\n const xRange = this.xScale.range()\n const yRange = this.yScale.range()\n return `M${xRange[0]},${yRange[0]} L${xRange[1]},${yRange[0]}`\n }\n\n private _highlight (datum, i, els): void {\n const { config } = this\n\n if (config.highlightOnHover) {\n this.g\n .selectAll(`.${s.line}`)\n .classed(s.dim, d => d !== datum)\n }\n }\n\n private _resetHighlight (d, i, els): void {\n const { config } = this\n\n if (config.highlightOnHover) {\n this.g\n .selectAll(`.${s.line}`)\n .classed(s.dim, false)\n }\n }\n}\n"],"names":["s.line","s.linePath","s.lineSelectionHelper","linePath","lineSelectionHelper","s.dim","s"],"mappings":";;;;;;;;;;;;;AA4BM,MAAO,IAAY,SAAQ,eAAqE,CAAA;AAYpG,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;AAXT,QAAA,IAAA,CAAA,MAAM,GAAsB,IAAI,UAAU,EAAE,CAAA;AAE5C,QAAA,IAAA,CAAA,KAAK,GAAyB,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;AACxD,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG;gBACrB,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;gBACrC,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;AAC5C,aAAA;SACF,CAAA;AAIC,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KACrC;AAED,IAAA,IAAI,KAAK,GAAA;QACP,M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'@emotion/css'\n\nexport const globalStyles = injectGlobal`\n :root {\n --vis-line-cursor: default;\n --vis-line-stroke-dasharray: none;\n --vis-line-stroke-dashoffset: 0;\n }\n`\n\nexport const root = css`\n label: line-component;\n`\n\nexport const line = css`\n label: line;\n transition: opacity 200ms;\n cursor: var(--vis-line-cursor);\n`\n\nexport const linePath = css`\n label: linePath;\n fill: none;\n stroke-dasharray: var(--vis-line-stroke-dasharray);\n stroke-dashoffset: var(--vis-line-stroke-dashoffset);\n`\n\nexport const lineSelectionHelper = css`\n label: lineSelectionHelper;\n fill: none;\n stroke: rgba(0, 0, 0, 0);\n stroke-width: 8px;\n`\n\nexport const dim = css`\n opacity: 0.2;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,YAAY,GAAG,YAAY,CAAA,CAAA;;;;;;EAMvC;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;;;EAItB;AAEM,MAAM,QAAQ,GAAG,GAAG,CAAA,CAAA;;;;;EAK1B;AAEM,MAAM,mBAAmB,GAAG,GAAG,CAAA,CAAA;;;;;EAKrC;AAEM,MAAM,GAAG,GAAG,GAAG,CAAA,CAAA;;;;;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** Data type for Line Generator: [x, y, defined] */
|
|
2
|
-
export declare type LineDatum = {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
value: number | null | undefined;
|
|
6
|
-
defined: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare type LineData = {
|
|
9
|
-
values: LineDatum[];
|
|
10
|
-
defined: boolean;
|
|
11
|
-
visible: boolean;
|
|
12
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ComponentConfigInterface, ComponentConfig } from "../../core/component/config";
|
|
2
|
-
import { ColorAccessor, GenericAccessor, StringAccessor } from "../../types/accessor";
|
|
3
|
-
import { NestedDonutDirection, NestedDonutLayerSettings, NestedDonutSegment } from './types';
|
|
4
|
-
export interface NestedDonutConfigInterface<Datum> extends ComponentConfigInterface {
|
|
5
|
-
/** Diagram angle range. Default: `[0, 2 * Math.PI]` */
|
|
6
|
-
angleRange?: [number, number];
|
|
7
|
-
/** Direction of hierarchy flow from root to leaf.
|
|
8
|
-
* `NestedDonutDirection.INWARDS` starts from the outer most radius and works towards center
|
|
9
|
-
* `NestedDonutDirection.OUTWARDS` starts from the inner most radius the consecutive layers outward.
|
|
10
|
-
* Default: `NestedDonutDirection.INWARDS`
|
|
11
|
-
*/
|
|
12
|
-
direction?: NestedDonutDirection | string;
|
|
13
|
-
/** Central label text. Default: `undefined` */
|
|
14
|
-
centralLabel?: string;
|
|
15
|
-
/** Central sub-label accessor function or text. Default: `undefined` */
|
|
16
|
-
centralSubLabel?: string;
|
|
17
|
-
/** Enables wrapping for the sub-label. Default: `true` */
|
|
18
|
-
centralSubLabelWrap?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Show donut background. The color is configurable via
|
|
21
|
-
* the `--vis-nested-donut-background-color` and `--vis-dark-nested-donut-background-color` CSS variables.
|
|
22
|
-
* Default: `true`
|
|
23
|
-
*/
|
|
24
|
-
showBackground?: boolean;
|
|
25
|
-
/** Array of accessor functions to defined the nested groups */
|
|
26
|
-
layers: StringAccessor<Datum>[];
|
|
27
|
-
layerConfig?: GenericAccessor<NestedDonutLayerSettings, string>;
|
|
28
|
-
layerPadding?: number;
|
|
29
|
-
/** Color accessor function. Default: `undefined` */
|
|
30
|
-
color?: ColorAccessor<NestedDonutSegment<Datum>>;
|
|
31
|
-
/** Corner Radius. Default: `0` */
|
|
32
|
-
cornerRadius?: number;
|
|
33
|
-
/** Label accessor function. */
|
|
34
|
-
label?: StringAccessor<NestedDonutSegment<Datum>>;
|
|
35
|
-
/**
|
|
36
|
-
* When true, the component will display empty segments (the ones that have `0` values) as tiny slices.
|
|
37
|
-
* Default: `false`
|
|
38
|
-
* */
|
|
39
|
-
showEmptySegments?: boolean;
|
|
40
|
-
/** Angular size for empty segments in radians. Default: `0.5 * Math.PI / 180` */
|
|
41
|
-
emptySegmentAngle?: number;
|
|
42
|
-
}
|
|
43
|
-
export declare class NestedDonutConfig<Datum> extends ComponentConfig implements NestedDonutConfigInterface<Datum> {
|
|
44
|
-
centralLabel?: string;
|
|
45
|
-
centralSubLabel?: string;
|
|
46
|
-
centralSubLabelWrap?: boolean;
|
|
47
|
-
showEmptySegments?: boolean;
|
|
48
|
-
emptySegmentAngle?: number;
|
|
49
|
-
color?: ColorAccessor<NestedDonutSegment<Datum>>;
|
|
50
|
-
label?: StringAccessor<NestedDonutSegment<Datum>>;
|
|
51
|
-
direction: NestedDonutDirection;
|
|
52
|
-
layers: StringAccessor<Datum>[];
|
|
53
|
-
layerSettings: any;
|
|
54
|
-
layerPadding: number;
|
|
55
|
-
angleRange: [number, number];
|
|
56
|
-
padAngle: number;
|
|
57
|
-
cornerRadius: number;
|
|
58
|
-
showBackground: boolean;
|
|
59
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ComponentConfig } from '../../core/component/config.js';
|
|
2
|
-
import { NestedDonutDirection } from './types.js';
|
|
3
|
-
|
|
4
|
-
// Core
|
|
5
|
-
class NestedDonutConfig extends ComponentConfig {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.direction = NestedDonutDirection.INWARDS;
|
|
9
|
-
this.layerSettings = undefined;
|
|
10
|
-
this.layerPadding = 0;
|
|
11
|
-
this.angleRange = [0, 2 * Math.PI];
|
|
12
|
-
this.padAngle = 0;
|
|
13
|
-
this.cornerRadius = 0;
|
|
14
|
-
this.showBackground = true;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { NestedDonutConfig };
|
|
19
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/nested-donut/config.ts"],"sourcesContent":["// Core\nimport { ComponentConfigInterface, ComponentConfig } from 'core/component/config'\n\n// Types\nimport { ColorAccessor, GenericAccessor, StringAccessor } from 'types/accessor'\nimport { NestedDonutDirection, NestedDonutLayerSettings, NestedDonutSegment } from './types'\n\n\nexport interface NestedDonutConfigInterface<Datum> extends ComponentConfigInterface {\n /** Diagram angle range. Default: `[0, 2 * Math.PI]` */\n angleRange?: [number, number];\n /** Direction of hierarchy flow from root to leaf.\n * `NestedDonutDirection.INWARDS` starts from the outer most radius and works towards center\n * `NestedDonutDirection.OUTWARDS` starts from the inner most radius the consecutive layers outward.\n * Default: `NestedDonutDirection.INWARDS`\n */\n direction?: NestedDonutDirection | string;\n\n /** Central label text. Default: `undefined` */\n centralLabel?: string;\n /** Central sub-label accessor function or text. Default: `undefined` */\n centralSubLabel?: string;\n /** Enables wrapping for the sub-label. Default: `true` */\n centralSubLabelWrap?: boolean;\n /**\n * Show donut background. The color is configurable via\n * the `--vis-nested-donut-background-color` and `--vis-dark-nested-donut-background-color` CSS variables.\n * Default: `true`\n */\n showBackground?: boolean;\n\n // Layers\n /** Array of accessor functions to defined the nested groups */\n layers: StringAccessor<Datum>[];\n /* Layer settings */\n layerConfig?: GenericAccessor<NestedDonutLayerSettings, string>;\n /* Space between layers */\n layerPadding?: number;\n\n // Segments\n /** Color accessor function. Default: `undefined` */\n color?: ColorAccessor<NestedDonutSegment<Datum>>;\n /** Corner Radius. Default: `0` */\n cornerRadius?: number;\n /** Label accessor function. */\n label?: StringAccessor<NestedDonutSegment<Datum>>;\n /**\n * When true, the component will display empty segments (the ones that have `0` values) as tiny slices.\n * Default: `false`\n * */\n showEmptySegments?: boolean;\n /** Angular size for empty segments in radians. Default: `0.5 * Math.PI / 180` */\n emptySegmentAngle?: number;\n}\n\nexport class NestedDonutConfig<Datum> extends ComponentConfig implements NestedDonutConfigInterface<Datum> {\n centralLabel?: string\n centralSubLabel?: string\n centralSubLabelWrap?: boolean\n showEmptySegments?: boolean\n emptySegmentAngle?: number\n\n color?: ColorAccessor<NestedDonutSegment<Datum>>\n label?: StringAccessor<NestedDonutSegment<Datum>>\n direction = NestedDonutDirection.INWARDS\n layers: StringAccessor<Datum>[]\n layerSettings = undefined\n layerPadding = 0\n angleRange = [0, 2 * Math.PI] as [number, number]\n padAngle = 0\n cornerRadius = 0\n showBackground = true\n}\n\n\n"],"names":[],"mappings":";;;AAAA;AAuDM,MAAO,iBAAyB,SAAQ,eAAe,CAAA;AAA7D,IAAA,WAAA,GAAA;;AASE,QAAA,IAAA,CAAA,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAA;QAExC,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAY,CAAA,YAAA,GAAG,CAAC,CAAA;QAChB,IAAU,CAAA,UAAA,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAqB,CAAA;QACjD,IAAQ,CAAA,QAAA,GAAG,CAAC,CAAA;QACZ,IAAY,CAAA,YAAA,GAAG,CAAC,CAAA;QAChB,IAAc,CAAA,cAAA,GAAG,IAAI,CAAA;KACtB;AAAA;;;;"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Selection } from 'd3-selection';
|
|
2
|
-
import { ScaleLinear } from 'd3-scale';
|
|
3
|
-
import { ComponentCore } from "../../core/component";
|
|
4
|
-
import { SeriesDataModel } from "../../data-models/series";
|
|
5
|
-
import { NestedDonutSegment } from './types';
|
|
6
|
-
import { NestedDonutConfig, NestedDonutConfigInterface } from './config';
|
|
7
|
-
import * as s from './style';
|
|
8
|
-
export declare class NestedDonut<Datum> extends ComponentCore<Datum[], NestedDonutConfig<Datum>, NestedDonutConfigInterface<Datum>> {
|
|
9
|
-
static selectors: typeof s;
|
|
10
|
-
static cssVariables: {
|
|
11
|
-
nestedDonutBackgroundColor: "--vis-nested-donut-background-color";
|
|
12
|
-
nestedDonutFontFamily: "--vis-nested-donut-font-family";
|
|
13
|
-
nestedDonutCentralLabelFontSize: "--vis-nested-donut-central-label-font-size";
|
|
14
|
-
nestedDonutCentralLabelFontWeight: "--vis-nested-donut-central-label-font-weight";
|
|
15
|
-
nestedDonutCentralLabelTextColor: "--vis-nested-donut-central-label-text-color";
|
|
16
|
-
nestedDonutCentralSublabelFontSize: "--vis-nested-donut-central-sublabel-font-size";
|
|
17
|
-
nestedDonutCentralSublabelFontWeight: "--vis-nested-donut-central-sublabel-font-weight";
|
|
18
|
-
nestedDonutCentralSublabelTextColor: "--vis-nested-donut-central-sublabel-text-color";
|
|
19
|
-
nestedDonutSegmentStrokeWidth: "--vis-nested-donut-segment-stroke-width";
|
|
20
|
-
nestedDonutSegmentStrokeColor: "--vis-nested-donut-segment-stroke-color";
|
|
21
|
-
darkNestedDonutBackgroundColor: "--vis-dark-nested-donut-background-color";
|
|
22
|
-
darkNestedDonutCentralLabelTextColor: "--vis-dark-nested-donut-central-label-text-color";
|
|
23
|
-
darkNestedDonutCentralSublabelTextColor: "--vis-dark-nested-donut-central-sublabel-text-color";
|
|
24
|
-
};
|
|
25
|
-
config: NestedDonutConfig<Datum>;
|
|
26
|
-
datamodel: SeriesDataModel<Datum>;
|
|
27
|
-
arcBackground: Selection<SVGPathElement, unknown, SVGGElement, unknown>;
|
|
28
|
-
arcGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>;
|
|
29
|
-
centralLabel: Selection<SVGTextElement, unknown, SVGGElement, unknown>;
|
|
30
|
-
centralSubLabel: Selection<SVGTextElement, unknown, SVGGElement, unknown>;
|
|
31
|
-
arcGen: import("d3-shape").Arc<any, Partial<NestedDonutSegment<Datum>>>;
|
|
32
|
-
radiusScale: ScaleLinear<number, number>;
|
|
33
|
-
colorScale: ScaleLinear<string, string>;
|
|
34
|
-
events: {};
|
|
35
|
-
constructor(config?: NestedDonutConfigInterface<Datum>);
|
|
36
|
-
private getHierarchyData;
|
|
37
|
-
_render(customDuration?: number): void;
|
|
38
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { arc } from 'd3-shape';
|
|
2
|
-
import { hierarchy, partition } from 'd3-hierarchy';
|
|
3
|
-
import { scaleLinear } from 'd3-scale';
|
|
4
|
-
import { group, sum, min, max } from 'd3-array';
|
|
5
|
-
import { ComponentCore } from '../../core/component/index.js';
|
|
6
|
-
import { SeriesDataModel } from '../../data-models/series.js';
|
|
7
|
-
import { VerticalAlign } from '../../types/text.js';
|
|
8
|
-
import { getColor, getHexValue } from '../../utils/color.js';
|
|
9
|
-
import { getString, isNumber, getValue } from '../../utils/data.js';
|
|
10
|
-
import { smartTransition } from '../../utils/d3.js';
|
|
11
|
-
import { wrapSVGText } from '../../utils/text.js';
|
|
12
|
-
import { defaultLayerSettings, NestedDonutDirection } from './types.js';
|
|
13
|
-
import { NestedDonutConfig } from './config.js';
|
|
14
|
-
import { createArc, updateArc, removeArc } from './modules/arc.js';
|
|
15
|
-
import { createLabel, updateLabel, removeLabel } from './modules/label.js';
|
|
16
|
-
import * as style from './style.js';
|
|
17
|
-
import { centralLabel, centralSubLabel, segment, segmentExit, segmentLabel, background, variables } from './style.js';
|
|
18
|
-
|
|
19
|
-
class NestedDonut extends ComponentCore {
|
|
20
|
-
constructor(config) {
|
|
21
|
-
super();
|
|
22
|
-
this.config = new NestedDonutConfig();
|
|
23
|
-
this.datamodel = new SeriesDataModel();
|
|
24
|
-
this.arcGen = arc();
|
|
25
|
-
this.radiusScale = scaleLinear();
|
|
26
|
-
this.colorScale = scaleLinear();
|
|
27
|
-
this.events = {};
|
|
28
|
-
if (config)
|
|
29
|
-
this.config.init(config);
|
|
30
|
-
this.arcBackground = this.g.append('path');
|
|
31
|
-
this.arcGroup = this.g.append('g');
|
|
32
|
-
this.centralLabel = this.g.append('text')
|
|
33
|
-
.attr('class', centralLabel);
|
|
34
|
-
this.centralSubLabel = this.g.append('text')
|
|
35
|
-
.attr('class', centralSubLabel);
|
|
36
|
-
}
|
|
37
|
-
getHierarchyData() {
|
|
38
|
-
var _a;
|
|
39
|
-
const { config, datamodel } = this;
|
|
40
|
-
const layerAccessors = (_a = config.layers) === null || _a === void 0 ? void 0 : _a.map(layerAccessor => (d, i) => getString(d, layerAccessor, i));
|
|
41
|
-
const nestedData = group(datamodel.data, ...layerAccessors);
|
|
42
|
-
const rootNode = hierarchy(nestedData).count();
|
|
43
|
-
const partitionData = partition().size([config.angleRange[1], 1])(rootNode);
|
|
44
|
-
partitionData.eachBefore((node, index) => {
|
|
45
|
-
var _a, _b, _c, _d;
|
|
46
|
-
const scale = this.colorScale.domain([-1, (_a = node.children) === null || _a === void 0 ? void 0 : _a.length]);
|
|
47
|
-
node._id = this.uid + index;
|
|
48
|
-
node._layer = node.depth - 1;
|
|
49
|
-
node.data = { key: node.data[0], root: (_c = (_b = node.parent) === null || _b === void 0 ? void 0 : _b.data.root) !== null && _c !== void 0 ? _c : node.data[0] };
|
|
50
|
-
(_d = node.children) === null || _d === void 0 ? void 0 : _d.forEach((child, i) => {
|
|
51
|
-
var _a;
|
|
52
|
-
child._index = i;
|
|
53
|
-
child._state = {
|
|
54
|
-
fill: (_a = getColor(child, config.color, i, child.depth !== 1)) !== null && _a !== void 0 ? _a : scale.range(['#fff', getHexValue(node._state.fill, this.element)])(i),
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
const segments = partitionData.descendants().filter(d => d.parent && d.children && d.data.key);
|
|
59
|
-
return segments;
|
|
60
|
-
}
|
|
61
|
-
_render(customDuration) {
|
|
62
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
63
|
-
const { config } = this;
|
|
64
|
-
const duration = isNumber(customDuration) ? customDuration : config.duration;
|
|
65
|
-
const layers = (_a = config.layers) === null || _a === void 0 ? void 0 : _a.map((_, i) => { var _a; return (_a = getValue(i, config.layerSettings)) !== null && _a !== void 0 ? _a : defaultLayerSettings; });
|
|
66
|
-
const data = this.getHierarchyData();
|
|
67
|
-
const outerRadius = Math.min(this._width, this._height) / 2;
|
|
68
|
-
const innerRadius = Math.max(0, outerRadius - sum(layers, d => d.width + config.layerPadding));
|
|
69
|
-
const yMin = min(data, d => d.y0);
|
|
70
|
-
const yMax = max(data, d => d.y1);
|
|
71
|
-
this.radiusScale
|
|
72
|
-
.domain(config.direction === NestedDonutDirection.OUTWARDS ? [yMin, yMax] : [yMax, yMin])
|
|
73
|
-
.range([innerRadius, outerRadius]);
|
|
74
|
-
this.arcGen
|
|
75
|
-
.startAngle(d => d.x0)
|
|
76
|
-
.endAngle(d => d.x1)
|
|
77
|
-
.innerRadius(d => this.radiusScale(d.y0))
|
|
78
|
-
.outerRadius(d => this.radiusScale(d.y1))
|
|
79
|
-
.padAngle(config.padAngle)
|
|
80
|
-
.cornerRadius(config.cornerRadius);
|
|
81
|
-
this.arcGroup.attr('transform', `translate(${this._width / 2},${this._height / 2})`);
|
|
82
|
-
// Arcs
|
|
83
|
-
const arcs = this.arcGroup
|
|
84
|
-
.selectAll(`.${segment}`)
|
|
85
|
-
.data(data, d => d._id);
|
|
86
|
-
const arcsEnter = arcs.enter().append('path')
|
|
87
|
-
.attr('class', segment)
|
|
88
|
-
.call(createArc, config);
|
|
89
|
-
arcs.merge(arcsEnter)
|
|
90
|
-
.call(updateArc, config, this.arcGen, duration);
|
|
91
|
-
arcs.exit()
|
|
92
|
-
.attr('class', segmentExit)
|
|
93
|
-
.call(removeArc, duration);
|
|
94
|
-
// Segment labels
|
|
95
|
-
const arcLabels = this.arcGroup
|
|
96
|
-
.selectAll(`.${segmentLabel}`)
|
|
97
|
-
.data(data, d => d._id);
|
|
98
|
-
const arcLabelsEnter = arcLabels.enter().append('text')
|
|
99
|
-
.attr('class', segmentLabel)
|
|
100
|
-
.call(createLabel, config);
|
|
101
|
-
arcLabels.merge(arcLabelsEnter)
|
|
102
|
-
.call(updateLabel, config, this.arcGen, duration);
|
|
103
|
-
arcLabels.exit()
|
|
104
|
-
.call(removeLabel, duration);
|
|
105
|
-
// Chart labels
|
|
106
|
-
this.centralLabel
|
|
107
|
-
.attr('transform', `translate(${this._width / 2},${this._height / 2})`)
|
|
108
|
-
.attr('dy', config.centralSubLabel ? '-0.55em' : null)
|
|
109
|
-
.text((_b = config.centralLabel) !== null && _b !== void 0 ? _b : null);
|
|
110
|
-
this.centralSubLabel
|
|
111
|
-
.attr('transform', `translate(${this._width / 2},${this._height / 2})`)
|
|
112
|
-
.attr('dy', config.centralLabel ? '0.55em' : null)
|
|
113
|
-
.text((_c = config.centralSubLabel) !== null && _c !== void 0 ? _c : null);
|
|
114
|
-
if (config.centralSubLabelWrap)
|
|
115
|
-
wrapSVGText(this.centralSubLabel, innerRadius * 1.9, VerticalAlign.Top);
|
|
116
|
-
// Background
|
|
117
|
-
this.arcBackground.attr('class', background)
|
|
118
|
-
.attr('visibility', config.showBackground ? null : 'hidden')
|
|
119
|
-
.attr('transform', `translate(${this._width / 2},${this._height / 2})`);
|
|
120
|
-
smartTransition(this.arcBackground, duration)
|
|
121
|
-
.attr('d', arc()({
|
|
122
|
-
startAngle: (_g = (_e = (_d = config.angleRange) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : (_f = config.angleRange) === null || _f === void 0 ? void 0 : _f[0]) !== null && _g !== void 0 ? _g : 0,
|
|
123
|
-
endAngle: (_l = (_j = (_h = config.angleRange) === null || _h === void 0 ? void 0 : _h[1]) !== null && _j !== void 0 ? _j : (_k = config.angleRange) === null || _k === void 0 ? void 0 : _k[1]) !== null && _l !== void 0 ? _l : 2 * Math.PI,
|
|
124
|
-
innerRadius,
|
|
125
|
-
outerRadius,
|
|
126
|
-
}));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
NestedDonut.selectors = style;
|
|
130
|
-
NestedDonut.cssVariables = variables;
|
|
131
|
-
|
|
132
|
-
export { NestedDonut };
|
|
133
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/nested-donut/index.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport { arc } from 'd3-shape'\nimport { hierarchy, partition } from 'd3-hierarchy'\nimport { scaleLinear, ScaleLinear } from 'd3-scale'\nimport { group, max, min, sum } from 'd3-array'\n\n// Core\nimport { ComponentCore } from 'core/component'\nimport { SeriesDataModel } from 'data-models/series'\n\n// Types\nimport { VerticalAlign } from 'types/text'\n\n// Utils\nimport { getColor, getHexValue } from 'utils/color'\nimport { getString, getValue, isNumber } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { wrapSVGText } from 'utils/text'\n\n// Local Types\nimport { NestedDonutDirection, NestedDonutLayerSettings, NestedDonutSegment, defaultLayerSettings } from './types'\n\n// Config\nimport { NestedDonutConfig, NestedDonutConfigInterface } from './config'\n\n// Modules\nimport { createArc, updateArc, removeArc } from './modules/arc'\nimport { createLabel, updateLabel, removeLabel } from './modules/label'\n\n// Styles\nimport * as s from './style'\n\nexport class NestedDonut<Datum> extends ComponentCore<\nDatum[],\nNestedDonutConfig<Datum>,\nNestedDonutConfigInterface<Datum>\n> {\n static selectors = s\n static cssVariables = s.variables\n config: NestedDonutConfig<Datum> = new NestedDonutConfig()\n datamodel: SeriesDataModel<Datum> = new SeriesDataModel()\n\n arcBackground: Selection<SVGPathElement, unknown, SVGGElement, unknown>\n arcGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n centralLabel: Selection<SVGTextElement, unknown, SVGGElement, unknown>\n centralSubLabel: Selection<SVGTextElement, unknown, SVGGElement, unknown>\n\n arcGen = arc<Partial<NestedDonutSegment<Datum>>>()\n radiusScale: ScaleLinear<number, number> = scaleLinear()\n colorScale: ScaleLinear<string, string> = scaleLinear()\n\n events = { }\n\n constructor (config?: NestedDonutConfigInterface<Datum>) {\n super()\n if (config) this.config.init(config)\n this.arcBackground = this.g.append('path')\n this.arcGroup = this.g.append('g')\n this.centralLabel = this.g.append('text')\n .attr('class', s.centralLabel)\n this.centralSubLabel = this.g.append('text')\n .attr('class', s.centralSubLabel)\n }\n\n private getHierarchyData (): NestedDonutSegment<Datum>[] {\n const { config, datamodel } = this\n\n const layerAccessors = config.layers?.map(layerAccessor => (d: Datum, i: number) => getString(d, layerAccessor, i))\n const nestedData = group(datamodel.data, ...layerAccessors as [(d: Datum) => string])\n const rootNode = hierarchy(nestedData).count()\n const partitionData = partition().size([config.angleRange[1], 1])(rootNode) as NestedDonutSegment<Datum>\n\n partitionData.eachBefore((node, index) => {\n const scale = this.colorScale.domain([-1, node.children?.length])\n node._id = this.uid + index\n node._layer = node.depth - 1\n\n node.data = { key: node.data[0], root: node.parent?.data.root ?? node.data[0] }\n node.children?.forEach((child, i) => {\n child._index = i\n child._state = {\n fill:\n getColor(child, config.color, i, child.depth !== 1) ??\n scale.range(['#fff', getHexValue(node._state.fill, this.element)])(i),\n }\n })\n })\n const segments = partitionData.descendants().filter(d => d.parent && d.children && d.data.key)\n return segments\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const layers: NestedDonutLayerSettings[] = config.layers?.map((_, i) => getValue(i, config.layerSettings) ?? defaultLayerSettings)\n const data = this.getHierarchyData()\n\n const outerRadius = Math.min(this._width, this._height) / 2\n const innerRadius = Math.max(0, outerRadius - sum(layers, d => d.width + config.layerPadding))\n\n const yMin = min(data, d => d.y0)\n const yMax = max(data, d => d.y1)\n\n this.radiusScale\n .domain(config.direction === NestedDonutDirection.OUTWARDS ? [yMin, yMax] : [yMax, yMin])\n .range([innerRadius, outerRadius])\n\n this.arcGen\n .startAngle(d => d.x0)\n .endAngle(d => d.x1)\n .innerRadius(d => this.radiusScale(d.y0))\n .outerRadius(d => this.radiusScale(d.y1))\n .padAngle(config.padAngle)\n .cornerRadius(config.cornerRadius)\n\n this.arcGroup.attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n\n // Arcs\n const arcs = this.arcGroup\n .selectAll<SVGPathElement, NestedDonutSegment<Datum>>(`.${s.segment}`)\n .data(data, d => d._id)\n\n const arcsEnter = arcs.enter().append('path')\n .attr('class', s.segment)\n .call(createArc, config)\n\n arcs.merge(arcsEnter)\n .call(updateArc, config, this.arcGen, duration)\n\n arcs.exit<NestedDonutSegment<Datum>>()\n .attr('class', s.segmentExit)\n .call(removeArc, duration)\n\n // Segment labels\n const arcLabels = this.arcGroup\n .selectAll<SVGTextElement, NestedDonutSegment<Datum>>(`.${s.segmentLabel}`)\n .data(data, d => d._id)\n\n const arcLabelsEnter = arcLabels.enter().append('text')\n .attr('class', s.segmentLabel)\n .call(createLabel, config)\n\n arcLabels.merge(arcLabelsEnter)\n .call(updateLabel, config, this.arcGen, duration)\n\n arcLabels.exit<NestedDonutSegment<Datum>>()\n .call(removeLabel, duration)\n\n // Chart labels\n this.centralLabel\n .attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n .attr('dy', config.centralSubLabel ? '-0.55em' : null)\n .text(config.centralLabel ?? null)\n\n this.centralSubLabel\n .attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n .attr('dy', config.centralLabel ? '0.55em' : null)\n .text(config.centralSubLabel ?? null)\n\n if (config.centralSubLabelWrap) wrapSVGText(this.centralSubLabel, innerRadius * 1.9, VerticalAlign.Top)\n\n // Background\n this.arcBackground.attr('class', s.background)\n .attr('visibility', config.showBackground ? null : 'hidden')\n .attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n\n smartTransition(this.arcBackground, duration)\n .attr('d', arc()({\n startAngle: config.angleRange?.[0] ?? config.angleRange?.[0] ?? 0,\n endAngle: config.angleRange?.[1] ?? config.angleRange?.[1] ?? 2 * Math.PI,\n innerRadius,\n outerRadius,\n }))\n }\n}\n"],"names":["s.centralLabel","s.centralSubLabel","s.segment","s.segmentExit","s.segmentLabel","s.background","s","s.variables"],"mappings":";;;;;;;;;;;;;;;;;;AAgCM,MAAO,WAAmB,SAAQ,aAIvC,CAAA;AAiBC,IAAA,WAAA,CAAa,MAA0C,EAAA;AACrD,QAAA,KAAK,EAAE,CAAA;AAfT,QAAA,IAAA,CAAA,MAAM,GAA6B,IAAI,iBAAiB,EAAE,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Ae,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC1C,aAAA,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;AACf,YAAA,UAAU,EAAE,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAA,MAAM,CAAC,UAAU,MAAG,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,CAAC,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAM,CAAC,UAAU,0CAAG,CAAC,CAAC,mCAAI,CAAC;YACjE,QAAQ,EAAE,MAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAM,CAAC,UAAU,MAAG,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,MAAA,MAAM,CAAC,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,CAAC,CAAC,mCAAI,CAAC,GAAG,IAAI,CAAC,EAAE;YACzE,WAAW;YACX,WAAW;AACZ,SAAA,CAAC,CAAC,CAAA;KACN;;AAzIM,WAAS,CAAA,SAAA,GAAGC,KAAC,CAAA;AACb,WAAA,CAAA,YAAY,GAAGC,SAAW;;;;"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Selection } from 'd3-selection';
|
|
2
|
-
import { Arc } from 'd3-shape';
|
|
3
|
-
import { NestedDonutSegment } from '../types';
|
|
4
|
-
import { NestedDonutConfig } from '../config';
|
|
5
|
-
declare type AnimState = {
|
|
6
|
-
x0: number;
|
|
7
|
-
x1: number;
|
|
8
|
-
y0: number;
|
|
9
|
-
y1: number;
|
|
10
|
-
};
|
|
11
|
-
export interface ArcNode extends SVGElement {
|
|
12
|
-
_animState?: AnimState;
|
|
13
|
-
}
|
|
14
|
-
export declare function createArc<Datum>(selection: Selection<SVGPathElement, NestedDonutSegment<Datum>, SVGGElement, unknown>, config: NestedDonutConfig<Datum>): void;
|
|
15
|
-
export declare function updateArc<Datum>(selection: Selection<SVGPathElement, NestedDonutSegment<Datum>, SVGGElement, unknown>, config: NestedDonutConfig<Datum>, arcGen: Arc<any, AnimState>, duration: number): void;
|
|
16
|
-
export declare function removeArc<Datum>(selection: Selection<SVGPathElement, NestedDonutSegment<Datum>, SVGGElement, unknown>, duration: number): void;
|
|
17
|
-
export {};
|