@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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface GraphInputNode {
|
|
2
|
+
id?: number | string;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface GraphInputLink {
|
|
6
|
+
id?: number | string;
|
|
7
|
+
source: number | string | GraphInputNode;
|
|
8
|
+
target: number | string | GraphInputNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type GraphNodeCore<N extends GraphInputNode, L extends GraphInputLink> = N & {
|
|
12
|
+
// eslint-disable-next-line no-use-before-define
|
|
13
|
+
links: GraphLinkCore<N, L>[];
|
|
14
|
+
/** Unique id */
|
|
15
|
+
_id: string;
|
|
16
|
+
/** Index as in the original data array */
|
|
17
|
+
_index: number;
|
|
18
|
+
/** True when the node has links */
|
|
19
|
+
_isConnected: boolean;
|
|
20
|
+
/** Internal state for node rendering */
|
|
21
|
+
_state: Record<string, any>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type GraphLinkCore<N extends GraphInputNode, L extends GraphInputLink> = L & {
|
|
25
|
+
source: GraphNodeCore<N, L>;
|
|
26
|
+
target: GraphNodeCore<N, L>;
|
|
27
|
+
|
|
28
|
+
/** Unique id */
|
|
29
|
+
_id: string;
|
|
30
|
+
/** Index as in the original data array */
|
|
31
|
+
_indexGlobal: number;
|
|
32
|
+
/** Local index, when there are multiple links between two nodes */
|
|
33
|
+
_index: number;
|
|
34
|
+
/** The number of neighbour links */
|
|
35
|
+
_neighbours: number;
|
|
36
|
+
/** Link direction */
|
|
37
|
+
_direction: -1 | 1;
|
|
38
|
+
/** Internal state for link rendering */
|
|
39
|
+
_state: Record<string, any>;
|
|
40
|
+
}
|
package/src/types/map.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export enum Position {
|
|
2
|
+
Top = 'top',
|
|
3
|
+
Bottom = 'bottom',
|
|
4
|
+
Left = 'left',
|
|
5
|
+
Right = 'right',
|
|
6
|
+
Center = 'center',
|
|
7
|
+
Auto = 'auto',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum PositionStrategy {
|
|
11
|
+
Absolute = 'absolute',
|
|
12
|
+
Fixed = 'fixed',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum Arrangement {
|
|
16
|
+
Inside = 'inside',
|
|
17
|
+
Outside = 'outside',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export enum Orientation {
|
|
21
|
+
Horizontal = 'horizontal',
|
|
22
|
+
Vertical = 'vertical',
|
|
23
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
scaleLinear,
|
|
3
|
+
scalePow,
|
|
4
|
+
scaleSqrt,
|
|
5
|
+
scaleLog,
|
|
6
|
+
scaleIdentity,
|
|
7
|
+
scaleTime,
|
|
8
|
+
scaleUtc,
|
|
9
|
+
scaleSequential,
|
|
10
|
+
scaleDiverging,
|
|
11
|
+
scaleQuantize,
|
|
12
|
+
scaleQuantile,
|
|
13
|
+
scaleThreshold,
|
|
14
|
+
scaleOrdinal,
|
|
15
|
+
scaleBand,
|
|
16
|
+
scalePoint,
|
|
17
|
+
ScaleLinear,
|
|
18
|
+
ScalePower,
|
|
19
|
+
ScaleLogarithmic,
|
|
20
|
+
ScaleTime,
|
|
21
|
+
} from 'd3-scale'
|
|
22
|
+
// Todo Ordinal Scales: ScaleOrdinal, ScaleBand, ScalePoint, ScaleThreshold, ScaleQuantile, ScaleQuantize, ScaleDiverging, ScaleSequential
|
|
23
|
+
|
|
24
|
+
export type ContinuousScale = ScaleLinear<number, number> | ScalePower<number, number> | ScaleLogarithmic<number, number> | ScaleTime<number, number>
|
|
25
|
+
|
|
26
|
+
export const Scale = {
|
|
27
|
+
scaleLinear,
|
|
28
|
+
scalePow,
|
|
29
|
+
scaleSqrt,
|
|
30
|
+
scaleLog,
|
|
31
|
+
scaleIdentity,
|
|
32
|
+
scaleTime,
|
|
33
|
+
scaleUtc,
|
|
34
|
+
scaleSequential,
|
|
35
|
+
scaleDiverging,
|
|
36
|
+
scaleQuantize,
|
|
37
|
+
scaleQuantile,
|
|
38
|
+
scaleThreshold,
|
|
39
|
+
scaleOrdinal,
|
|
40
|
+
scaleBand,
|
|
41
|
+
scalePoint,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export enum ScaleDimension {
|
|
45
|
+
X = 'x',
|
|
46
|
+
Y = 'y',
|
|
47
|
+
}
|
package/src/types/svg.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TextAlign } from 'types/text'
|
|
2
|
+
|
|
3
|
+
export type TransformValues = {
|
|
4
|
+
translate: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
scale: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Converts a TextAlign value into an SVG text-anchor attribute value.
|
|
16
|
+
*
|
|
17
|
+
* @param {TextAlign | string} textAlign - The TextAlign value to convert.
|
|
18
|
+
* @returns {'start' | 'middle' | 'end'} The corresponding text-anchor attribute value. Defaults to 'start' if an invalid TextAlign value is provided.
|
|
19
|
+
*/
|
|
20
|
+
export function getTextAnchorFromTextAlign (textAlign: TextAlign | string): 'start' | 'middle' | 'end' {
|
|
21
|
+
switch (textAlign) {
|
|
22
|
+
case TextAlign.Center:
|
|
23
|
+
return 'middle'
|
|
24
|
+
case TextAlign.Right:
|
|
25
|
+
return 'end'
|
|
26
|
+
case TextAlign.Left:
|
|
27
|
+
default:
|
|
28
|
+
return 'start'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye } from 'd3-shape'
|
|
2
|
+
|
|
3
|
+
export enum SymbolType {
|
|
4
|
+
Circle = 'circle',
|
|
5
|
+
Cross = 'cross',
|
|
6
|
+
Diamond = 'diamond',
|
|
7
|
+
Square = 'square',
|
|
8
|
+
Star = 'star',
|
|
9
|
+
Triangle = 'triangle',
|
|
10
|
+
Wye = 'wye',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Symbol = {
|
|
14
|
+
[SymbolType.Circle]: symbolCircle,
|
|
15
|
+
[SymbolType.Cross]: symbolCross,
|
|
16
|
+
[SymbolType.Diamond]: symbolDiamond,
|
|
17
|
+
[SymbolType.Square]: symbolSquare,
|
|
18
|
+
[SymbolType.Star]: symbolStar,
|
|
19
|
+
[SymbolType.Triangle]: symbolTriangle,
|
|
20
|
+
[SymbolType.Wye]: symbolWye,
|
|
21
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export enum TrimMode {
|
|
2
|
+
Start = 'start',
|
|
3
|
+
Middle = 'middle',
|
|
4
|
+
End = 'end',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export enum VerticalAlign {
|
|
8
|
+
Top = 'top',
|
|
9
|
+
Middle = 'middle',
|
|
10
|
+
Bottom = 'bottom',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export enum FitMode {
|
|
14
|
+
Wrap = 'wrap',
|
|
15
|
+
Trim = 'trim',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export enum TextAlign {
|
|
19
|
+
Left = 'left',
|
|
20
|
+
Center = 'center',
|
|
21
|
+
Right = 'right',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type UnovisText = {
|
|
25
|
+
// The text content to be displayed.
|
|
26
|
+
text: string;
|
|
27
|
+
// The font size of the text in pixels.
|
|
28
|
+
fontSize: number;
|
|
29
|
+
// The font family of the text (optional). Default: `'var(--vis-font-family)'`.
|
|
30
|
+
fontFamily?: string;
|
|
31
|
+
// The color of the text (optional).
|
|
32
|
+
color?: string;
|
|
33
|
+
// The line height scaling factor for the text (optional).
|
|
34
|
+
lineHeight?: number;
|
|
35
|
+
// The top margin of the text block in pixels (optional).
|
|
36
|
+
marginTop?: number;
|
|
37
|
+
// The bottom margin of the text block in pixels (optional).
|
|
38
|
+
marginBottom?: number;
|
|
39
|
+
// The font width-to-height ratio (optional).
|
|
40
|
+
fontWidthToHeightRatio?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type UnovisWrappedText = UnovisText & {
|
|
44
|
+
// An array of text lines, where each element represents a single line of text.
|
|
45
|
+
_lines: string[];
|
|
46
|
+
// Estimated height of this text block
|
|
47
|
+
_estimatedHeight: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type UnovisTextOptions = {
|
|
51
|
+
// The maximum width of the text in pixels.
|
|
52
|
+
width?: number;
|
|
53
|
+
// The word separator(s) used to split the text into words.
|
|
54
|
+
separator?: string | string[];
|
|
55
|
+
// The vertical alignment of the text ('top', 'middle', or 'bottom').
|
|
56
|
+
verticalAlign?: VerticalAlign | string;
|
|
57
|
+
// The horizontal text alignment ('left', 'center', or 'right').
|
|
58
|
+
textAlign?: TextAlign | string;
|
|
59
|
+
// Whether to use a fast estimation method or a more accurate one for text calculations.
|
|
60
|
+
fastMode?: boolean;
|
|
61
|
+
// Force word break if they don't fit into the width
|
|
62
|
+
wordBreak?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type UnovisTextFrameOptions = UnovisTextOptions & {
|
|
66
|
+
width: number;
|
|
67
|
+
height?: number;
|
|
68
|
+
x?: number;
|
|
69
|
+
y?: number;
|
|
70
|
+
}
|
|
71
|
+
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
2
|
+
// Global Types
|
|
3
|
+
export * from 'types/accessor'
|
|
4
|
+
export * from 'types/curve'
|
|
5
|
+
export * from 'types/symbol'
|
|
6
|
+
export * from 'types/scale'
|
|
7
|
+
export * from 'types/position'
|
|
8
|
+
export * from 'types/shape'
|
|
9
|
+
export * from 'types/component'
|
|
10
|
+
export * from 'types/text'
|
|
11
|
+
export * from 'types/map'
|
|
12
|
+
export * from 'types/spacing'
|
|
13
|
+
export * from 'types/graph'
|
|
14
|
+
export * from 'types/data'
|
|
15
|
+
export * from 'types/direction'
|
|
16
|
+
|
|
17
|
+
// Component Types
|
|
18
|
+
export * from 'core/component/types'
|
|
19
|
+
export * from 'components/crosshair/types'
|
|
20
|
+
export * from 'components/axis/types'
|
|
21
|
+
export * from 'components/chord-diagram/types'
|
|
22
|
+
export * from 'components/topojson-map/types'
|
|
23
|
+
export * from 'components/leaflet-map/types'
|
|
24
|
+
export * from 'components/leaflet-map/renderer/map-style'
|
|
25
|
+
export * from 'components/graph/types'
|
|
26
|
+
export * from 'components/sankey/types'
|
|
27
|
+
export * from 'components/vis-controls/types'
|
|
28
|
+
export * from 'components/free-brush/types'
|
|
29
|
+
export * from 'components/bullet-legend/types'
|
|
30
|
+
export * from 'components/xy-labels/types'
|
|
31
|
+
export * from 'components/nested-donut/types'
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { color } from 'd3-color'
|
|
2
|
+
|
|
3
|
+
// Core
|
|
4
|
+
import { getCSSColorVariable } from 'styles/colors'
|
|
5
|
+
|
|
6
|
+
// Utils
|
|
7
|
+
import { ColorAccessor, StringAccessor } from 'types/accessor'
|
|
8
|
+
import { getString, isNumber } from 'utils/data'
|
|
9
|
+
import { isStringCSSVariable, getCSSVariableValue } from 'utils/misc'
|
|
10
|
+
|
|
11
|
+
/** Retrieves color from the data if provided, fallbacks to CSS variables if the index was passed */
|
|
12
|
+
export function getColor<T> (
|
|
13
|
+
d: T,
|
|
14
|
+
accessor: ColorAccessor<T>,
|
|
15
|
+
index?: number,
|
|
16
|
+
dontFallbackToCssVar?: boolean
|
|
17
|
+
): string | null {
|
|
18
|
+
if (Array.isArray(accessor) && isFinite(index)) return accessor[index % accessor.length]
|
|
19
|
+
|
|
20
|
+
const value = getString(d, accessor as StringAccessor<T>, index)
|
|
21
|
+
return (value || ((isNumber(index) && !dontFallbackToCssVar) ? `var(${getCSSColorVariable(index)})` : null))
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function hexToRgb (hex: string): { r: number; g: number; b: number } {
|
|
25
|
+
const parsed = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)
|
|
26
|
+
return parsed ? {
|
|
27
|
+
r: parseInt(parsed[1], 16),
|
|
28
|
+
g: parseInt(parsed[2], 16),
|
|
29
|
+
b: parseInt(parsed[3], 16),
|
|
30
|
+
} : { r: 0, g: 0, b: 0 }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function hexToBrightness (hex: string): number {
|
|
34
|
+
const rgb = hexToRgb(hex)
|
|
35
|
+
return (0.2126 * rgb.r + 0.7152 * rgb.g + 0.0722 * rgb.b) / 255
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function getHexValue (s: string, context: HTMLElement | SVGElement): string {
|
|
39
|
+
const hex = isStringCSSVariable(s) ? getCSSVariableValue(s, context) : s
|
|
40
|
+
return color(hex)?.formatHex()
|
|
41
|
+
}
|
package/src/utils/d3.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { interrupt, Transition } from 'd3-transition'
|
|
2
|
+
import { BaseType, Selection } from 'd3-selection'
|
|
3
|
+
|
|
4
|
+
export function smartTransition<Element extends BaseType, Datum, ParentElement extends BaseType, ParentDatum> (
|
|
5
|
+
selection: Selection<Element, Datum, ParentElement, ParentDatum>,
|
|
6
|
+
duration?: number,
|
|
7
|
+
easing?: (normalizedTime: number) => number
|
|
8
|
+
): Selection<Element, Datum, ParentElement, ParentDatum> | Transition<Element, Datum, ParentElement, ParentDatum> {
|
|
9
|
+
selection.nodes().forEach(node => interrupt(node)) // Interrupt active transitions if any
|
|
10
|
+
if (duration) {
|
|
11
|
+
const transition = selection.transition().duration(duration)
|
|
12
|
+
if (easing) transition.ease(easing)
|
|
13
|
+
return transition
|
|
14
|
+
} else return selection
|
|
15
|
+
}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { max, min, mean, bisector } from 'd3-array'
|
|
2
|
+
import { throttle as _throttle } from 'throttle-debounce'
|
|
3
|
+
|
|
4
|
+
// Types
|
|
5
|
+
import { NumericAccessor, StringAccessor, BooleanAccessor, ColorAccessor, GenericAccessor } from 'types/accessor'
|
|
6
|
+
import { StackValuesRecord } from 'types/data'
|
|
7
|
+
|
|
8
|
+
export const isNumber = <T>(a: T): boolean => typeof a === 'number'
|
|
9
|
+
export const isFunction = <T>(a: T): boolean => typeof a === 'function'
|
|
10
|
+
export const isUndefined = <T>(a: T): boolean => a === undefined
|
|
11
|
+
export const isNil = <T>(a: T): boolean => a == null
|
|
12
|
+
export const isString = <T>(a: T): boolean => typeof a === 'string'
|
|
13
|
+
export const isArray = <T>(a: T): boolean => Array.isArray(a)
|
|
14
|
+
export const isObject = <T>(a: T): boolean => (a instanceof Object)
|
|
15
|
+
export const isAClassInstance = <T>(a: T): boolean => a.constructor.name !== 'Function' && a.constructor.name !== 'Object'
|
|
16
|
+
export const isPlainObject = <T>(a: T): boolean => isObject(a) && !isArray(a) && !isFunction(a) && !isAClassInstance(a)
|
|
17
|
+
|
|
18
|
+
export const isEmpty = <T>(obj: T): boolean => {
|
|
19
|
+
return [Object, Array].includes((obj || {}).constructor as ArrayConstructor | ObjectConstructor) &&
|
|
20
|
+
!Object.entries((obj || {})).length
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Based on https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/src/style-spec/util/deep_equal.ts, 3-Clause BSD license
|
|
24
|
+
export const isEqual = (a?: unknown | null, b?: unknown | null, visited: Set<any> = new Set()): boolean => {
|
|
25
|
+
if (Array.isArray(a)) {
|
|
26
|
+
if (!Array.isArray(b) || a.length !== b.length) return false
|
|
27
|
+
|
|
28
|
+
if (visited.has(a)) return true
|
|
29
|
+
else visited.add(a)
|
|
30
|
+
|
|
31
|
+
for (let i = 0; i < a.length; i++) {
|
|
32
|
+
if (!isEqual(a[i], b[i], visited)) return false
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (typeof a === 'object' && a !== null && b !== null) {
|
|
39
|
+
if (!(typeof b === 'object')) return false
|
|
40
|
+
if (a === b) return true
|
|
41
|
+
|
|
42
|
+
const keys = Object.keys(a)
|
|
43
|
+
if (keys.length !== Object.keys(b).length) return false
|
|
44
|
+
|
|
45
|
+
if (visited.has(a)) return true
|
|
46
|
+
else visited.add(a)
|
|
47
|
+
|
|
48
|
+
for (const key in a) {
|
|
49
|
+
if (!isEqual(a[key], b[key], visited)) return false
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return true
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return a === b
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const without = <T>(arr: Array<T>, ...args: T[]): Array<T> => arr.filter(item => !args.includes(item))
|
|
59
|
+
export const flatten = <T>(arr: Array<T | T[]>): Array<T> => arr.flat() as T[]
|
|
60
|
+
export const cloneDeep = <T>(obj: T, stack: Map<any, any> = new Map()): T => {
|
|
61
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
62
|
+
return obj
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (obj instanceof Date) {
|
|
66
|
+
return new Date(obj.getTime()) as unknown as T
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (obj instanceof Array) {
|
|
70
|
+
const clone: unknown[] = []
|
|
71
|
+
stack.set(obj, clone)
|
|
72
|
+
for (const item of obj) {
|
|
73
|
+
clone.push(stack.has(item) ? stack.get(item) : cloneDeep(item, stack))
|
|
74
|
+
}
|
|
75
|
+
return clone as unknown as T
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Class instances will be copied without cloning
|
|
79
|
+
if (isAClassInstance(obj)) {
|
|
80
|
+
const clone = obj
|
|
81
|
+
return clone
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (obj instanceof Object) {
|
|
85
|
+
const clone = {} as T
|
|
86
|
+
stack.set(obj, clone)
|
|
87
|
+
const objAsRecord = obj as Record<string | number, unknown>
|
|
88
|
+
Object.keys(obj)
|
|
89
|
+
.reduce((newObj: typeof objAsRecord, key: string | number): typeof objAsRecord => {
|
|
90
|
+
newObj[key] = stack.has(objAsRecord[key]) ? stack.get(objAsRecord[key]) : cloneDeep(objAsRecord[key], stack)
|
|
91
|
+
return newObj
|
|
92
|
+
}, clone as typeof objAsRecord)
|
|
93
|
+
|
|
94
|
+
return clone
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return obj
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
export const merge = <T, K>(obj1: T, obj2: K, visited: Map<any, any> = new Map()): T & K => {
|
|
102
|
+
type Rec = Record<string | number, unknown>
|
|
103
|
+
|
|
104
|
+
if (!obj1 || !obj2) return obj1 as T & K
|
|
105
|
+
if ((obj1 as unknown) === (obj2 as unknown)) return obj1 as T & K
|
|
106
|
+
|
|
107
|
+
const newObj = (isAClassInstance(obj1 as Rec) ? obj1 : cloneDeep(obj1)) as T & K
|
|
108
|
+
|
|
109
|
+
// Taking care of recursive structures
|
|
110
|
+
if (visited.has(obj2)) return visited.get(obj2)
|
|
111
|
+
else visited.set(obj2, newObj)
|
|
112
|
+
|
|
113
|
+
Object.keys(obj2 as Rec).forEach(key => {
|
|
114
|
+
if (isPlainObject((obj1 as Rec)[key]) && isPlainObject((obj2 as Rec)[key])) {
|
|
115
|
+
(newObj as Rec)[key] = merge((obj1 as Rec)[key], (obj2 as Rec)[key], visited)
|
|
116
|
+
} else if (isAClassInstance(obj2 as Rec)) {
|
|
117
|
+
(newObj as Rec)[key] = obj2
|
|
118
|
+
} else {
|
|
119
|
+
(newObj as Rec)[key] = cloneDeep((obj2 as Rec)[key])
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
return newObj
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const omit = <T extends Record<string | number | symbol, unknown>>(obj: T, props: Array<keyof T>): Partial<T> => {
|
|
127
|
+
obj = { ...obj }
|
|
128
|
+
props.forEach(prop => delete obj[prop])
|
|
129
|
+
return obj
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const groupBy = <T extends Record<string | number, any>> (arr: T[], accessor: (a: T) => string | number): Record<string | number, T[]> => {
|
|
133
|
+
return arr.reduce(
|
|
134
|
+
(grouped, v, i, a, k = accessor(v)) => (((grouped[k] || (grouped[k] = [])).push(v), grouped)),
|
|
135
|
+
{} as Record<string | number, T[]>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export const sortBy = <T>(arr: Array<T>, accessor: (a: T) => string | number): Array<T> => {
|
|
140
|
+
return arr.concat() // The native sort method modifies the array in place. We use `.concat()` to copy the array first
|
|
141
|
+
.sort((a, b): number => {
|
|
142
|
+
return (accessor(a) > accessor(b)) ? 1 : ((accessor(b) > accessor(a)) ? -1 : 0)
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export const throttle = <T extends (...args: any[]) => any>(
|
|
147
|
+
f: T,
|
|
148
|
+
delay: number,
|
|
149
|
+
options?: {
|
|
150
|
+
noTrailing?: boolean;
|
|
151
|
+
noLeading?: boolean;
|
|
152
|
+
debounceMode?: boolean;
|
|
153
|
+
}
|
|
154
|
+
): _throttle<T> => _throttle(delay, f, options)
|
|
155
|
+
|
|
156
|
+
export function getValue<T, ReturnType> (
|
|
157
|
+
d: T,
|
|
158
|
+
accessor: NumericAccessor<T> | StringAccessor<T> | BooleanAccessor<T> | ColorAccessor<T> | GenericAccessor<ReturnType, T>,
|
|
159
|
+
index?: number
|
|
160
|
+
): ReturnType {
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
162
|
+
if (isFunction(accessor)) return (accessor as Function)(d, index) as (ReturnType | null | undefined)
|
|
163
|
+
else return accessor as unknown as (ReturnType | null | undefined)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function getString<T> (d: T, accessor: StringAccessor<T>, i?: number): string | null | undefined {
|
|
167
|
+
return getValue<T, string>(d, accessor, i)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function getNumber<T> (d: T, accessor: NumericAccessor<T>, i?: number): number | null | undefined {
|
|
171
|
+
return getValue<T, number>(d, accessor, i)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function getBoolean<T> (d: T, accessor: BooleanAccessor<T>, i?: number): boolean | null | undefined {
|
|
175
|
+
return getValue<T, boolean>(d, accessor, i)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function clean<T> (data: T[]): T[] {
|
|
179
|
+
return data.filter(d => d && !isNumber(d))
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function clamp (d: number, min: number, max: number): number {
|
|
183
|
+
return Math.min(Math.max(d, min), max)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export function unique<T> (array: T[]): T[] {
|
|
187
|
+
return Array.from(new Set(array))
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export function countUnique<T> (array: T[], accessor = d => d): number {
|
|
191
|
+
return new Set(array.map(d => accessor(d))).size
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function arrayOfIndices (n: number): number[] {
|
|
195
|
+
return [...Array(n).keys()]
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export function shallowDiff (o1: Record<string, unknown> = {}, o2: Record<string, unknown> = {}): Record<string, unknown> {
|
|
199
|
+
return Object.keys(o2).reduce((diff, key) => {
|
|
200
|
+
if (o1[key] === o2[key]) return diff
|
|
201
|
+
return {
|
|
202
|
+
...diff,
|
|
203
|
+
[key]: o2[key],
|
|
204
|
+
}
|
|
205
|
+
}, {})
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function getStackedExtent<Datum> (data: Datum[], ...acs: NumericAccessor<Datum>[]): (number | undefined)[] {
|
|
209
|
+
if (!data) return [undefined, undefined]
|
|
210
|
+
if (isArray(acs)) {
|
|
211
|
+
let minValue = 0
|
|
212
|
+
let maxValue = 0
|
|
213
|
+
data.forEach((d, i) => {
|
|
214
|
+
let positiveStack = 0
|
|
215
|
+
let negativeStack = 0
|
|
216
|
+
for (const a of acs as NumericAccessor<Datum>[]) {
|
|
217
|
+
const value = getNumber(d, a, i) || 0
|
|
218
|
+
if (value >= 0) positiveStack += value
|
|
219
|
+
else negativeStack += value
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (positiveStack > maxValue) maxValue = positiveStack
|
|
223
|
+
if (negativeStack < minValue) minValue = negativeStack
|
|
224
|
+
})
|
|
225
|
+
return [minValue, maxValue]
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export function getStackedValues<Datum> (d: Datum, index: number, ...acs: NumericAccessor<Datum>[]): (number | undefined)[] {
|
|
230
|
+
const values = []
|
|
231
|
+
|
|
232
|
+
let positiveStack = 0
|
|
233
|
+
let negativeStack = 0
|
|
234
|
+
for (const a of acs as NumericAccessor<Datum>[]) {
|
|
235
|
+
const value = getNumber(d, a, index) || 0
|
|
236
|
+
if (value >= 0) {
|
|
237
|
+
values.push(positiveStack += value)
|
|
238
|
+
} else {
|
|
239
|
+
values.push(negativeStack += value)
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return values
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function getStackedData<Datum> (
|
|
247
|
+
data: Datum[],
|
|
248
|
+
baseline: NumericAccessor<Datum>,
|
|
249
|
+
acs: NumericAccessor<Datum>[],
|
|
250
|
+
prevNegative?: boolean[] // to help guessing the stack direction (positive/negative) when the values are 0 or null
|
|
251
|
+
): StackValuesRecord[] {
|
|
252
|
+
const baselineValues = data.map((d, i) => getNumber(d, baseline, i) || 0)
|
|
253
|
+
const isNegativeStack = acs.map((a, j) => {
|
|
254
|
+
const average = mean(data, (d, i) => getNumber(d, a, i) || 0)
|
|
255
|
+
return (average === 0 && Array.isArray(prevNegative)) ? prevNegative[j] : average < 0
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
const stackedData: StackValuesRecord[] = acs.map(() => [])
|
|
259
|
+
data.forEach((d, i) => {
|
|
260
|
+
let positiveStack = baselineValues[i]
|
|
261
|
+
let negativeStack = baselineValues[i]
|
|
262
|
+
acs.forEach((a, j) => {
|
|
263
|
+
const value = getNumber(d, a, i) || 0
|
|
264
|
+
if (!isNegativeStack[j]) {
|
|
265
|
+
stackedData[j].push([positiveStack, positiveStack += value])
|
|
266
|
+
} else {
|
|
267
|
+
stackedData[j].push([negativeStack, negativeStack += value])
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
// Fill in additional stack information
|
|
273
|
+
stackedData.forEach((stack, i) => {
|
|
274
|
+
stack.negative = isNegativeStack[i]
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
stackedData.filter(s => s.negative)
|
|
278
|
+
.forEach((s, i, arr) => {
|
|
279
|
+
s.ending = i === arr.length - 1
|
|
280
|
+
})
|
|
281
|
+
|
|
282
|
+
stackedData.filter(s => !s.negative)
|
|
283
|
+
.forEach((s, i, arr) => {
|
|
284
|
+
s.ending = i === arr.length - 1
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
return stackedData
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export function getMin<Datum> (data: Datum[], ...acs: NumericAccessor<Datum>[]): number | undefined {
|
|
291
|
+
if (!data) return undefined
|
|
292
|
+
const minValue = min(data, (d, i) => min(acs as NumericAccessor<Datum>[], a => getNumber(d, a, i)))
|
|
293
|
+
return minValue
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export function getMax<Datum> (data: Datum[], ...acs: NumericAccessor<Datum>[]): number | undefined {
|
|
297
|
+
if (!data) return undefined
|
|
298
|
+
const maxValue = max(data, (d, i) => max(acs as NumericAccessor<Datum>[], a => getNumber(d, a, i)))
|
|
299
|
+
return maxValue
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export function getExtent<Datum> (data: Datum[], ...acs: NumericAccessor<Datum>[]): (number | undefined)[] {
|
|
303
|
+
return [getMin(data, ...acs), getMax(data, ...acs)]
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export function getNearest<Datum> (data: Datum[], value: number, accessor: NumericAccessor<Datum>): Datum {
|
|
307
|
+
if (data.length <= 1) return data[0]
|
|
308
|
+
|
|
309
|
+
const values = data.map((d, i) => getNumber(d, accessor, i))
|
|
310
|
+
values.sort((a, b) => a - b)
|
|
311
|
+
|
|
312
|
+
const xBisector = bisector(d => d).left
|
|
313
|
+
const index = xBisector(values, value, 1, data.length - 1)
|
|
314
|
+
return value - values[index - 1] > values[index] - value ? data[index] : data[index - 1]
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export function filterDataByRange<Datum> (data: Datum[], range: [number, number], accessor: NumericAccessor<Datum>): Datum[] {
|
|
318
|
+
const filteredData = data.filter((d, i) => {
|
|
319
|
+
const value = getNumber(d, accessor, i)
|
|
320
|
+
return (value >= range[0]) && (value < range[1])
|
|
321
|
+
})
|
|
322
|
+
|
|
323
|
+
return filteredData
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export function isNumberWithinRange (value: number, range: [number, number]): boolean {
|
|
327
|
+
return (value >= range[0]) && (value <= range[1])
|
|
328
|
+
}
|