@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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Config } from 'core/config'
|
|
2
|
+
|
|
3
|
+
// Local Types
|
|
4
|
+
import { VisControlItemInterface, VisControlsOrientation } from './types'
|
|
5
|
+
|
|
6
|
+
export interface VisControlsConfigInterface {
|
|
7
|
+
/** Controls items array, VisControlItemInterface[]. Default: `[]` */
|
|
8
|
+
items?: VisControlItemInterface[];
|
|
9
|
+
/** Controls orientation. `VisControlsOrientation.Horizontal` or `VisControlsOrientation.Horizontal`. Default: `VisControlsOrientation.Horizontal` */
|
|
10
|
+
orientation?: VisControlsOrientation;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class VisControlsConfig extends Config implements VisControlsConfigInterface {
|
|
14
|
+
items: VisControlItemInterface[] = []
|
|
15
|
+
orientation = VisControlsOrientation.Horizontal
|
|
16
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Selection, select } from 'd3-selection'
|
|
2
|
+
|
|
3
|
+
// Local Types
|
|
4
|
+
import { VisControlItemInterface, VisControlsOrientation } from './types'
|
|
5
|
+
|
|
6
|
+
// Config
|
|
7
|
+
import { VisControlsConfig, VisControlsConfigInterface } from './config'
|
|
8
|
+
|
|
9
|
+
// Style
|
|
10
|
+
import * as s from './style'
|
|
11
|
+
|
|
12
|
+
export class VisControls {
|
|
13
|
+
div: Selection<HTMLDivElement, unknown, null, undefined>
|
|
14
|
+
element: HTMLDivElement
|
|
15
|
+
config: VisControlsConfig
|
|
16
|
+
protected _container: HTMLElement
|
|
17
|
+
protected _items: Selection<HTMLDivElement, unknown, null, undefined>
|
|
18
|
+
|
|
19
|
+
constructor (element: HTMLElement, config?: VisControlsConfigInterface) {
|
|
20
|
+
this._container = element
|
|
21
|
+
|
|
22
|
+
this.div = select(this._container)
|
|
23
|
+
.append('div')
|
|
24
|
+
.attr('class', s.root)
|
|
25
|
+
this.element = this.div.node()
|
|
26
|
+
this._items = this.div.append('div')
|
|
27
|
+
.attr('class', s.items)
|
|
28
|
+
|
|
29
|
+
if (config) this.update(config)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
update (config: VisControlsConfigInterface): void {
|
|
33
|
+
this.config = new VisControlsConfig().init(config)
|
|
34
|
+
this.render()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
render (): void {
|
|
38
|
+
const { config: { items, orientation } } = this
|
|
39
|
+
this._items
|
|
40
|
+
.classed(s.horizontalItems, orientation === VisControlsOrientation.Horizontal)
|
|
41
|
+
const controlItems = this._items.selectAll<HTMLDivElement, VisControlItemInterface>(`.${s.item}`)
|
|
42
|
+
.data(items)
|
|
43
|
+
|
|
44
|
+
const controlItemsEnter = controlItems.enter()
|
|
45
|
+
.append('div')
|
|
46
|
+
.attr('class', s.item)
|
|
47
|
+
.on('click', this._onItemClick.bind(this))
|
|
48
|
+
|
|
49
|
+
controlItemsEnter.append('button')
|
|
50
|
+
.attr('class', s.itemButton)
|
|
51
|
+
|
|
52
|
+
const controlItemsMerged = controlItemsEnter.merge(controlItems)
|
|
53
|
+
controlItemsMerged
|
|
54
|
+
.classed(s.borderLeft, d => d.borderLeft)
|
|
55
|
+
.classed(s.borderTop, d => d.borderTop)
|
|
56
|
+
.classed(s.borderRight, d => d.borderRight)
|
|
57
|
+
.classed(s.borderBottom, d => d.borderBottom)
|
|
58
|
+
.classed(s.disabled, d => d.disabled)
|
|
59
|
+
controlItemsMerged.select(`.${s.itemButton}`)
|
|
60
|
+
.html(item => item.icon)
|
|
61
|
+
|
|
62
|
+
controlItems.exit().remove()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
_onItemClick (event: MouseEvent, item: VisControlItemInterface): void {
|
|
66
|
+
item.callback?.(event)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { css, injectGlobal } from '@emotion/css'
|
|
2
|
-
import { UNOVIS_ICON_FONT_FAMILY_DEFAULT } from '
|
|
1
|
+
import { css, injectGlobal } from '@emotion/css'
|
|
2
|
+
import { UNOVIS_ICON_FONT_FAMILY_DEFAULT } from 'styles/index'
|
|
3
3
|
|
|
4
|
-
const root = css
|
|
4
|
+
export const root = css`
|
|
5
5
|
label: vis-controls-component;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export const variables = injectGlobal`
|
|
8
9
|
:root {
|
|
9
10
|
--vis-controls-buttons-border-color: rgba(108, 119, 140, 0.15);
|
|
10
11
|
--vis-controls-buttons-background-color: rgba(255, 255, 255, 1);
|
|
@@ -21,23 +22,27 @@ const variables = injectGlobal `
|
|
|
21
22
|
--vis-controls-buttons-background-color: var(--vis-dark-controls-buttons-background-color);
|
|
22
23
|
--vis-controls-button-color: var(--vis-dark-controls-button-color);
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
`
|
|
26
|
+
|
|
27
|
+
export const items = css`
|
|
26
28
|
label: items;
|
|
27
29
|
background-color: var(--vis-controls-buttons-background-color);
|
|
28
30
|
border: 1px solid var(--vis-controls-buttons-border-color);
|
|
29
31
|
border-radius: 4px;
|
|
30
32
|
opacity: 1;
|
|
31
33
|
transition: all 300ms;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
`
|
|
35
|
+
|
|
36
|
+
export const horizontalItems = css`
|
|
34
37
|
label: horizontal;
|
|
35
38
|
display: inline-flex;
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
`
|
|
40
|
+
|
|
41
|
+
export const item = css`
|
|
38
42
|
label: item;
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
`
|
|
44
|
+
|
|
45
|
+
export const itemButton = css`
|
|
41
46
|
label: item-button;
|
|
42
47
|
font-family: var(--vis-controls-button-icon-font);
|
|
43
48
|
display: block;
|
|
@@ -52,24 +57,26 @@ const itemButton = css `
|
|
|
52
57
|
box-sizing: border-box;
|
|
53
58
|
color: var(--vis-controls-button-color);
|
|
54
59
|
background-color: inherit;
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
`
|
|
61
|
+
|
|
62
|
+
export const borderLeft = css`
|
|
57
63
|
border-left: 1px solid var(--vis-controls-buttons-border-color);
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
`
|
|
65
|
+
|
|
66
|
+
export const borderTop = css`
|
|
60
67
|
border-top: 1px solid var(--vis-controls-buttons-border-color);
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
`
|
|
69
|
+
|
|
70
|
+
export const borderRight = css`
|
|
63
71
|
border-right: 1px solid var(--vis-controls-buttons-border-color);
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
`
|
|
73
|
+
|
|
74
|
+
export const borderBottom = css`
|
|
66
75
|
border-bottom: 1px solid var(--vis-controls-buttons-border-color);
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
`
|
|
77
|
+
|
|
78
|
+
export const disabled = css`
|
|
69
79
|
label: disabled;
|
|
70
80
|
opacity: 0.4;
|
|
71
81
|
pointer-events: none;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export { borderBottom, borderLeft, borderRight, borderTop, disabled, horizontalItems, item, itemButton, items, root, variables };
|
|
75
|
-
//# sourceMappingURL=style.js.map
|
|
82
|
+
`
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface VisControlItemInterface {
|
|
2
|
+
icon: string;
|
|
3
|
+
callback?: (event: MouseEvent) => any;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
borderLeft?: boolean;
|
|
6
|
+
borderTop?: boolean;
|
|
7
|
+
borderRight?: boolean;
|
|
8
|
+
borderBottom?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum VisControlsOrientation {
|
|
12
|
+
Horizontal = 'horizontal',
|
|
13
|
+
Vertical = 'vertical',
|
|
14
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Core
|
|
2
|
+
import { XYComponentConfigInterface, XYComponentConfig } from 'core/xy-component/config'
|
|
3
|
+
|
|
4
|
+
// Types
|
|
5
|
+
import { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'
|
|
6
|
+
|
|
7
|
+
// Local Types
|
|
8
|
+
import { XYLabel, XYLabelPositioning } from './types'
|
|
9
|
+
|
|
10
|
+
export interface XYLabelsConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {
|
|
11
|
+
/** Single Y accessor function. Default: `undefined` */
|
|
12
|
+
y: NumericAccessor<Datum>;
|
|
13
|
+
/** Defines how to position the label horizontally: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */
|
|
14
|
+
xPositioning?: GenericAccessor<XYLabelPositioning | string, Datum>;
|
|
15
|
+
/** Defines how to position the label vertically: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */
|
|
16
|
+
yPositioning?: GenericAccessor<XYLabelPositioning | string, Datum>;
|
|
17
|
+
/** Font size accessor function or constant value in pixels. If not provided, the value of CSS variable `--vis-xy-label-font-size` will be used. Default: `undefined` */
|
|
18
|
+
labelFontSize?: NumericAccessor<Datum>;
|
|
19
|
+
/** Label accessor function or string. Default: `undefined` */
|
|
20
|
+
label?: StringAccessor<Datum>;
|
|
21
|
+
/** Label color. Default: `undefined` */
|
|
22
|
+
backgroundColor?: ColorAccessor<Datum>;
|
|
23
|
+
/** Optional label cursor. Default: `null` */
|
|
24
|
+
cursor?: StringAccessor<Datum>;
|
|
25
|
+
/** Label color brightness ratio for switching between dark and light text label color. Default: `0.65` */
|
|
26
|
+
labelTextBrightnessRatio?: number;
|
|
27
|
+
/** Enable label clustering. Default: `true` */
|
|
28
|
+
clustering?: boolean;
|
|
29
|
+
/** Label accessor for clusters. Default: `undefined` */
|
|
30
|
+
clusterLabel?: StringAccessor<XYLabel<Datum>[]>;
|
|
31
|
+
/** Font size accessor for clusters, the value is in pixels. If not provided, the value of CSS variable `--vis-xy-label-cluster-font-size` will be used. Default: `undefined` */
|
|
32
|
+
clusterFontSize?: NumericAccessor<XYLabel<Datum>[]>;
|
|
33
|
+
/** Background color accessor for clusters. Default: `undefined` */
|
|
34
|
+
clusterBackgroundColor?: ColorAccessor<XYLabel<Datum>[]>;
|
|
35
|
+
/** Optional cluster cursor. Default: `null` */
|
|
36
|
+
clusterCursor?: StringAccessor<XYLabel<Datum>[]>;
|
|
37
|
+
/** Cluster label color accessor function. Default: `null` */
|
|
38
|
+
clusterLabelColor?: ColorAccessor<XYLabel<Datum>[]>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class XYLabelsConfig<Datum> extends XYComponentConfig<Datum> implements XYLabelsConfigInterface<Datum> {
|
|
42
|
+
xPositioning = XYLabelPositioning.DataSpace
|
|
43
|
+
yPositioning = XYLabelPositioning.DataSpace
|
|
44
|
+
labelFontSize = undefined
|
|
45
|
+
label = undefined
|
|
46
|
+
backgroundColor = undefined
|
|
47
|
+
cursor = null
|
|
48
|
+
labelTextBrightnessRatio = 0.65
|
|
49
|
+
|
|
50
|
+
clustering = true
|
|
51
|
+
clusterLabel = (records: XYLabel<Datum>[]): string => records.length.toString()
|
|
52
|
+
clusterFontSize = undefined
|
|
53
|
+
clusterBackgroundColor = undefined
|
|
54
|
+
clusterCursor = undefined
|
|
55
|
+
clusterLabelColor = null
|
|
56
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Core
|
|
2
|
+
import { XYComponentCore } from 'core/xy-component'
|
|
3
|
+
|
|
4
|
+
// Utils
|
|
5
|
+
import { getValue, isNumber, isNumberWithinRange } from 'utils/data'
|
|
6
|
+
import { rectIntersect } from 'utils/misc'
|
|
7
|
+
|
|
8
|
+
// Local Types
|
|
9
|
+
import { XYLabelCluster, XYLabel, XYLabelPositioning } from './types'
|
|
10
|
+
|
|
11
|
+
// Config
|
|
12
|
+
import { XYLabelsConfig, XYLabelsConfigInterface } from './config'
|
|
13
|
+
|
|
14
|
+
// Modules
|
|
15
|
+
import { createLabels, updateLabels, removeLabels, getLabelRenderProps } from './modules/label'
|
|
16
|
+
|
|
17
|
+
// Styles
|
|
18
|
+
import * as s from './style'
|
|
19
|
+
|
|
20
|
+
export class XYLabels<Datum> extends XYComponentCore<Datum, XYLabelsConfig<Datum>, XYLabelsConfigInterface<Datum>> {
|
|
21
|
+
static selectors = s
|
|
22
|
+
clippable = false
|
|
23
|
+
config: XYLabelsConfig<Datum> = new XYLabelsConfig()
|
|
24
|
+
events = {
|
|
25
|
+
[XYLabels.selectors.label]: {},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
constructor (config?: XYLabelsConfigInterface<Datum>) {
|
|
29
|
+
super()
|
|
30
|
+
if (config) this.setConfig(config)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_render (customDuration?: number): void {
|
|
34
|
+
const { config } = this
|
|
35
|
+
const duration = isNumber(customDuration) ? customDuration : config.duration
|
|
36
|
+
|
|
37
|
+
const labelGroups = this.g
|
|
38
|
+
.selectAll<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>>(`.${s.labelGroup}`)
|
|
39
|
+
.data(this._getDataToRender())
|
|
40
|
+
|
|
41
|
+
const labelGroupsExit = labelGroups.exit<XYLabel<Datum> | XYLabelCluster<Datum>>()
|
|
42
|
+
removeLabels(labelGroupsExit, duration)
|
|
43
|
+
|
|
44
|
+
const labelGroupsEnter = labelGroups.enter().append('g')
|
|
45
|
+
.attr('class', s.labelGroup)
|
|
46
|
+
.call(createLabels)
|
|
47
|
+
|
|
48
|
+
const labelGroupsMerged = labelGroupsEnter
|
|
49
|
+
.merge(labelGroups)
|
|
50
|
+
.classed(s.cluster, d => !!(d as XYLabelCluster<Datum>).records)
|
|
51
|
+
.classed(s.label, d => !(d as XYLabelCluster<Datum>).records)
|
|
52
|
+
|
|
53
|
+
labelGroupsMerged.call(updateLabels, config, duration)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private _getDataToRender (): (XYLabel<Datum> | XYLabelCluster<Datum>)[] {
|
|
57
|
+
const { config, datamodel } = this
|
|
58
|
+
|
|
59
|
+
const xRange = this.xScale.range() as [number, number]
|
|
60
|
+
const yRange = this.xScale.range() as [number, number]
|
|
61
|
+
|
|
62
|
+
const labels = datamodel.data?.reduce<XYLabel<Datum>[]>((acc, d) => {
|
|
63
|
+
const xPositioning = getValue<Datum, XYLabelPositioning>(d, config.xPositioning)
|
|
64
|
+
const yPositioning = getValue<Datum, XYLabelPositioning>(d, config.yPositioning)
|
|
65
|
+
const props = getLabelRenderProps(d, this.element, config, this.xScale, this.yScale)
|
|
66
|
+
|
|
67
|
+
if (
|
|
68
|
+
((xPositioning !== XYLabelPositioning.DataSpace) || isNumberWithinRange(props.x, xRange)) &&
|
|
69
|
+
((yPositioning !== XYLabelPositioning.DataSpace) || isNumberWithinRange(props.y, yRange))
|
|
70
|
+
) {
|
|
71
|
+
acc.push({ ...d, _screen: props })
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return acc
|
|
75
|
+
}, []) ?? []
|
|
76
|
+
|
|
77
|
+
return this._getClusteredLabels(labels)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private _getClusteredLabels (labels: XYLabel<Datum>[]): (XYLabel<Datum> | XYLabelCluster<Datum>)[] {
|
|
81
|
+
const labelsNonOverlapping = [...labels]
|
|
82
|
+
const clusterMap = new Map<XYLabel<Datum>, XYLabel<Datum>[]>()
|
|
83
|
+
for (let i = 0; i < labelsNonOverlapping.length; i += 1) {
|
|
84
|
+
const label1 = labelsNonOverlapping[i]
|
|
85
|
+
for (let j = i + 1; j < labelsNonOverlapping.length; j += 1) {
|
|
86
|
+
const label2 = labelsNonOverlapping[j]
|
|
87
|
+
const isIntersecting = rectIntersect(label1._screen, label2._screen)
|
|
88
|
+
if (isIntersecting) {
|
|
89
|
+
if (!clusterMap.has(label1)) clusterMap.set(label1, [label1])
|
|
90
|
+
clusterMap.get(label1).push(label2)
|
|
91
|
+
labelsNonOverlapping.splice(j, 1)
|
|
92
|
+
j -= 1
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (clusterMap.has(label1)) {
|
|
97
|
+
labelsNonOverlapping.splice(i, 1)
|
|
98
|
+
i -= 1
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const clusters = Array.from(clusterMap.values()).map(records => ({
|
|
103
|
+
_screen: getLabelRenderProps(records, this.element, this.config, this.xScale, this.yScale),
|
|
104
|
+
records,
|
|
105
|
+
}))
|
|
106
|
+
|
|
107
|
+
return [...labelsNonOverlapping, ...clusters]
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Selection, select } from 'd3-selection'
|
|
2
|
+
import { mean } from 'd3-array'
|
|
3
|
+
import { color } from 'd3-color'
|
|
4
|
+
|
|
5
|
+
// Utils
|
|
6
|
+
import { smartTransition } from 'utils/d3'
|
|
7
|
+
import { getCSSVariableValueInPixels, getCSSVariableValue, isStringCSSVariable } from 'utils/misc'
|
|
8
|
+
import { getColor, hexToBrightness } from 'utils/color'
|
|
9
|
+
import { getNumber, getString, getValue } from 'utils/data'
|
|
10
|
+
|
|
11
|
+
// Types
|
|
12
|
+
import { ContinuousScale } from 'types/scale'
|
|
13
|
+
|
|
14
|
+
// Config
|
|
15
|
+
import { XYLabelsConfig } from '../config'
|
|
16
|
+
|
|
17
|
+
// Local Types
|
|
18
|
+
import { XYLabel, XYLabelCluster, XYLabelPositioning, XYLabelRenderProps } from '../types'
|
|
19
|
+
|
|
20
|
+
export function createLabels<Datum> (
|
|
21
|
+
selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>
|
|
22
|
+
): void {
|
|
23
|
+
selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y})`)
|
|
24
|
+
selection.append('rect').style('fill', d => d._screen.backgroundColor)
|
|
25
|
+
selection.append('text')
|
|
26
|
+
.style('text-anchor', 'middle')
|
|
27
|
+
.style('dominant-baseline', 'central')
|
|
28
|
+
.style('fill', d => d._screen.backgroundColor)
|
|
29
|
+
.style('pointer-events', 'none')
|
|
30
|
+
|
|
31
|
+
selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function updateLabels<Datum> (
|
|
35
|
+
selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>,
|
|
36
|
+
config: XYLabelsConfig<Datum>,
|
|
37
|
+
duration: number
|
|
38
|
+
): void {
|
|
39
|
+
selection.each((d, i, elements) => {
|
|
40
|
+
const group: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any> = select(elements[i])
|
|
41
|
+
const text = group.select('text')
|
|
42
|
+
const rect = group.select('rect')
|
|
43
|
+
|
|
44
|
+
const backgroundColor = d._screen.backgroundColor
|
|
45
|
+
const labelText = d._screen.labelText ?? ''
|
|
46
|
+
const labelFontSize = d._screen.fontSize
|
|
47
|
+
let labelColor = d._screen.labelColor
|
|
48
|
+
|
|
49
|
+
// Label background
|
|
50
|
+
const backgroundHeight = labelFontSize * 1.7
|
|
51
|
+
let backgroundWidth = labelFontSize * labelText.length * 0.7
|
|
52
|
+
if (backgroundWidth < backgroundHeight) backgroundWidth = backgroundHeight
|
|
53
|
+
smartTransition(rect, duration)
|
|
54
|
+
.attr('width', backgroundWidth)
|
|
55
|
+
.attr('height', backgroundHeight)
|
|
56
|
+
.attr('x', -backgroundWidth / 2)
|
|
57
|
+
.attr('y', -backgroundHeight / 2)
|
|
58
|
+
.attr('rx', labelFontSize)
|
|
59
|
+
.attr('ry', labelFontSize)
|
|
60
|
+
.style('fill', backgroundColor)
|
|
61
|
+
|
|
62
|
+
// Label
|
|
63
|
+
if (!labelColor) {
|
|
64
|
+
const hex = color(isStringCSSVariable(backgroundColor) ? getCSSVariableValue(backgroundColor, group.node()) : backgroundColor)?.hex()
|
|
65
|
+
const brightness = hexToBrightness(hex)
|
|
66
|
+
labelColor = brightness > config.labelTextBrightnessRatio
|
|
67
|
+
? 'var(--vis-xy-label-text-color-dark)'
|
|
68
|
+
: 'var(--vis-xy-label-text-color-light)'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
text.html(labelText)
|
|
72
|
+
.attr('font-size', labelFontSize)
|
|
73
|
+
|
|
74
|
+
smartTransition(text, duration)
|
|
75
|
+
.style('fill', labelColor)
|
|
76
|
+
|
|
77
|
+
rect.style('cursor', d._screen.cursor)
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
smartTransition(selection, duration)
|
|
81
|
+
.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(1)`)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function removeLabels<Datum> (
|
|
85
|
+
selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>,
|
|
86
|
+
duration: number
|
|
87
|
+
): void {
|
|
88
|
+
smartTransition(selection, duration)
|
|
89
|
+
.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`)
|
|
90
|
+
.remove()
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function getLabelPosition (value: number, positioning: XYLabelPositioning, scale: ContinuousScale): number {
|
|
94
|
+
switch (positioning) {
|
|
95
|
+
case XYLabelPositioning.DataSpace: return scale(value) ?? 0
|
|
96
|
+
case XYLabelPositioning.AbsolutePx: return value
|
|
97
|
+
case XYLabelPositioning.AbsolutePercentage: {
|
|
98
|
+
const scaleRange = scale.range()
|
|
99
|
+
return scaleRange[0] + (scaleRange[1] - scaleRange[0]) * value / 100
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function getLabelRenderProps<Datum> (
|
|
105
|
+
data: Datum | XYLabel<Datum>[],
|
|
106
|
+
el: SVGGraphicsElement,
|
|
107
|
+
config: XYLabelsConfig<Datum>,
|
|
108
|
+
xScale: ContinuousScale,
|
|
109
|
+
yScale: ContinuousScale
|
|
110
|
+
): XYLabelRenderProps {
|
|
111
|
+
const isCluster = Array.isArray(data)
|
|
112
|
+
const fontSize = isCluster
|
|
113
|
+
? (getNumber(data, config.clusterFontSize) ?? getCSSVariableValueInPixels('var(--vis-xy-label-cluster-font-size)', el))
|
|
114
|
+
: (getNumber(data, config.labelFontSize) ?? getCSSVariableValueInPixels('var(--vis-xy-label-font-size)', el))
|
|
115
|
+
|
|
116
|
+
const labelText = (isCluster ? config.clusterLabel(data as XYLabel<Datum>[]) : getString(data, config.label)) || ''
|
|
117
|
+
const backgroundHeight = fontSize * 1.7
|
|
118
|
+
let backgroundWidth = fontSize * labelText.length * 0.7
|
|
119
|
+
if (backgroundWidth < backgroundHeight) backgroundWidth = backgroundHeight
|
|
120
|
+
|
|
121
|
+
const x = isCluster
|
|
122
|
+
? mean(data as XYLabel<Datum>[], d => d._screen.x)
|
|
123
|
+
: getLabelPosition(getNumber(data, config.x), getValue(data, config.xPositioning), xScale)
|
|
124
|
+
|
|
125
|
+
const y = isCluster
|
|
126
|
+
? mean(data as XYLabel<Datum>[], d => d._screen.y)
|
|
127
|
+
: getLabelPosition(getNumber(data, config.y), getValue(data, config.yPositioning), yScale)
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
x,
|
|
131
|
+
y,
|
|
132
|
+
fontSize,
|
|
133
|
+
labelText,
|
|
134
|
+
labelColor: isCluster ? getColor(data, config.clusterLabelColor) : getColor(data, config.color),
|
|
135
|
+
backgroundColor: isCluster ? getColor(data, config.clusterBackgroundColor) : getColor(data, config.backgroundColor),
|
|
136
|
+
cursor: isCluster ? getString(data, config.clusterCursor) : getString(data, config.cursor),
|
|
137
|
+
width: backgroundWidth,
|
|
138
|
+
height: backgroundHeight,
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { css, injectGlobal } from '@emotion/css'
|
|
2
2
|
|
|
3
|
-
const globalStyles = injectGlobal
|
|
3
|
+
export const globalStyles = injectGlobal`
|
|
4
4
|
:root {
|
|
5
5
|
--vis-xy-label-cursor: default;
|
|
6
6
|
// Undefined by default to allow proper fallback to var(--vis-color-main)
|
|
@@ -17,11 +17,13 @@ const globalStyles = injectGlobal `
|
|
|
17
17
|
--vis-xy-label-text-color-light: #fff;
|
|
18
18
|
--vis-xy-label-text-font-weight: 500;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
`
|
|
21
|
+
|
|
22
|
+
export const root = css`
|
|
22
23
|
label: xy-labels-component;
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
export const labelGroup = css`
|
|
25
27
|
label: label-g;
|
|
26
28
|
|
|
27
29
|
> rect, text {
|
|
@@ -44,13 +46,12 @@ const labelGroup = css `
|
|
|
44
46
|
stroke-width: var(--vis-xy-label-hover-stroke-width);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
`
|
|
50
|
+
|
|
51
|
+
export const cluster = css`
|
|
49
52
|
label: cluster;
|
|
50
|
-
|
|
51
|
-
const label = css `
|
|
52
|
-
label: label;
|
|
53
|
-
`;
|
|
53
|
+
`
|
|
54
54
|
|
|
55
|
-
export
|
|
56
|
-
|
|
55
|
+
export const label = css`
|
|
56
|
+
label: label;
|
|
57
|
+
`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type XYLabelRenderProps = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
fontSize: number;
|
|
5
|
+
backgroundColor: string | null;
|
|
6
|
+
labelText: string | null;
|
|
7
|
+
labelColor: string | null;
|
|
8
|
+
cursor: string | null;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type XYLabel<D> = D & {
|
|
14
|
+
_screen: XYLabelRenderProps;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type XYLabelCluster<D> = {
|
|
18
|
+
_screen: XYLabelRenderProps;
|
|
19
|
+
records: XYLabel<D>[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export enum XYLabelPositioning {
|
|
23
|
+
AbsolutePx = 'absolute_px',
|
|
24
|
+
AbsolutePercentage = 'absolute_percentage',
|
|
25
|
+
DataSpace = 'data_space',
|
|
26
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Core
|
|
2
|
+
export { ComponentCore } from 'core/component'
|
|
3
|
+
export type { ComponentConfigInterface } from 'core/component/config'
|
|
4
|
+
export { XYComponentCore } from 'core/xy-component'
|
|
5
|
+
export type { XYComponentConfigInterface } from 'core/xy-component/config'
|
|
6
|
+
|
|
7
|
+
// Components
|
|
8
|
+
export { Tooltip } from 'components/tooltip'
|
|
9
|
+
export { Line } from './components/line'
|
|
10
|
+
export { StackedBar } from './components/stacked-bar'
|
|
11
|
+
export { GroupedBar } from './components/grouped-bar'
|
|
12
|
+
export { Axis } from './components/axis'
|
|
13
|
+
export { Scatter } from './components/scatter'
|
|
14
|
+
export { Brush } from './components/brush'
|
|
15
|
+
export { BulletLegend } from './components/bullet-legend'
|
|
16
|
+
export { FlowLegend } from './components/flow-legend'
|
|
17
|
+
export { Crosshair } from './components/crosshair'
|
|
18
|
+
export { Timeline } from './components/timeline'
|
|
19
|
+
export { Sankey } from './components/sankey'
|
|
20
|
+
export { Area } from './components/area'
|
|
21
|
+
export { TopoJSONMap } from './components/topojson-map'
|
|
22
|
+
export { LeafletMap } from './components/leaflet-map'
|
|
23
|
+
export { MapLibreArcticDark, MapLibreArcticLight } from './components/leaflet-map/renderer/map-style'
|
|
24
|
+
export { LeafletFlowMap } from './components/leaflet-flow-map'
|
|
25
|
+
export { ChordDiagram } from './components/chord-diagram'
|
|
26
|
+
export { Graph } from './components/graph'
|
|
27
|
+
export { VisControls } from './components/vis-controls'
|
|
28
|
+
export { Donut } from './components/donut'
|
|
29
|
+
export { FreeBrush } from './components/free-brush'
|
|
30
|
+
export { XYLabels } from './components/xy-labels'
|
|
31
|
+
export { NestedDonut } from './components/nested-donut'
|
|
32
|
+
|
|
33
|
+
// Config Interfaces
|
|
34
|
+
export type { LineConfigInterface } from './components/line/config'
|
|
35
|
+
export type { StackedBarConfigInterface } from './components/stacked-bar/config'
|
|
36
|
+
export type { GroupedBarConfigInterface } from './components/grouped-bar/config'
|
|
37
|
+
export type { ScatterConfigInterface } from './components/scatter/config'
|
|
38
|
+
export type { TooltipConfigInterface } from './components/tooltip/config'
|
|
39
|
+
export type { BrushConfigInterface } from './components/brush/config'
|
|
40
|
+
export type { AxisConfigInterface } from './components/axis/config'
|
|
41
|
+
export type { BulletLegendConfigInterface } from './components/bullet-legend/config'
|
|
42
|
+
export type { FlowLegendConfigInterface } from './components/flow-legend/config'
|
|
43
|
+
export type { CrosshairConfigInterface } from './components/crosshair/config'
|
|
44
|
+
export type { TimelineConfigInterface } from './components/timeline/config'
|
|
45
|
+
export type { SankeyConfigInterface } from './components/sankey/config'
|
|
46
|
+
export type { AreaConfigInterface } from './components/area/config'
|
|
47
|
+
export type { TopoJSONMapConfigInterface } from './components/topojson-map/config'
|
|
48
|
+
export type { LeafletMapConfigInterface } from './components/leaflet-map/config'
|
|
49
|
+
export type { LeafletFlowMapConfigInterface } from './components/leaflet-flow-map/config'
|
|
50
|
+
export type { ChordDiagramConfigInterface } from './components/chord-diagram/config'
|
|
51
|
+
export type { GraphConfigInterface } from './components/graph/config'
|
|
52
|
+
export type { VisControlsConfigInterface } from './components/vis-controls/config'
|
|
53
|
+
export type { DonutConfigInterface } from './components/donut/config'
|
|
54
|
+
export type { FreeBrushConfigInterface } from './components/free-brush/config'
|
|
55
|
+
export type { XYLabelsConfigInterface } from './components/xy-labels/config'
|
|
56
|
+
export type { NestedDonutConfigInterface } from './components/nested-donut/config'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Core
|
|
2
|
+
import { ContainerConfig, ContainerConfigInterface } from 'core/container/config'
|
|
3
|
+
import { ComponentCore } from 'core/component'
|
|
4
|
+
import { Tooltip } from 'components/tooltip'
|
|
5
|
+
|
|
6
|
+
export interface SingleContainerConfigInterface<Datum> extends ContainerConfigInterface {
|
|
7
|
+
/** Visualization component. Default: `undefined` */
|
|
8
|
+
component?: ComponentCore<Datum>;
|
|
9
|
+
/** Tooltip component. Default: `undefined` */
|
|
10
|
+
tooltip?: Tooltip;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class SingleContainerConfig<Datum> extends ContainerConfig implements SingleContainerConfigInterface<Datum> {
|
|
14
|
+
tooltip = undefined
|
|
15
|
+
}
|