@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
package/declaration.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '*.css';
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib'
|
package/licences.txt
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name license period license type installed version author
|
|
2
|
+
---- -------------- ------------ ----------------- ------
|
|
3
|
+
@emotion/css perpetual MIT 11.7.1 Kye Hohenberger
|
|
4
|
+
@juggle/resize-observer perpetual Apache-2.0 3.3.1 Juggle
|
|
5
|
+
@types/d3 perpetual MIT 7.4.0 n/a
|
|
6
|
+
@types/d3-collection perpetual MIT 1.0.10 n/a
|
|
7
|
+
@types/d3-sankey perpetual MIT 0.11.2 n/a
|
|
8
|
+
@types/geojson perpetual MIT 7946.0.8 n/a
|
|
9
|
+
@types/leaflet perpetual MIT 1.7.6 n/a
|
|
10
|
+
@types/supercluster perpetual MIT 5.0.2 n/a
|
|
11
|
+
@types/three perpetual MIT 0.135.0 n/a
|
|
12
|
+
@types/throttle-debounce perpetual MIT 5.0.0 n/a
|
|
13
|
+
@types/topojson perpetual MIT 3.2.3 n/a
|
|
14
|
+
@types/topojson-client perpetual MIT 3.0.0 n/a
|
|
15
|
+
@types/topojson-specification perpetual MIT 1.0.2 n/a
|
|
16
|
+
@unovis/dagre-layout perpetual MIT 0.8.8-1 Nikita Rokotyan
|
|
17
|
+
@unovis/graphlibrary perpetual MIT 2.2.0-1 Nikita Rokotyan
|
|
18
|
+
d3 perpetual ISC 7.2.1 Mike Bostock
|
|
19
|
+
d3-collection perpetual BSD-3-Clause 1.0.7 Mike Bostock
|
|
20
|
+
d3-geo-projection perpetual ISC 4.0.0 Mike Bostock
|
|
21
|
+
d3-interpolate-path perpetual BSD-3-Clause 2.2.3 Peter Beshai
|
|
22
|
+
d3-sankey perpetual BSD-3-Clause 0.12.3 Mike Bostock
|
|
23
|
+
elkjs perpetual EPL-2.0 0.8.2 Ulf Rüegg
|
|
24
|
+
geojson perpetual MIT 0.5.0 Casey Cesari
|
|
25
|
+
leaflet perpetual BSD-2-Clause 1.7.1 n/a
|
|
26
|
+
maplibre-gl perpetual BSD-3-Clause 2.1.9 n/a
|
|
27
|
+
supercluster perpetual ISC 7.1.5 Vladimir Agafonkin
|
|
28
|
+
three perpetual MIT 0.135.0 mrdoob
|
|
29
|
+
throttle-debounce perpetual MIT 5.0.0 Ivan Nikolić
|
|
30
|
+
to-px perpetual MIT 1.1.0 Mikola Lysenko
|
|
31
|
+
topojson-client perpetual ISC 3.1.0 Mike Bostock
|
|
32
|
+
tslib perpetual 0BSD 2.3.1 Microsoft Corp.
|
|
33
|
+
@rollup/plugin-json perpetual MIT 4.1.0 rollup
|
|
34
|
+
@zerollup/ts-transform-paths perpetual MIT 1.7.18 Stefan Zerkalica
|
|
35
|
+
rimraf perpetual ISC 3.0.2 Isaac Z. Schlueter
|
|
36
|
+
rollup perpetual MIT 2.61.1 Rich Harris
|
|
37
|
+
rollup-plugin-commonjs perpetual MIT 10.1.0 Rich Harris
|
|
38
|
+
rollup-plugin-node-resolve perpetual MIT 5.2.0 Rich Harris
|
|
39
|
+
rollup-plugin-postcss perpetual MIT 4.0.1 EGOIST
|
|
40
|
+
rollup-plugin-rename-node-modules perpetual MIT 1.3.1 Lazyuki
|
|
41
|
+
rollup-plugin-terser perpetual MIT 7.0.2 Bogdan Chadkin
|
|
42
|
+
rollup-plugin-typescript2 perpetual MIT 0.31.1 @ezolenko
|
|
43
|
+
rollup-plugin-visualizer perpetual MIT 4.2.2 Denis Bardadym
|
package/maps.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/maps'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unovis/ts",
|
|
3
3
|
"description": "Modular data visualization framework for React, Angular, Svelte, and vanilla TypeScript or JavaScript",
|
|
4
|
-
"version": "1.1.1-beta.
|
|
4
|
+
"version": "1.1.1-beta.7",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/f5/unovis.git",
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import json from '@rollup/plugin-json'
|
|
2
|
+
import typescript from 'rollup-plugin-typescript2'
|
|
3
|
+
import transformPaths from '@zerollup/ts-transform-paths'
|
|
4
|
+
import resolve from 'rollup-plugin-node-resolve'
|
|
5
|
+
import commonjs from 'rollup-plugin-commonjs'
|
|
6
|
+
import postcss from 'rollup-plugin-postcss'
|
|
7
|
+
import renameNodeModules from 'rollup-plugin-rename-node-modules'
|
|
8
|
+
// import visualizer from 'rollup-plugin-visualizer'
|
|
9
|
+
import pkg from './package.json'
|
|
10
|
+
|
|
11
|
+
const d3Libs = ['d3-array', 'd3-axis', 'd3-brush', 'd3-chord', 'd3-collection', 'd3-color',
|
|
12
|
+
'd3-contour', 'd3-dispatch', 'd3-drag', 'd3-dsv', 'd3-ease', 'd3-fetch', 'd3-force',
|
|
13
|
+
'd3-format', 'd3-geo', 'd3-hierarchy', 'd3-interpolate', 'd3-path',
|
|
14
|
+
'd3-polygon', 'd3-quadtree', 'd3-random', 'd3-sankey', 'd3-scale', 'd3-scale-chromatic',
|
|
15
|
+
'd3-selection', 'd3-shape', 'd3-time', 'd3-time-format', 'd3-timer', 'd3-transition',
|
|
16
|
+
'd3-voronoi', 'd3-zoom']
|
|
17
|
+
|
|
18
|
+
const externals = [
|
|
19
|
+
...Object.keys(pkg.dependencies || {}),
|
|
20
|
+
...Object.keys(pkg.peerDependencies || {}),
|
|
21
|
+
...d3Libs,
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
const regexesOfPackages = externals // To prevent having node_modules in the build files
|
|
25
|
+
.map(packageName => new RegExp(`^${packageName}(/.*)?`))
|
|
26
|
+
|
|
27
|
+
const plugins = [
|
|
28
|
+
postcss({
|
|
29
|
+
plugins: [],
|
|
30
|
+
inject: false,
|
|
31
|
+
minimize: true,
|
|
32
|
+
}),
|
|
33
|
+
commonjs(),
|
|
34
|
+
resolve({
|
|
35
|
+
extensions: ['.ts'],
|
|
36
|
+
mainFields: ['jsnext:main', 'module', 'main', 'browser'],
|
|
37
|
+
}),
|
|
38
|
+
json(),
|
|
39
|
+
typescript({
|
|
40
|
+
typescript: require('typescript'),
|
|
41
|
+
transformers: [(service) => transformPaths(service.getProgram())],
|
|
42
|
+
}),
|
|
43
|
+
renameNodeModules(),
|
|
44
|
+
// visualizer({ sourcemap: true, template: 'network' }),
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
export default [
|
|
48
|
+
{
|
|
49
|
+
input: 'src/index.ts',
|
|
50
|
+
external: regexesOfPackages,
|
|
51
|
+
treeshake: false,
|
|
52
|
+
output: {
|
|
53
|
+
dir: 'lib',
|
|
54
|
+
sourcemap: true,
|
|
55
|
+
format: 'esm',
|
|
56
|
+
preserveModules: true,
|
|
57
|
+
preserveModulesRoot: './src',
|
|
58
|
+
},
|
|
59
|
+
plugins,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
input: 'src/maps.ts',
|
|
63
|
+
output: {
|
|
64
|
+
dir: 'lib',
|
|
65
|
+
format: 'esm',
|
|
66
|
+
preserveModules: true,
|
|
67
|
+
preserveModulesRoot: './src',
|
|
68
|
+
},
|
|
69
|
+
plugins,
|
|
70
|
+
},
|
|
71
|
+
]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
module.exports = {
|
|
3
|
+
meta: {
|
|
4
|
+
type: "problem",
|
|
5
|
+
fixable: "code",
|
|
6
|
+
schema: [] // no options
|
|
7
|
+
},
|
|
8
|
+
create: function(context) {
|
|
9
|
+
return {
|
|
10
|
+
MethodDefinition(node) {
|
|
11
|
+
// to fix https://github.com/microsoft/TypeScript/issues/33939
|
|
12
|
+
if (node.kind === 'set') {
|
|
13
|
+
// console.log(node)
|
|
14
|
+
context.report({
|
|
15
|
+
node,
|
|
16
|
+
message: 'Has Setter',
|
|
17
|
+
fix(fixer) {
|
|
18
|
+
return fixer.remove(node)
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
} else if (node.kind === 'get') {
|
|
22
|
+
const start = node.range[0];
|
|
23
|
+
const end = node.value.returnType.range[0]
|
|
24
|
+
context.report({
|
|
25
|
+
node,
|
|
26
|
+
message: 'Has Getter',
|
|
27
|
+
fix(fixer) {
|
|
28
|
+
return fixer.replaceTextRange([start, end], node.key.name)
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { XYComponentConfigInterface, XYComponentConfig } from 'core/xy-component/config'
|
|
2
|
+
|
|
3
|
+
// Types
|
|
4
|
+
import { CurveType } from 'types/curve'
|
|
5
|
+
import { NumericAccessor, StringAccessor } from 'types/accessor'
|
|
6
|
+
|
|
7
|
+
export interface AreaConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {
|
|
8
|
+
/** Curve type from the CurveType enum. Default: `CurveType.MonotoneX` */
|
|
9
|
+
curveType?: CurveType;
|
|
10
|
+
/** Baseline value or accessor function. Default: `undefined` */
|
|
11
|
+
baseline?: NumericAccessor<Datum>;
|
|
12
|
+
/** Opacity value or accessor function. Default: `1` */
|
|
13
|
+
opacity?: NumericAccessor<Datum>;
|
|
14
|
+
/** Optional area cursor. String or accessor function. Default: `null` */
|
|
15
|
+
cursor?: StringAccessor<Datum[]>;
|
|
16
|
+
/** If an area is smaller than 1px, extend it to have 1px height.
|
|
17
|
+
* This setting is useful when some of the area values are zeros or very small so visually they become
|
|
18
|
+
* practically invisible, but you want to show that the data behind them exists and they're not just empty segments.
|
|
19
|
+
* Default: `false` */
|
|
20
|
+
minHeight1Px?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class AreaConfig<Datum> extends XYComponentConfig<Datum> implements AreaConfigInterface<Datum> {
|
|
24
|
+
curveType = CurveType.MonotoneX
|
|
25
|
+
baseline = (): number => 0
|
|
26
|
+
opacity = 1
|
|
27
|
+
cursor = null
|
|
28
|
+
minHeight1Px = false
|
|
29
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { select } from 'd3-selection'
|
|
2
|
+
import { Transition } from 'd3-transition'
|
|
3
|
+
import { area, Area as AreaInterface } from 'd3-shape'
|
|
4
|
+
import { interpolatePath } from 'd3-interpolate-path'
|
|
5
|
+
|
|
6
|
+
// Core
|
|
7
|
+
import { XYComponentCore } from 'core/xy-component'
|
|
8
|
+
|
|
9
|
+
// Utils
|
|
10
|
+
import { getNumber, getString, isArray, isNumber, getStackedExtent, getStackedData, filterDataByRange } from 'utils/data'
|
|
11
|
+
import { smartTransition } from 'utils/d3'
|
|
12
|
+
import { getColor } from 'utils/color'
|
|
13
|
+
|
|
14
|
+
// Types
|
|
15
|
+
import { Curve } from 'types/curve'
|
|
16
|
+
import { NumericAccessor } from 'types/accessor'
|
|
17
|
+
|
|
18
|
+
// Local Types
|
|
19
|
+
import { AreaDatum } from './types'
|
|
20
|
+
|
|
21
|
+
// Config
|
|
22
|
+
import { AreaConfig, AreaConfigInterface } from './config'
|
|
23
|
+
|
|
24
|
+
// Styles
|
|
25
|
+
import * as s from './style'
|
|
26
|
+
|
|
27
|
+
export class Area<Datum> extends XYComponentCore<Datum, AreaConfig<Datum>, AreaConfigInterface<Datum>> {
|
|
28
|
+
static selectors = s
|
|
29
|
+
stacked = true
|
|
30
|
+
config: AreaConfig<Datum> = new AreaConfig()
|
|
31
|
+
areaGen: AreaInterface<AreaDatum>
|
|
32
|
+
private _prevNegative: boolean[] | undefined // To help guessing the stack direction when an accessor was set to null or 0
|
|
33
|
+
|
|
34
|
+
events = {
|
|
35
|
+
[Area.selectors.area]: {},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
constructor (config?: AreaConfigInterface<Datum>) {
|
|
39
|
+
super()
|
|
40
|
+
if (config) this.config.init(config)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
_render (customDuration?: number): void {
|
|
44
|
+
super._render(customDuration)
|
|
45
|
+
const { config, datamodel: { data } } = this
|
|
46
|
+
const duration = isNumber(customDuration) ? customDuration : config.duration
|
|
47
|
+
|
|
48
|
+
const curveGen = Curve[config.curveType]
|
|
49
|
+
this.areaGen = area<AreaDatum>()
|
|
50
|
+
.x(d => d.x)
|
|
51
|
+
.y0(d => d.y0)
|
|
52
|
+
.y1(d => {
|
|
53
|
+
const isSmallerThanPixel = Math.abs(d.y1 - d.y0) < 1
|
|
54
|
+
return d.y1 - ((isSmallerThanPixel && config.minHeight1Px) ? 1 : 0)
|
|
55
|
+
})
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
.curve(curveGen)
|
|
59
|
+
|
|
60
|
+
const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]
|
|
61
|
+
const areaDataX = data.map((d, i) => this.xScale(getNumber(d, config.x, i)))
|
|
62
|
+
|
|
63
|
+
const stacked = getStackedData(data, config.baseline, yAccessors, this._prevNegative)
|
|
64
|
+
this._prevNegative = stacked.map(s => !!s.negative)
|
|
65
|
+
const stackedData: AreaDatum[][] = stacked.map(
|
|
66
|
+
arr => arr.map(
|
|
67
|
+
(d, j) => ({
|
|
68
|
+
y0: this.yScale(d[0]),
|
|
69
|
+
y1: this.yScale(d[1]),
|
|
70
|
+
x: areaDataX[j],
|
|
71
|
+
})
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
// We reverse the data in order to have the first areas to be displayed on top
|
|
76
|
+
// for better visibility when they're close to zero
|
|
77
|
+
const areaMaxIdx = stackedData.length - 1
|
|
78
|
+
const stackedDataReversed = stackedData.reverse()
|
|
79
|
+
const areas = this.g
|
|
80
|
+
.selectAll<SVGPathElement, AreaDatum>(`.${s.area}`)
|
|
81
|
+
.data(stackedDataReversed)
|
|
82
|
+
|
|
83
|
+
const areasEnter = areas.enter().append('path')
|
|
84
|
+
.attr('class', s.area)
|
|
85
|
+
.attr('d', d => this.areaGen(d) || this._emptyPath())
|
|
86
|
+
.style('opacity', 0)
|
|
87
|
+
.style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i))
|
|
88
|
+
|
|
89
|
+
const areasMerged = smartTransition(areasEnter.merge(areas), duration)
|
|
90
|
+
.style('opacity', (d, i) => {
|
|
91
|
+
const isDefined = d.some(p => (p.y0 - p.y1) !== 0)
|
|
92
|
+
return isDefined ? getNumber(d, config.opacity, areaMaxIdx - i) : 0
|
|
93
|
+
})
|
|
94
|
+
.style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i))
|
|
95
|
+
.style('cursor', (d, i) => getString(data, config.cursor, areaMaxIdx - i))
|
|
96
|
+
|
|
97
|
+
if (duration) {
|
|
98
|
+
const transition = areasMerged as Transition<SVGPathElement, AreaDatum[], SVGGElement, AreaDatum[]>
|
|
99
|
+
transition.attrTween('d', (d, i, el) => {
|
|
100
|
+
const previous = select(el[i]).attr('d')
|
|
101
|
+
const next = this.areaGen(d) || this._emptyPath()
|
|
102
|
+
return interpolatePath(previous, next)
|
|
103
|
+
})
|
|
104
|
+
} else {
|
|
105
|
+
areasMerged.attr('d', d => this.areaGen(d) || this._emptyPath())
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
smartTransition(areas.exit(), duration)
|
|
109
|
+
.style('opacity', 0)
|
|
110
|
+
.remove()
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
getYDataExtent (scaleByVisibleData: boolean): number[] {
|
|
114
|
+
const { config, datamodel } = this
|
|
115
|
+
const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]
|
|
116
|
+
|
|
117
|
+
const data = scaleByVisibleData ? filterDataByRange(datamodel.data, this.xScale.domain() as [number, number], config.x) : datamodel.data
|
|
118
|
+
return getStackedExtent(data, config.baseline, ...yAccessors)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
_emptyPath (): string {
|
|
122
|
+
const xRange = this.xScale.range()
|
|
123
|
+
const yDomain = this.yScale.domain() as number[]
|
|
124
|
+
|
|
125
|
+
const y0 = this.yScale((yDomain[0] + yDomain[1]) / 2)
|
|
126
|
+
const y1 = y0
|
|
127
|
+
|
|
128
|
+
return this.areaGen([
|
|
129
|
+
{ y0, y1, x: xRange[0] },
|
|
130
|
+
{ y0, y1, x: xRange[1] },
|
|
131
|
+
])
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { css, injectGlobal } from '@emotion/css'
|
|
1
|
+
import { css, injectGlobal } from '@emotion/css'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export const root = css`
|
|
4
5
|
label: area-component;
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export const globalStyles = injectGlobal`
|
|
7
9
|
:root {
|
|
8
10
|
--vis-area-cursor: default;
|
|
9
11
|
--vis-area-fill-opacity: 1;
|
|
@@ -22,8 +24,8 @@ const globalStyles = injectGlobal `
|
|
|
22
24
|
--vis-area-stroke-color: var(--vis-dark-area-stroke-color);
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
const area = css
|
|
27
|
+
`
|
|
28
|
+
export const area = css`
|
|
27
29
|
label: area;
|
|
28
30
|
cursor: var(--vis-area-cursor);
|
|
29
31
|
fill-opacity: var(--vis-area-fill-opacity);
|
|
@@ -36,7 +38,4 @@ const area = css `
|
|
|
36
38
|
fill-opacity: var(--vis-area-hover-fill-opacity);
|
|
37
39
|
stroke-width: var(--vis-area-hover-stroke-width);
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export { area, globalStyles, root };
|
|
42
|
-
//# sourceMappingURL=style.js.map
|
|
41
|
+
`
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { XYComponentConfigInterface, XYComponentConfig } from 'core/xy-component/config'
|
|
2
|
+
|
|
3
|
+
// Types
|
|
4
|
+
import { AxisType } from 'components/axis/types'
|
|
5
|
+
import { Position } from 'types/position'
|
|
6
|
+
import { FitMode, TrimMode, TextAlign } from 'types/text'
|
|
7
|
+
|
|
8
|
+
// We extend partial XY config interface because x and y properties are optional for Axis
|
|
9
|
+
export interface AxisConfigInterface<Datum> extends Partial<XYComponentConfigInterface<Datum>> {
|
|
10
|
+
/** Axis position: `Position.Top`, `Position.Bottom`, `Position.Right` or `Position.Left`. Default: `undefined` */
|
|
11
|
+
position?: Position | string;
|
|
12
|
+
/** Axis type: `AxisType.X` or `AxisType.Y` */
|
|
13
|
+
type?: AxisType | string;
|
|
14
|
+
/** Extend the axis domain line to be full width or full height. Default: `true` */
|
|
15
|
+
fullSize?: boolean;
|
|
16
|
+
/** Axis label. Default: `undefined` */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Font size of the axis label as CSS string. Default: `null` */
|
|
19
|
+
labelFontSize?: string | null;
|
|
20
|
+
/** Distance between the axis and the label in pixels. Default: `8` */
|
|
21
|
+
labelMargin?: number;
|
|
22
|
+
/** Sets whether to draw the grid lines or not. Default: `true` */
|
|
23
|
+
gridLine?: boolean;
|
|
24
|
+
/** Sets whether to draw the tick lines or not. Default: `true` */
|
|
25
|
+
tickLine?: boolean;
|
|
26
|
+
/** Sets whether to draw the domain line or not. Default: `true` */
|
|
27
|
+
domainLine?: boolean;
|
|
28
|
+
/** Draw the min and max axis ticks only. Default: `false` */
|
|
29
|
+
minMaxTicksOnly?: boolean;
|
|
30
|
+
/** Tick label formatter function. Default: `undefined` */
|
|
31
|
+
tickFormat?: ((tick: number, i: number, ticks: number[]) => string) | ((tick: Date, i: number, ticks: Date[]) => string);
|
|
32
|
+
/** Explicitly set tick values. Default: `undefined` */
|
|
33
|
+
tickValues?: number[];
|
|
34
|
+
/** Set the approximate number of axis ticks (will be passed to D3's axis constructor). Default: `undefined` */
|
|
35
|
+
numTicks?: number;
|
|
36
|
+
/** Tick text fit mode: `FitMode.Wrap` or `FitMode.Trim`. Default: `FitMode.Wrap`. */
|
|
37
|
+
tickTextFitMode?: FitMode | string;
|
|
38
|
+
/** Maximum width in pixels for the tick text to be wrapped or trimmed. Default: `undefined` */
|
|
39
|
+
tickTextWidth?: number;
|
|
40
|
+
/** Tick text wrapping separator. String or array of strings. Default: `' '` */
|
|
41
|
+
tickTextSeparator?: string | string[];
|
|
42
|
+
/** Force word break for ticks when they don't fit. Default: `false` */
|
|
43
|
+
tickTextForceWordBreak?: boolean;
|
|
44
|
+
/** Tick text trim mode: `TrimMode.Start`, `TrimMode.Middle` or `TrimMode.End`. Default: `TrimMode.Middle` */
|
|
45
|
+
tickTextTrimType?: TrimMode | string;
|
|
46
|
+
/** Font size of the tick text as CSS string. Default: `null` */
|
|
47
|
+
tickTextFontSize?: string | null;
|
|
48
|
+
/** Text alignment for ticks: `TextAlign.Left`, `TextAlign.Center` or `TextAlign.Right`. Default: `undefined` */
|
|
49
|
+
tickTextAlign?: TextAlign | string;
|
|
50
|
+
/** The spacing in pixels between the tick and it's label. Default: `8` */
|
|
51
|
+
tickPadding?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export class AxisConfig<Datum> extends XYComponentConfig<Datum> implements AxisConfigInterface<Datum> {
|
|
55
|
+
position = undefined
|
|
56
|
+
type = undefined
|
|
57
|
+
label = undefined
|
|
58
|
+
labelFontSize = null
|
|
59
|
+
gridLine = true
|
|
60
|
+
tickLine = true
|
|
61
|
+
domainLine = true
|
|
62
|
+
numTicks = undefined
|
|
63
|
+
minMaxTicksOnly = false
|
|
64
|
+
tickTextWidth = undefined
|
|
65
|
+
tickTextSeparator = ' '
|
|
66
|
+
tickTextForceWordBreak = false
|
|
67
|
+
tickTextTrimType = TrimMode.Middle
|
|
68
|
+
tickTextFitMode = FitMode.Wrap
|
|
69
|
+
tickTextFontSize = null
|
|
70
|
+
tickTextAlign = undefined
|
|
71
|
+
labelMargin = 8
|
|
72
|
+
tickFormat = undefined
|
|
73
|
+
tickValues = undefined
|
|
74
|
+
fullSize = true
|
|
75
|
+
tickPadding = 8
|
|
76
|
+
}
|