@unovis/ts 1.1.1-beta.6 → 1.1.1-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declaration.d.ts +1 -0
- package/index.ts +1 -0
- package/licences.txt +43 -0
- package/maps.ts +1 -0
- package/package.json +1 -1
- package/rollup.config.js +71 -0
- package/rules/ts-getter-setter.js +35 -0
- package/src/components/area/config.ts +29 -0
- package/src/components/area/index.ts +133 -0
- package/{components/area/style.js → src/components/area/style.ts} +9 -10
- package/src/components/area/types.ts +2 -0
- package/src/components/axis/config.ts +76 -0
- package/src/components/axis/index.ts +363 -0
- package/{components/axis/style.js → src/components/axis/style.ts} +27 -22
- package/src/components/axis/types.ts +4 -0
- package/src/components/brush/config.ts +51 -0
- package/src/components/brush/index.ts +233 -0
- package/{components/brush/style.js → src/components/brush/style.ts} +15 -14
- package/src/components/brush/types.ts +8 -0
- package/src/components/bullet-legend/config.ts +38 -0
- package/src/components/bullet-legend/index.ts +104 -0
- package/{components/bullet-legend/style.js → src/components/bullet-legend/style.ts} +18 -16
- package/src/components/bullet-legend/types.ts +7 -0
- package/src/components/chord-diagram/config.ts +53 -0
- package/src/components/chord-diagram/index.ts +401 -0
- package/src/components/chord-diagram/modules/label.ts +155 -0
- package/src/components/chord-diagram/modules/link.ts +91 -0
- package/src/components/chord-diagram/modules/node.ts +80 -0
- package/{components/chord-diagram/style.js → src/components/chord-diagram/style.ts} +39 -30
- package/src/components/chord-diagram/types.ts +68 -0
- package/src/components/crosshair/config.ts +48 -0
- package/src/components/crosshair/index.ts +220 -0
- package/{components/crosshair/style.js → src/components/crosshair/style.ts} +12 -12
- package/src/components/crosshair/types.ts +15 -0
- package/src/components/donut/config.ts +65 -0
- package/src/components/donut/index.ts +148 -0
- package/src/components/donut/modules/arc.ts +86 -0
- package/{components/donut/style.js → src/components/donut/style.ts} +20 -18
- package/src/components/donut/types.ts +17 -0
- package/src/components/flow-legend/config.ts +31 -0
- package/src/components/flow-legend/index.ts +103 -0
- package/{components/flow-legend/style.js → src/components/flow-legend/style.ts} +25 -21
- package/src/components/flow-legend/types.ts +10 -0
- package/src/components/free-brush/config.ts +54 -0
- package/src/components/free-brush/index.ts +207 -0
- package/{components/free-brush/style.js → src/components/free-brush/style.ts} +12 -12
- package/src/components/free-brush/types.ts +8 -0
- package/src/components/graph/config.ts +280 -0
- package/src/components/graph/index.ts +809 -0
- package/src/components/graph/modules/layout-helpers.ts +96 -0
- package/src/components/graph/modules/layout.ts +502 -0
- package/src/components/graph/modules/link/helper.ts +105 -0
- package/src/components/graph/modules/link/index.ts +302 -0
- package/{components/graph/modules/link/style.js → src/components/graph/modules/link/style.ts} +45 -34
- package/src/components/graph/modules/node/helper.ts +162 -0
- package/src/components/graph/modules/node/index.ts +343 -0
- package/{components/graph/modules/node/style.js → src/components/graph/modules/node/style.ts} +72 -52
- package/src/components/graph/modules/panel/helper.ts +160 -0
- package/src/components/graph/modules/panel/index.ts +137 -0
- package/{components/graph/modules/panel/style.js → src/components/graph/modules/panel/style.ts} +42 -32
- package/src/components/graph/modules/shape.ts +108 -0
- package/src/components/graph/modules/zoom-levels.ts +6 -0
- package/src/components/graph/style.ts +72 -0
- package/src/components/graph/types.ts +152 -0
- package/src/components/grouped-bar/config.ts +40 -0
- package/src/components/grouped-bar/index.ts +325 -0
- package/{components/grouped-bar/style.js → src/components/grouped-bar/style.ts} +15 -14
- package/src/components/leaflet-flow-map/config.ts +60 -0
- package/src/components/leaflet-flow-map/index.ts +279 -0
- package/src/components/leaflet-flow-map/renderer-utils.ts +14 -0
- package/src/components/leaflet-flow-map/renderer.ts +146 -0
- package/{components/leaflet-flow-map/shaders.js → src/components/leaflet-flow-map/shaders.ts} +4 -7
- package/src/components/leaflet-flow-map/types.ts +18 -0
- package/src/components/leaflet-map/config.ts +234 -0
- package/src/components/leaflet-map/index.ts +808 -0
- package/src/components/leaflet-map/leaflet.css +625 -0
- package/src/components/leaflet-map/modules/clusterBackground.ts +34 -0
- package/src/components/leaflet-map/modules/donut.ts +37 -0
- package/src/components/leaflet-map/modules/map.ts +178 -0
- package/src/components/leaflet-map/modules/node.ts +208 -0
- package/src/components/leaflet-map/modules/selectionRing.ts +63 -0
- package/src/components/leaflet-map/modules/utils.ts +290 -0
- package/{components → src/components}/leaflet-map/renderer/leaflet-maplibre-gl.js +76 -78
- package/src/components/leaflet-map/renderer/map-style.ts +24 -0
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json +35 -0
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json +35 -0
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json +2185 -0
- package/src/components/leaflet-map/renderer/mapboxgl-layer.ts +43 -0
- package/src/components/leaflet-map/renderer/mapboxgl-utils.ts +40 -0
- package/{components → src/components}/leaflet-map/renderer/maplibre-gl.css.js +2 -4
- package/src/components/leaflet-map/style.ts +217 -0
- package/src/components/leaflet-map/types.ts +75 -0
- package/src/components/line/config.ts +34 -0
- package/src/components/line/index.ts +188 -0
- package/{components/line/style.js → src/components/line/style.ts} +18 -16
- package/src/components/line/types.ts +3 -0
- package/src/components/nested-donut/config.ts +75 -0
- package/src/components/nested-donut/index.ts +176 -0
- package/src/components/nested-donut/modules/arc.ts +78 -0
- package/src/components/nested-donut/modules/label.ts +63 -0
- package/src/components/nested-donut/style.ts +82 -0
- package/src/components/nested-donut/types.ts +29 -0
- package/src/components/sankey/config.ts +195 -0
- package/src/components/sankey/index.ts +387 -0
- package/src/components/sankey/modules/label.ts +228 -0
- package/src/components/sankey/modules/link.ts +141 -0
- package/src/components/sankey/modules/node.ts +221 -0
- package/{components/sankey/style.js → src/components/sankey/style.ts} +60 -44
- package/src/components/sankey/types.ts +95 -0
- package/src/components/scatter/config.ts +49 -0
- package/src/components/scatter/index.ts +220 -0
- package/src/components/scatter/modules/point.ts +123 -0
- package/src/components/scatter/modules/utils.ts +150 -0
- package/{components/scatter/style.js → src/components/scatter/style.ts} +15 -14
- package/src/components/scatter/types.ts +21 -0
- package/src/components/stacked-bar/config.ts +42 -0
- package/src/components/stacked-bar/index.ts +267 -0
- package/{components/stacked-bar/style.js → src/components/stacked-bar/style.ts} +15 -14
- package/src/components/stacked-bar/types.ts +5 -0
- package/src/components/timeline/config.ts +49 -0
- package/src/components/timeline/index.ts +302 -0
- package/{components/timeline/style.js → src/components/timeline/style.ts} +39 -30
- package/src/components/tooltip/config.ts +69 -0
- package/src/components/tooltip/index.ts +220 -0
- package/{components → src/components}/tooltip/style.js +11 -14
- package/src/components/topojson-map/config.ts +124 -0
- package/src/components/topojson-map/index.ts +436 -0
- package/{components/topojson-map/style.js → src/components/topojson-map/style.ts} +33 -26
- package/src/components/topojson-map/types.ts +123 -0
- package/src/components/topojson-map/utils.ts +29 -0
- package/src/components/vis-controls/config.ts +16 -0
- package/src/components/vis-controls/index.ts +68 -0
- package/{components/vis-controls/style.js → src/components/vis-controls/style.ts} +34 -27
- package/src/components/vis-controls/types.ts +14 -0
- package/src/components/xy-labels/config.ts +56 -0
- package/src/components/xy-labels/index.ts +109 -0
- package/src/components/xy-labels/modules/label.ts +140 -0
- package/{components/xy-labels/style.js → src/components/xy-labels/style.ts} +15 -14
- package/src/components/xy-labels/types.ts +26 -0
- package/src/components.ts +56 -0
- package/src/containers/single-container/config.ts +15 -0
- package/src/containers/single-container/index.ts +150 -0
- package/src/containers/xy-container/config.ts +112 -0
- package/src/containers/xy-container/index.ts +407 -0
- package/src/containers.ts +6 -0
- package/src/core/component/config.ts +61 -0
- package/src/core/component/index.ts +154 -0
- package/src/core/component/types.ts +9 -0
- package/src/core/config/index.ts +12 -0
- package/src/core/container/config.ts +56 -0
- package/src/core/container/index.ts +136 -0
- package/src/core/xy-component/config.ts +46 -0
- package/src/core/xy-component/index.ts +90 -0
- package/src/data-models/core.ts +15 -0
- package/src/data-models/graph.ts +138 -0
- package/src/data-models/map-graph.ts +72 -0
- package/src/data-models/map.ts +18 -0
- package/src/data-models/series.ts +16 -0
- package/src/index.ts +7 -0
- package/src/maps/china-provinces.json +1 -0
- package/src/maps/fr-regions.json +1 -0
- package/src/maps/germany-regions.json +1 -0
- package/src/maps/ind-regions.json +1 -0
- package/src/maps/uk-regions.json +1 -0
- package/src/maps/us-counties.json +1 -0
- package/src/maps/us-states.json +1 -0
- package/src/maps/world-110m-alpha.json +1 -0
- package/src/maps/world-simple.json +1 -0
- package/src/maps/world-simplest.json +1 -0
- package/src/maps.ts +34 -0
- package/src/styles/colors.ts +28 -0
- package/src/styles/index.ts +38 -0
- package/{styles/sizes.js → src/styles/sizes.ts} +6 -8
- package/src/types/accessor.ts +5 -0
- package/src/types/component.ts +15 -0
- package/src/types/curve.ts +62 -0
- package/src/types/data.ts +5 -0
- package/src/types/direction.ts +6 -0
- package/src/types/graph.ts +40 -0
- package/src/types/map.ts +5 -0
- package/src/types/misc.ts +10 -0
- package/src/types/position.ts +23 -0
- package/src/types/scale.ts +47 -0
- package/src/types/shape.ts +7 -0
- package/src/types/spacing.ts +6 -0
- package/src/types/svg.ts +32 -0
- package/src/types/symbol.ts +21 -0
- package/src/types/text.ts +71 -0
- package/src/types.ts +31 -0
- package/src/utils/color.ts +41 -0
- package/src/utils/d3.ts +15 -0
- package/src/utils/data.ts +328 -0
- package/src/utils/html.ts +13 -0
- package/src/utils/map.ts +29 -0
- package/src/utils/misc.ts +54 -0
- package/src/utils/path.ts +196 -0
- package/src/utils/scale.ts +1 -0
- package/src/utils/style.ts +37 -0
- package/src/utils/svg.ts +49 -0
- package/src/utils/text.ts +529 -0
- package/src/utils/type.ts +9 -0
- package/tsconfig.json +29 -0
- package/components/area/config.d.ts +0 -25
- package/components/area/config.js +0 -16
- package/components/area/config.js.map +0 -1
- package/components/area/index.d.ts +0 -19
- package/components/area/index.js +0 -102
- package/components/area/index.js.map +0 -1
- package/components/area/style.d.ts +0 -3
- package/components/area/style.js.map +0 -1
- package/components/area/types.d.ts +0 -6
- package/components/axis/config.d.ts +0 -71
- package/components/axis/config.js +0 -32
- package/components/axis/config.js.map +0 -1
- package/components/axis/index.d.ts +0 -44
- package/components/axis/index.js +0 -305
- package/components/axis/index.js.map +0 -1
- package/components/axis/style.d.ts +0 -9
- package/components/axis/style.js.map +0 -1
- package/components/axis/types.d.ts +0 -4
- package/components/axis/types.js +0 -8
- package/components/axis/types.js.map +0 -1
- package/components/brush/config.d.ts +0 -42
- package/components/brush/config.js +0 -24
- package/components/brush/config.js.map +0 -1
- package/components/brush/index.d.ts +0 -28
- package/components/brush/index.js +0 -199
- package/components/brush/index.js.map +0 -1
- package/components/brush/style.d.ts +0 -5
- package/components/brush/style.js.map +0 -1
- package/components/brush/types.d.ts +0 -7
- package/components/brush/types.js +0 -8
- package/components/brush/types.js.map +0 -1
- package/components/bullet-legend/config.d.ts +0 -34
- package/components/bullet-legend/config.js +0 -16
- package/components/bullet-legend/config.js.map +0 -1
- package/components/bullet-legend/index.d.ts +0 -19
- package/components/bullet-legend/index.js +0 -79
- package/components/bullet-legend/index.js.map +0 -1
- package/components/bullet-legend/style.d.ts +0 -6
- package/components/bullet-legend/style.js.map +0 -1
- package/components/bullet-legend/types.d.ts +0 -7
- package/components/bullet-legend/types.js +0 -2
- package/components/bullet-legend/types.js.map +0 -1
- package/components/chord-diagram/config.d.ts +0 -44
- package/components/chord-diagram/config.js +0 -25
- package/components/chord-diagram/config.js.map +0 -1
- package/components/chord-diagram/index.d.ts +0 -42
- package/components/chord-diagram/index.js +0 -305
- package/components/chord-diagram/index.js.map +0 -1
- package/components/chord-diagram/modules/label.d.ts +0 -8
- package/components/chord-diagram/modules/label.js +0 -115
- package/components/chord-diagram/modules/label.js.map +0 -1
- package/components/chord-diagram/modules/link.d.ts +0 -21
- package/components/chord-diagram/modules/link.js +0 -63
- package/components/chord-diagram/modules/link.js.map +0 -1
- package/components/chord-diagram/modules/node.d.ts +0 -17
- package/components/chord-diagram/modules/node.js +0 -52
- package/components/chord-diagram/modules/node.js.map +0 -1
- package/components/chord-diagram/style.d.ts +0 -13
- package/components/chord-diagram/style.js.map +0 -1
- package/components/chord-diagram/types.d.ts +0 -58
- package/components/chord-diagram/types.js +0 -8
- package/components/chord-diagram/types.js.map +0 -1
- package/components/crosshair/config.d.ts +0 -43
- package/components/crosshair/config.js +0 -19
- package/components/crosshair/config.js.map +0 -1
- package/components/crosshair/index.d.ts +0 -35
- package/components/crosshair/index.js +0 -183
- package/components/crosshair/index.js.map +0 -1
- package/components/crosshair/style.d.ts +0 -4
- package/components/crosshair/style.js.map +0 -1
- package/components/crosshair/types.d.ts +0 -13
- package/components/crosshair/types.js +0 -2
- package/components/crosshair/types.js.map +0 -1
- package/components/donut/config.d.ts +0 -59
- package/components/donut/config.js +0 -28
- package/components/donut/config.js.map +0 -1
- package/components/donut/index.d.ts +0 -21
- package/components/donut/index.js +0 -107
- package/components/donut/index.js.map +0 -1
- package/components/donut/modules/arc.d.ts +0 -10
- package/components/donut/modules/arc.js +0 -59
- package/components/donut/modules/arc.js.map +0 -1
- package/components/donut/style.d.ts +0 -7
- package/components/donut/style.js.map +0 -1
- package/components/donut/types.d.ts +0 -20
- package/components/flow-legend/config.d.ts +0 -29
- package/components/flow-legend/config.js +0 -18
- package/components/flow-legend/config.js.map +0 -1
- package/components/flow-legend/index.d.ts +0 -16
- package/components/flow-legend/index.js +0 -75
- package/components/flow-legend/index.js.map +0 -1
- package/components/flow-legend/style.d.ts +0 -8
- package/components/flow-legend/style.js.map +0 -1
- package/components/flow-legend/types.d.ts +0 -9
- package/components/flow-legend/types.js +0 -8
- package/components/flow-legend/types.js.map +0 -1
- package/components/free-brush/config.d.ts +0 -45
- package/components/free-brush/config.js +0 -24
- package/components/free-brush/config.js.map +0 -1
- package/components/free-brush/index.d.ts +0 -20
- package/components/free-brush/index.js +0 -192
- package/components/free-brush/index.js.map +0 -1
- package/components/free-brush/style.d.ts +0 -4
- package/components/free-brush/style.js.map +0 -1
- package/components/free-brush/types.d.ts +0 -7
- package/components/free-brush/types.js +0 -9
- package/components/free-brush/types.js.map +0 -1
- package/components/graph/config.d.ts +0 -238
- package/components/graph/config.js +0 -84
- package/components/graph/config.js.map +0 -1
- package/components/graph/index.d.ts +0 -126
- package/components/graph/index.js +0 -656
- package/components/graph/index.js.map +0 -1
- package/components/graph/modules/layout-helpers.d.ts +0 -21
- package/components/graph/modules/layout-helpers.js +0 -69
- package/components/graph/modules/layout-helpers.js.map +0 -1
- package/components/graph/modules/layout.d.ts +0 -10
- package/components/graph/modules/layout.js +0 -399
- package/components/graph/modules/layout.js.map +0 -1
- package/components/graph/modules/link/helper.d.ts +0 -25
- package/components/graph/modules/link/helper.js +0 -74
- package/components/graph/modules/link/helper.js.map +0 -1
- package/components/graph/modules/link/index.d.ts +0 -11
- package/components/graph/modules/link/index.js +0 -212
- package/components/graph/modules/link/index.js.map +0 -1
- package/components/graph/modules/link/style.d.ts +0 -15
- package/components/graph/modules/link/style.js.map +0 -1
- package/components/graph/modules/node/helper.d.ts +0 -21
- package/components/graph/modules/node/helper.js +0 -126
- package/components/graph/modules/node/helper.js.map +0 -1
- package/components/graph/modules/node/index.d.ts +0 -11
- package/components/graph/modules/node/index.js +0 -252
- package/components/graph/modules/node/index.js.map +0 -1
- package/components/graph/modules/node/style.d.ts +0 -24
- package/components/graph/modules/node/style.js.map +0 -1
- package/components/graph/modules/panel/helper.d.ts +0 -18
- package/components/graph/modules/panel/helper.js +0 -111
- package/components/graph/modules/panel/helper.js.map +0 -1
- package/components/graph/modules/panel/index.d.ts +0 -7
- package/components/graph/modules/panel/index.js +0 -98
- package/components/graph/modules/panel/index.js.map +0 -1
- package/components/graph/modules/panel/style.d.ts +0 -14
- package/components/graph/modules/panel/style.js.map +0 -1
- package/components/graph/modules/shape.d.ts +0 -6
- package/components/graph/modules/shape.js +0 -80
- package/components/graph/modules/shape.js.map +0 -1
- package/components/graph/modules/zoom-levels.d.ts +0 -6
- package/components/graph/modules/zoom-levels.js +0 -10
- package/components/graph/modules/zoom-levels.js.map +0 -1
- package/components/graph/style.d.ts +0 -6
- package/components/graph/style.js +0 -66
- package/components/graph/style.js.map +0 -1
- package/components/graph/types.d.ts +0 -125
- package/components/graph/types.js +0 -30
- package/components/graph/types.js.map +0 -1
- package/components/grouped-bar/config.d.ts +0 -36
- package/components/grouped-bar/config.js +0 -20
- package/components/grouped-bar/config.js.map +0 -1
- package/components/grouped-bar/index.d.ts +0 -32
- package/components/grouped-bar/index.js +0 -249
- package/components/grouped-bar/index.js.map +0 -1
- package/components/grouped-bar/style.d.ts +0 -5
- package/components/grouped-bar/style.js.map +0 -1
- package/components/leaflet-flow-map/config.d.ts +0 -46
- package/components/leaflet-flow-map/config.js +0 -25
- package/components/leaflet-flow-map/config.js.map +0 -1
- package/components/leaflet-flow-map/index.d.ts +0 -52
- package/components/leaflet-flow-map/index.js +0 -220
- package/components/leaflet-flow-map/index.js.map +0 -1
- package/components/leaflet-flow-map/renderer-utils.d.ts +0 -5
- package/components/leaflet-flow-map/renderer-utils.js +0 -15
- package/components/leaflet-flow-map/renderer-utils.js.map +0 -1
- package/components/leaflet-flow-map/renderer.d.ts +0 -26
- package/components/leaflet-flow-map/renderer.js +0 -117
- package/components/leaflet-flow-map/renderer.js.map +0 -1
- package/components/leaflet-flow-map/shaders.d.ts +0 -2
- package/components/leaflet-flow-map/shaders.js.map +0 -1
- package/components/leaflet-flow-map/types.d.ts +0 -23
- package/components/leaflet-map/config.d.ts +0 -193
- package/components/leaflet-map/config.js +0 -71
- package/components/leaflet-map/config.js.map +0 -1
- package/components/leaflet-map/index.d.ts +0 -130
- package/components/leaflet-map/index.js +0 -690
- package/components/leaflet-map/index.js.map +0 -1
- package/components/leaflet-map/leaflet.css.js +0 -5
- package/components/leaflet-map/leaflet.css.js.map +0 -1
- package/components/leaflet-map/modules/clusterBackground.d.ts +0 -5
- package/components/leaflet-map/modules/clusterBackground.js +0 -27
- package/components/leaflet-map/modules/clusterBackground.js.map +0 -1
- package/components/leaflet-map/modules/donut.d.ts +0 -3
- package/components/leaflet-map/modules/donut.js +0 -25
- package/components/leaflet-map/modules/donut.js.map +0 -1
- package/components/leaflet-map/modules/map.d.ts +0 -14
- package/components/leaflet-map/modules/map.js +0 -154
- package/components/leaflet-map/modules/map.js.map +0 -1
- package/components/leaflet-map/modules/node.d.ts +0 -9
- package/components/leaflet-map/modules/node.js +0 -162
- package/components/leaflet-map/modules/node.js.map +0 -1
- package/components/leaflet-map/modules/selectionRing.d.ts +0 -7
- package/components/leaflet-map/modules/selectionRing.js +0 -41
- package/components/leaflet-map/modules/selectionRing.js.map +0 -1
- package/components/leaflet-map/modules/utils.d.ts +0 -50
- package/components/leaflet-map/modules/utils.js +0 -210
- package/components/leaflet-map/modules/utils.js.map +0 -1
- package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +0 -1
- package/components/leaflet-map/renderer/map-style.d.ts +0 -4
- package/components/leaflet-map/renderer/map-style.js +0 -15
- package/components/leaflet-map/renderer/map-style.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js +0 -40
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js +0 -40
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js +0 -4981
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +0 -8
- package/components/leaflet-map/renderer/mapboxgl-layer.js +0 -27
- package/components/leaflet-map/renderer/mapboxgl-layer.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +0 -4
- package/components/leaflet-map/renderer/mapboxgl-utils.js +0 -39
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +0 -1
- package/components/leaflet-map/renderer/maplibre-gl.css.js.map +0 -1
- package/components/leaflet-map/style.d.ts +0 -52
- package/components/leaflet-map/style.js +0 -183
- package/components/leaflet-map/style.js.map +0 -1
- package/components/leaflet-map/types.d.ts +0 -75
- package/components/leaflet-map/types.js +0 -15
- package/components/leaflet-map/types.js.map +0 -1
- package/components/line/config.d.ts +0 -30
- package/components/line/config.js +0 -17
- package/components/line/config.js.map +0 -1
- package/components/line/index.d.ts +0 -27
- package/components/line/index.js +0 -152
- package/components/line/index.js.map +0 -1
- package/components/line/style.d.ts +0 -6
- package/components/line/style.js.map +0 -1
- package/components/line/types.d.ts +0 -12
- package/components/nested-donut/config.d.ts +0 -59
- package/components/nested-donut/config.js +0 -19
- package/components/nested-donut/config.js.map +0 -1
- package/components/nested-donut/index.d.ts +0 -38
- package/components/nested-donut/index.js +0 -133
- package/components/nested-donut/index.js.map +0 -1
- package/components/nested-donut/modules/arc.d.ts +0 -17
- package/components/nested-donut/modules/arc.js +0 -50
- package/components/nested-donut/modules/arc.js.map +0 -1
- package/components/nested-donut/modules/label.d.ts +0 -7
- package/components/nested-donut/modules/label.js +0 -34
- package/components/nested-donut/modules/label.js.map +0 -1
- package/components/nested-donut/style.d.ts +0 -26
- package/components/nested-donut/style.js +0 -70
- package/components/nested-donut/style.js.map +0 -1
- package/components/nested-donut/types.d.ts +0 -24
- package/components/nested-donut/types.js +0 -11
- package/components/nested-donut/types.js.map +0 -1
- package/components/sankey/config.d.ts +0 -162
- package/components/sankey/config.js +0 -65
- package/components/sankey/config.js.map +0 -1
- package/components/sankey/index.d.ts +0 -59
- package/components/sankey/index.js +0 -306
- package/components/sankey/index.js.map +0 -1
- package/components/sankey/modules/label.d.ts +0 -23
- package/components/sankey/modules/label.js +0 -168
- package/components/sankey/modules/label.js.map +0 -1
- package/components/sankey/modules/link.d.ts +0 -14
- package/components/sankey/modules/link.js +0 -108
- package/components/sankey/modules/link.js.map +0 -1
- package/components/sankey/modules/node.d.ts +0 -10
- package/components/sankey/modules/node.js +0 -156
- package/components/sankey/modules/node.js.map +0 -1
- package/components/sankey/style.d.ts +0 -20
- package/components/sankey/style.js.map +0 -1
- package/components/sankey/types.d.ts +0 -84
- package/components/sankey/types.js +0 -34
- package/components/sankey/types.js.map +0 -1
- package/components/scatter/config.d.ts +0 -44
- package/components/scatter/config.js +0 -23
- package/components/scatter/config.js.map +0 -1
- package/components/scatter/index.d.ts +0 -28
- package/components/scatter/index.js +0 -167
- package/components/scatter/index.js.map +0 -1
- package/components/scatter/modules/point.d.ts +0 -7
- package/components/scatter/modules/point.js +0 -86
- package/components/scatter/modules/point.js.map +0 -1
- package/components/scatter/modules/utils.d.ts +0 -11
- package/components/scatter/modules/utils.js +0 -112
- package/components/scatter/modules/utils.js.map +0 -1
- package/components/scatter/style.d.ts +0 -5
- package/components/scatter/style.js.map +0 -1
- package/components/scatter/types.d.ts +0 -19
- package/components/stacked-bar/config.d.ts +0 -38
- package/components/stacked-bar/config.js +0 -20
- package/components/stacked-bar/config.js.map +0 -1
- package/components/stacked-bar/index.d.ts +0 -28
- package/components/stacked-bar/index.js +0 -208
- package/components/stacked-bar/index.js.map +0 -1
- package/components/stacked-bar/style.d.ts +0 -5
- package/components/stacked-bar/style.js.map +0 -1
- package/components/stacked-bar/types.d.ts +0 -5
- package/components/timeline/config.d.ts +0 -43
- package/components/timeline/config.js +0 -24
- package/components/timeline/config.js.map +0 -1
- package/components/timeline/index.d.ts +0 -41
- package/components/timeline/index.js +0 -244
- package/components/timeline/index.js.map +0 -1
- package/components/timeline/style.d.ts +0 -13
- package/components/timeline/style.js.map +0 -1
- package/components/tooltip/config.d.ts +0 -68
- package/components/tooltip/config.js +0 -20
- package/components/tooltip/config.js.map +0 -1
- package/components/tooltip/index.d.ts +0 -36
- package/components/tooltip/index.js +0 -184
- package/components/tooltip/index.js.map +0 -1
- package/components/tooltip/style.js.map +0 -1
- package/components/topojson-map/config.d.ts +0 -99
- package/components/topojson-map/config.js +0 -42
- package/components/topojson-map/config.js.map +0 -1
- package/components/topojson-map/index.d.ts +0 -52
- package/components/topojson-map/index.js +0 -355
- package/components/topojson-map/index.js.map +0 -1
- package/components/topojson-map/style.d.ts +0 -11
- package/components/topojson-map/style.js.map +0 -1
- package/components/topojson-map/types.d.ts +0 -78
- package/components/topojson-map/types.js +0 -80
- package/components/topojson-map/types.js.map +0 -1
- package/components/topojson-map/utils.d.ts +0 -3
- package/components/topojson-map/utils.js +0 -30
- package/components/topojson-map/utils.js.map +0 -1
- package/components/vis-controls/config.d.ts +0 -12
- package/components/vis-controls/config.js +0 -13
- package/components/vis-controls/config.js.map +0 -1
- package/components/vis-controls/index.d.ts +0 -14
- package/components/vis-controls/index.js +0 -52
- package/components/vis-controls/index.js.map +0 -1
- package/components/vis-controls/style.d.ts +0 -11
- package/components/vis-controls/style.js.map +0 -1
- package/components/vis-controls/types.d.ts +0 -13
- package/components/vis-controls/types.js +0 -8
- package/components/vis-controls/types.js.map +0 -1
- package/components/xy-labels/config.d.ts +0 -48
- package/components/xy-labels/config.js +0 -25
- package/components/xy-labels/config.js.map +0 -1
- package/components/xy-labels/index.d.ts +0 -15
- package/components/xy-labels/index.js +0 -87
- package/components/xy-labels/index.js.map +0 -1
- package/components/xy-labels/modules/label.d.ts +0 -9
- package/components/xy-labels/modules/label.js +0 -107
- package/components/xy-labels/modules/label.js.map +0 -1
- package/components/xy-labels/style.d.ts +0 -5
- package/components/xy-labels/style.js.map +0 -1
- package/components/xy-labels/types.d.ts +0 -23
- package/components/xy-labels/types.js +0 -9
- package/components/xy-labels/types.js.map +0 -1
- package/components.d.ts +0 -51
- package/components.js +0 -29
- package/components.js.map +0 -1
- package/containers/single-container/config.d.ts +0 -12
- package/containers/single-container/config.js +0 -12
- package/containers/single-container/config.js.map +0 -1
- package/containers/single-container/index.d.ts +0 -19
- package/containers/single-container/index.js +0 -128
- package/containers/single-container/index.js.map +0 -1
- package/containers/xy-container/config.d.ts +0 -99
- package/containers/xy-container/config.js +0 -30
- package/containers/xy-container/config.js.map +0 -1
- package/containers/xy-container/index.d.ts +0 -34
- package/containers/xy-container/index.js +0 -330
- package/containers/xy-container/index.js.map +0 -1
- package/containers.d.ts +0 -6
- package/containers.js +0 -4
- package/containers.js.map +0 -1
- package/core/component/config.d.ts +0 -58
- package/core/component/config.js +0 -14
- package/core/component/config.js.map +0 -1
- package/core/component/index.d.ts +0 -43
- package/core/component/index.js +0 -118
- package/core/component/index.js.map +0 -1
- package/core/component/types.d.ts +0 -2
- package/core/component/types.js +0 -2
- package/core/component/types.js.map +0 -1
- package/core/config/index.d.ts +0 -3
- package/core/config/index.js +0 -16
- package/core/config/index.js.map +0 -1
- package/core/container/config.d.ts +0 -48
- package/core/container/config.js +0 -29
- package/core/container/config.js.map +0 -1
- package/core/container/index.d.ts +0 -26
- package/core/container/index.js +0 -105
- package/core/container/index.js.map +0 -1
- package/core/xy-component/config.d.ts +0 -38
- package/core/xy-component/config.js +0 -20
- package/core/xy-component/config.js.map +0 -1
- package/core/xy-component/index.d.ts +0 -27
- package/core/xy-component/index.js +0 -74
- package/core/xy-component/index.js.map +0 -1
- package/data-models/core.d.ts +0 -6
- package/data-models/core.js +0 -14
- package/data-models/core.js.map +0 -1
- package/data-models/graph.d.ts +0 -24
- package/data-models/graph.js +0 -107
- package/data-models/graph.js.map +0 -1
- package/data-models/map-graph.d.ts +0 -21
- package/data-models/map-graph.js +0 -62
- package/data-models/map-graph.js.map +0 -1
- package/data-models/map.d.ts +0 -5
- package/data-models/map.js +0 -12
- package/data-models/map.js.map +0 -1
- package/data-models/series.d.ts +0 -6
- package/data-models/series.js +0 -19
- package/data-models/series.js.map +0 -1
- package/index.d.ts +0 -7
- package/index.js +0 -55
- package/index.js.map +0 -1
- package/maps/china-provinces.json.js +0 -140373
- package/maps/fr-regions.json.js +0 -14162
- package/maps/germany-regions.json.js +0 -35760
- package/maps/ind-regions.json.js +0 -290584
- package/maps/uk-regions.json.js +0 -96233
- package/maps/us-counties.json.js +0 -206318
- package/maps/us-states.json.js +0 -16345
- package/maps/world-110m-alpha.json.js +0 -251366
- package/maps/world-simple.json.js +0 -89428
- package/maps/world-simplest.json.js +0 -28175
- package/maps.d.ts +0 -60
- package/maps.js +0 -23
- package/styles/colors.d.ts +0 -7
- package/styles/colors.js +0 -24
- package/styles/colors.js.map +0 -1
- package/styles/index.d.ts +0 -7
- package/styles/index.js +0 -38
- package/styles/index.js.map +0 -1
- package/styles/sizes.d.ts +0 -2
- package/styles/sizes.js.map +0 -1
- package/types/accessor.d.ts +0 -5
- package/types/accessor.js +0 -2
- package/types/accessor.js.map +0 -1
- package/types/component.d.ts +0 -13
- package/types/component.js +0 -14
- package/types/component.js.map +0 -1
- package/types/curve.d.ts +0 -40
- package/types/curve.js +0 -46
- package/types/curve.js.map +0 -1
- package/types/data.d.ts +0 -7
- package/types/data.js +0 -2
- package/types/data.js.map +0 -1
- package/types/direction.d.ts +0 -6
- package/types/direction.js +0 -10
- package/types/direction.js.map +0 -1
- package/types/graph.d.ts +0 -35
- package/types/graph.js +0 -2
- package/types/graph.js.map +0 -1
- package/types/map.d.ts +0 -4
- package/types/map.js +0 -2
- package/types/map.js.map +0 -1
- package/types/misc.d.ts +0 -8
- package/types/position.d.ts +0 -20
- package/types/position.js +0 -27
- package/types/position.js.map +0 -1
- package/types/scale.d.ts +0 -23
- package/types/scale.js +0 -27
- package/types/scale.js.map +0 -1
- package/types/shape.d.ts +0 -7
- package/types/shape.js +0 -11
- package/types/shape.js.map +0 -1
- package/types/spacing.d.ts +0 -6
- package/types/spacing.js +0 -2
- package/types/spacing.js.map +0 -1
- package/types/svg.d.ts +0 -18
- package/types/svg.js +0 -22
- package/types/svg.js.map +0 -1
- package/types/symbol.d.ts +0 -18
- package/types/symbol.js +0 -24
- package/types/symbol.js.map +0 -1
- package/types/text.d.ts +0 -47
- package/types/text.js +0 -26
- package/types/text.js.map +0 -1
- package/types.d.ts +0 -27
- package/types.js +0 -30
- package/types.js.map +0 -1
- package/utils/color.d.ts +0 -10
- package/utils/color.js +0 -32
- package/utils/color.js.map +0 -1
- package/utils/d3.d.ts +0 -3
- package/utils/d3.js +0 -16
- package/utils/d3.js.map +0 -1
- package/utils/data.d.ts +0 -45
- package/utils/data.js +0 -274
- package/utils/data.js.map +0 -1
- package/utils/html.d.ts +0 -1
- package/utils/html.js +0 -16
- package/utils/html.js.map +0 -1
- package/utils/map.d.ts +0 -2
- package/utils/map.js +0 -20
- package/utils/map.js.map +0 -1
- package/utils/misc.d.ts +0 -9
- package/utils/misc.js +0 -47
- package/utils/misc.js.map +0 -1
- package/utils/path.d.ts +0 -23
- package/utils/path.js +0 -144
- package/utils/path.js.map +0 -1
- package/utils/scale.d.ts +0 -1
- package/utils/style.d.ts +0 -6
- package/utils/style.js +0 -24
- package/utils/style.js.map +0 -1
- package/utils/svg.d.ts +0 -3
- package/utils/text.d.ts +0 -139
- package/utils/text.js +0 -443
- package/utils/text.js.map +0 -1
- package/utils/type.d.ts +0 -5
package/types/svg.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { TextAlign } from './text.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Converts a TextAlign value into an SVG text-anchor attribute value.
|
|
5
|
-
*
|
|
6
|
-
* @param {TextAlign | string} textAlign - The TextAlign value to convert.
|
|
7
|
-
* @returns {'start' | 'middle' | 'end'} The corresponding text-anchor attribute value. Defaults to 'start' if an invalid TextAlign value is provided.
|
|
8
|
-
*/
|
|
9
|
-
function getTextAnchorFromTextAlign(textAlign) {
|
|
10
|
-
switch (textAlign) {
|
|
11
|
-
case TextAlign.Center:
|
|
12
|
-
return 'middle';
|
|
13
|
-
case TextAlign.Right:
|
|
14
|
-
return 'end';
|
|
15
|
-
case TextAlign.Left:
|
|
16
|
-
default:
|
|
17
|
-
return 'start';
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { getTextAnchorFromTextAlign };
|
|
22
|
-
//# sourceMappingURL=svg.js.map
|
package/types/svg.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"svg.js","sources":["../../src/types/svg.ts"],"sourcesContent":["import { TextAlign } from 'types/text'\n\nexport type TransformValues = {\n translate: {\n x: number;\n y: number;\n };\n scale: {\n x: number;\n y: number;\n };\n}\n\n/**\n * Converts a TextAlign value into an SVG text-anchor attribute value.\n *\n * @param {TextAlign | string} textAlign - The TextAlign value to convert.\n * @returns {'start' | 'middle' | 'end'} The corresponding text-anchor attribute value. Defaults to 'start' if an invalid TextAlign value is provided.\n */\nexport function getTextAnchorFromTextAlign (textAlign: TextAlign | string): 'start' | 'middle' | 'end' {\n switch (textAlign) {\n case TextAlign.Center:\n return 'middle'\n case TextAlign.Right:\n return 'end'\n case TextAlign.Left:\n default:\n return 'start'\n }\n}\n\n\n"],"names":[],"mappings":";;AAaA;;;;;AAKG;AACG,SAAU,0BAA0B,CAAE,SAA6B,EAAA;AACvE,IAAA,QAAQ,SAAS;QACf,KAAK,SAAS,CAAC,MAAM;AACnB,YAAA,OAAO,QAAQ,CAAA;QACjB,KAAK,SAAS,CAAC,KAAK;AAClB,YAAA,OAAO,KAAK,CAAA;QACd,KAAK,SAAS,CAAC,IAAI,CAAC;AACpB,QAAA;AACE,YAAA,OAAO,OAAO,CAAA;AACjB,KAAA;AACH;;;;"}
|
package/types/symbol.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare enum SymbolType {
|
|
2
|
-
Circle = "circle",
|
|
3
|
-
Cross = "cross",
|
|
4
|
-
Diamond = "diamond",
|
|
5
|
-
Square = "square",
|
|
6
|
-
Star = "star",
|
|
7
|
-
Triangle = "triangle",
|
|
8
|
-
Wye = "wye"
|
|
9
|
-
}
|
|
10
|
-
export declare const Symbol: {
|
|
11
|
-
circle: import("d3-shape").SymbolType;
|
|
12
|
-
cross: import("d3-shape").SymbolType;
|
|
13
|
-
diamond: import("d3-shape").SymbolType;
|
|
14
|
-
square: import("d3-shape").SymbolType;
|
|
15
|
-
star: import("d3-shape").SymbolType;
|
|
16
|
-
triangle: import("d3-shape").SymbolType;
|
|
17
|
-
wye: import("d3-shape").SymbolType;
|
|
18
|
-
};
|
package/types/symbol.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye } from 'd3-shape';
|
|
2
|
-
|
|
3
|
-
var SymbolType;
|
|
4
|
-
(function (SymbolType) {
|
|
5
|
-
SymbolType["Circle"] = "circle";
|
|
6
|
-
SymbolType["Cross"] = "cross";
|
|
7
|
-
SymbolType["Diamond"] = "diamond";
|
|
8
|
-
SymbolType["Square"] = "square";
|
|
9
|
-
SymbolType["Star"] = "star";
|
|
10
|
-
SymbolType["Triangle"] = "triangle";
|
|
11
|
-
SymbolType["Wye"] = "wye";
|
|
12
|
-
})(SymbolType || (SymbolType = {}));
|
|
13
|
-
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
|
-
};
|
|
22
|
-
|
|
23
|
-
export { Symbol, SymbolType };
|
|
24
|
-
//# sourceMappingURL=symbol.js.map
|
package/types/symbol.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbol.js","sources":["../../src/types/symbol.ts"],"sourcesContent":["import { symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye } from 'd3-shape'\n\nexport enum SymbolType {\n Circle = 'circle',\n Cross = 'cross',\n Diamond = 'diamond',\n Square = 'square',\n Star = 'star',\n Triangle = 'triangle',\n Wye = 'wye',\n}\n\nexport const Symbol = {\n [SymbolType.Circle]: symbolCircle,\n [SymbolType.Cross]: symbolCross,\n [SymbolType.Diamond]: symbolDiamond,\n [SymbolType.Square]: symbolSquare,\n [SymbolType.Star]: symbolStar,\n [SymbolType.Triangle]: symbolTriangle,\n [SymbolType.Wye]: symbolWye,\n}\n"],"names":[],"mappings":";;IAEY,WAQX;AARD,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,UAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,UAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrB,IAAA,UAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACb,CAAC,EARW,UAAU,KAAV,UAAU,GAQrB,EAAA,CAAA,CAAA,CAAA;AAEY,MAAA,MAAM,GAAG;AACpB,IAAA,CAAC,UAAU,CAAC,MAAM,GAAG,YAAY;AACjC,IAAA,CAAC,UAAU,CAAC,KAAK,GAAG,WAAW;AAC/B,IAAA,CAAC,UAAU,CAAC,OAAO,GAAG,aAAa;AACnC,IAAA,CAAC,UAAU,CAAC,MAAM,GAAG,YAAY;AACjC,IAAA,CAAC,UAAU,CAAC,IAAI,GAAG,UAAU;AAC7B,IAAA,CAAC,UAAU,CAAC,QAAQ,GAAG,cAAc;AACrC,IAAA,CAAC,UAAU,CAAC,GAAG,GAAG,SAAS;;;;;"}
|
package/types/text.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export declare enum TrimMode {
|
|
2
|
-
Start = "start",
|
|
3
|
-
Middle = "middle",
|
|
4
|
-
End = "end"
|
|
5
|
-
}
|
|
6
|
-
export declare enum VerticalAlign {
|
|
7
|
-
Top = "top",
|
|
8
|
-
Middle = "middle",
|
|
9
|
-
Bottom = "bottom"
|
|
10
|
-
}
|
|
11
|
-
export declare enum FitMode {
|
|
12
|
-
Wrap = "wrap",
|
|
13
|
-
Trim = "trim"
|
|
14
|
-
}
|
|
15
|
-
export declare enum TextAlign {
|
|
16
|
-
Left = "left",
|
|
17
|
-
Center = "center",
|
|
18
|
-
Right = "right"
|
|
19
|
-
}
|
|
20
|
-
export declare type UnovisText = {
|
|
21
|
-
text: string;
|
|
22
|
-
fontSize: number;
|
|
23
|
-
fontFamily?: string;
|
|
24
|
-
color?: string;
|
|
25
|
-
lineHeight?: number;
|
|
26
|
-
marginTop?: number;
|
|
27
|
-
marginBottom?: number;
|
|
28
|
-
fontWidthToHeightRatio?: number;
|
|
29
|
-
};
|
|
30
|
-
export declare type UnovisWrappedText = UnovisText & {
|
|
31
|
-
_lines: string[];
|
|
32
|
-
_estimatedHeight: number;
|
|
33
|
-
};
|
|
34
|
-
export declare type UnovisTextOptions = {
|
|
35
|
-
width?: number;
|
|
36
|
-
separator?: string | string[];
|
|
37
|
-
verticalAlign?: VerticalAlign | string;
|
|
38
|
-
textAlign?: TextAlign | string;
|
|
39
|
-
fastMode?: boolean;
|
|
40
|
-
wordBreak?: boolean;
|
|
41
|
-
};
|
|
42
|
-
export declare type UnovisTextFrameOptions = UnovisTextOptions & {
|
|
43
|
-
width: number;
|
|
44
|
-
height?: number;
|
|
45
|
-
x?: number;
|
|
46
|
-
y?: number;
|
|
47
|
-
};
|
package/types/text.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
var TrimMode;
|
|
2
|
-
(function (TrimMode) {
|
|
3
|
-
TrimMode["Start"] = "start";
|
|
4
|
-
TrimMode["Middle"] = "middle";
|
|
5
|
-
TrimMode["End"] = "end";
|
|
6
|
-
})(TrimMode || (TrimMode = {}));
|
|
7
|
-
var VerticalAlign;
|
|
8
|
-
(function (VerticalAlign) {
|
|
9
|
-
VerticalAlign["Top"] = "top";
|
|
10
|
-
VerticalAlign["Middle"] = "middle";
|
|
11
|
-
VerticalAlign["Bottom"] = "bottom";
|
|
12
|
-
})(VerticalAlign || (VerticalAlign = {}));
|
|
13
|
-
var FitMode;
|
|
14
|
-
(function (FitMode) {
|
|
15
|
-
FitMode["Wrap"] = "wrap";
|
|
16
|
-
FitMode["Trim"] = "trim";
|
|
17
|
-
})(FitMode || (FitMode = {}));
|
|
18
|
-
var TextAlign;
|
|
19
|
-
(function (TextAlign) {
|
|
20
|
-
TextAlign["Left"] = "left";
|
|
21
|
-
TextAlign["Center"] = "center";
|
|
22
|
-
TextAlign["Right"] = "right";
|
|
23
|
-
})(TextAlign || (TextAlign = {}));
|
|
24
|
-
|
|
25
|
-
export { FitMode, TextAlign, TrimMode, VerticalAlign };
|
|
26
|
-
//# sourceMappingURL=text.js.map
|
package/types/text.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sources":["../../src/types/text.ts"],"sourcesContent":["export enum TrimMode {\n Start = 'start',\n Middle = 'middle',\n End = 'end',\n}\n\nexport enum VerticalAlign {\n Top = 'top',\n Middle = 'middle',\n Bottom = 'bottom',\n}\n\nexport enum FitMode {\n Wrap = 'wrap',\n Trim = 'trim',\n}\n\nexport enum TextAlign {\n Left = 'left',\n Center = 'center',\n Right = 'right',\n}\n\nexport type UnovisText = {\n // The text content to be displayed.\n text: string;\n // The font size of the text in pixels.\n fontSize: number;\n // The font family of the text (optional). Default: `'var(--vis-font-family)'`.\n fontFamily?: string;\n // The color of the text (optional).\n color?: string;\n // The line height scaling factor for the text (optional).\n lineHeight?: number;\n // The top margin of the text block in pixels (optional).\n marginTop?: number;\n // The bottom margin of the text block in pixels (optional).\n marginBottom?: number;\n // The font width-to-height ratio (optional).\n fontWidthToHeightRatio?: number;\n}\n\nexport type UnovisWrappedText = UnovisText & {\n // An array of text lines, where each element represents a single line of text.\n _lines: string[];\n // Estimated height of this text block\n _estimatedHeight: number;\n}\n\nexport type UnovisTextOptions = {\n // The maximum width of the text in pixels.\n width?: number;\n // The word separator(s) used to split the text into words.\n separator?: string | string[];\n // The vertical alignment of the text ('top', 'middle', or 'bottom').\n verticalAlign?: VerticalAlign | string;\n // The horizontal text alignment ('left', 'center', or 'right').\n textAlign?: TextAlign | string;\n // Whether to use a fast estimation method or a more accurate one for text calculations.\n fastMode?: boolean;\n // Force word break if they don't fit into the width\n wordBreak?: boolean;\n}\n\nexport type UnovisTextFrameOptions = UnovisTextOptions & {\n width: number;\n height?: number;\n x?: number;\n y?: number;\n}\n\n"],"names":[],"mappings":"IAAY,SAIX;AAJD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,QAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,QAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACb,CAAC,EAJW,QAAQ,KAAR,QAAQ,GAInB,EAAA,CAAA,CAAA,CAAA;IAEW,cAIX;AAJD,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACX,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACnB,CAAC,EAJW,aAAa,KAAb,aAAa,GAIxB,EAAA,CAAA,CAAA,CAAA;IAEW,QAGX;AAHD,CAAA,UAAY,OAAO,EAAA;AACjB,IAAA,OAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,OAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAHW,OAAO,KAAP,OAAO,GAGlB,EAAA,CAAA,CAAA,CAAA;IAEW,UAIX;AAJD,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,SAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACjB,CAAC,EAJW,SAAS,KAAT,SAAS,GAIpB,EAAA,CAAA,CAAA;;;;"}
|
package/types.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export * from "./types/accessor";
|
|
2
|
-
export * from "./types/curve";
|
|
3
|
-
export * from "./types/symbol";
|
|
4
|
-
export * from "./types/scale";
|
|
5
|
-
export * from "./types/position";
|
|
6
|
-
export * from "./types/shape";
|
|
7
|
-
export * from "./types/component";
|
|
8
|
-
export * from "./types/text";
|
|
9
|
-
export * from "./types/map";
|
|
10
|
-
export * from "./types/spacing";
|
|
11
|
-
export * from "./types/graph";
|
|
12
|
-
export * from "./types/data";
|
|
13
|
-
export * from "./types/direction";
|
|
14
|
-
export * from "./core/component/types";
|
|
15
|
-
export * from "./components/crosshair/types";
|
|
16
|
-
export * from "./components/axis/types";
|
|
17
|
-
export * from "./components/chord-diagram/types";
|
|
18
|
-
export * from "./components/topojson-map/types";
|
|
19
|
-
export * from "./components/leaflet-map/types";
|
|
20
|
-
export * from "./components/leaflet-map/renderer/map-style";
|
|
21
|
-
export * from "./components/graph/types";
|
|
22
|
-
export * from "./components/sankey/types";
|
|
23
|
-
export * from "./components/vis-controls/types";
|
|
24
|
-
export * from "./components/free-brush/types";
|
|
25
|
-
export * from "./components/bullet-legend/types";
|
|
26
|
-
export * from "./components/xy-labels/types";
|
|
27
|
-
export * from "./components/nested-donut/types";
|
package/types.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import './types/accessor.js';
|
|
2
|
-
export { Curve, CurveType } from './types/curve.js';
|
|
3
|
-
export { Symbol, SymbolType } from './types/symbol.js';
|
|
4
|
-
export { Scale, ScaleDimension } from './types/scale.js';
|
|
5
|
-
export { Arrangement, Orientation, Position, PositionStrategy } from './types/position.js';
|
|
6
|
-
export { Shape } from './types/shape.js';
|
|
7
|
-
export { ComponentType, Sizing } from './types/component.js';
|
|
8
|
-
export { FitMode, TextAlign, TrimMode, VerticalAlign } from './types/text.js';
|
|
9
|
-
import './types/map.js';
|
|
10
|
-
import './types/spacing.js';
|
|
11
|
-
import './types/graph.js';
|
|
12
|
-
import './types/data.js';
|
|
13
|
-
export { Direction } from './types/direction.js';
|
|
14
|
-
import './core/component/types.js';
|
|
15
|
-
import './components/crosshair/types.js';
|
|
16
|
-
export { AxisType } from './components/axis/types.js';
|
|
17
|
-
export { ChordLabelAlignment } from './components/chord-diagram/types.js';
|
|
18
|
-
export { MapPointLabelPosition, MapProjection, MapProjectionKind } from './components/topojson-map/types.js';
|
|
19
|
-
export { LeafletMapPointShape, LeafletMapRenderer } from './components/leaflet-map/types.js';
|
|
20
|
-
export { MapLibreArcticDark, MapLibreArcticLight } from './components/leaflet-map/renderer/map-style.js';
|
|
21
|
-
export { GraphLayoutType, GraphLinkArrowStyle, GraphLinkStyle, GraphNodeShape } from './components/graph/types.js';
|
|
22
|
-
export { SankeyEnterTransitionType, SankeyExitTransitionType, SankeyLayout, SankeyNodeAlign, SankeySubLabelPlacement } from './components/sankey/types.js';
|
|
23
|
-
export { VisControlsOrientation } from './components/vis-controls/types.js';
|
|
24
|
-
export { FreeBrushMode } from './components/free-brush/types.js';
|
|
25
|
-
import './components/bullet-legend/types.js';
|
|
26
|
-
export { XYLabelPositioning } from './components/xy-labels/types.js';
|
|
27
|
-
export { NestedDonutDirection, defaultLayerSettings } from './components/nested-donut/types.js';
|
|
28
|
-
|
|
29
|
-
/* eslint-disable max-len */
|
|
30
|
-
//# sourceMappingURL=types.js.map
|
package/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["/* eslint-disable max-len */\n// Global Types\nexport * from 'types/accessor'\nexport * from 'types/curve'\nexport * from 'types/symbol'\nexport * from 'types/scale'\nexport * from 'types/position'\nexport * from 'types/shape'\nexport * from 'types/component'\nexport * from 'types/text'\nexport * from 'types/map'\nexport * from 'types/spacing'\nexport * from 'types/graph'\nexport * from 'types/data'\nexport * from 'types/direction'\n\n// Component Types\nexport * from 'core/component/types'\nexport * from 'components/crosshair/types'\nexport * from 'components/axis/types'\nexport * from 'components/chord-diagram/types'\nexport * from 'components/topojson-map/types'\nexport * from 'components/leaflet-map/types'\nexport * from 'components/leaflet-map/renderer/map-style'\nexport * from 'components/graph/types'\nexport * from 'components/sankey/types'\nexport * from 'components/vis-controls/types'\nexport * from 'components/free-brush/types'\nexport * from 'components/bullet-legend/types'\nexport * from 'components/xy-labels/types'\nexport * from 'components/nested-donut/types'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA"}
|
package/utils/color.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ColorAccessor } from "../types/accessor";
|
|
2
|
-
/** Retrieves color from the data if provided, fallbacks to CSS variables if the index was passed */
|
|
3
|
-
export declare function getColor<T>(d: T, accessor: ColorAccessor<T>, index?: number, dontFallbackToCssVar?: boolean): string | null;
|
|
4
|
-
export declare function hexToRgb(hex: string): {
|
|
5
|
-
r: number;
|
|
6
|
-
g: number;
|
|
7
|
-
b: number;
|
|
8
|
-
};
|
|
9
|
-
export declare function hexToBrightness(hex: string): number;
|
|
10
|
-
export declare function getHexValue(s: string, context: HTMLElement | SVGElement): string;
|
package/utils/color.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { color } from 'd3-color';
|
|
2
|
-
import { getCSSColorVariable } from '../styles/colors.js';
|
|
3
|
-
import { getString, isNumber } from './data.js';
|
|
4
|
-
import { isStringCSSVariable, getCSSVariableValue } from './misc.js';
|
|
5
|
-
|
|
6
|
-
/** Retrieves color from the data if provided, fallbacks to CSS variables if the index was passed */
|
|
7
|
-
function getColor(d, accessor, index, dontFallbackToCssVar) {
|
|
8
|
-
if (Array.isArray(accessor) && isFinite(index))
|
|
9
|
-
return accessor[index % accessor.length];
|
|
10
|
-
const value = getString(d, accessor, index);
|
|
11
|
-
return (value || ((isNumber(index) && !dontFallbackToCssVar) ? `var(${getCSSColorVariable(index)})` : null));
|
|
12
|
-
}
|
|
13
|
-
function hexToRgb(hex) {
|
|
14
|
-
const parsed = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
15
|
-
return parsed ? {
|
|
16
|
-
r: parseInt(parsed[1], 16),
|
|
17
|
-
g: parseInt(parsed[2], 16),
|
|
18
|
-
b: parseInt(parsed[3], 16),
|
|
19
|
-
} : { r: 0, g: 0, b: 0 };
|
|
20
|
-
}
|
|
21
|
-
function hexToBrightness(hex) {
|
|
22
|
-
const rgb = hexToRgb(hex);
|
|
23
|
-
return (0.2126 * rgb.r + 0.7152 * rgb.g + 0.0722 * rgb.b) / 255;
|
|
24
|
-
}
|
|
25
|
-
function getHexValue(s, context) {
|
|
26
|
-
var _a;
|
|
27
|
-
const hex = isStringCSSVariable(s) ? getCSSVariableValue(s, context) : s;
|
|
28
|
-
return (_a = color(hex)) === null || _a === void 0 ? void 0 : _a.formatHex();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { getColor, getHexValue, hexToBrightness, hexToRgb };
|
|
32
|
-
//# sourceMappingURL=color.js.map
|
package/utils/color.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color.js","sources":["../../src/utils/color.ts"],"sourcesContent":["import { color } from 'd3-color'\n\n// Core\nimport { getCSSColorVariable } from 'styles/colors'\n\n// Utils\nimport { ColorAccessor, StringAccessor } from 'types/accessor'\nimport { getString, isNumber } from 'utils/data'\nimport { isStringCSSVariable, getCSSVariableValue } from 'utils/misc'\n\n/** Retrieves color from the data if provided, fallbacks to CSS variables if the index was passed */\nexport function getColor<T> (\n d: T,\n accessor: ColorAccessor<T>,\n index?: number,\n dontFallbackToCssVar?: boolean\n): string | null {\n if (Array.isArray(accessor) && isFinite(index)) return accessor[index % accessor.length]\n\n const value = getString(d, accessor as StringAccessor<T>, index)\n return (value || ((isNumber(index) && !dontFallbackToCssVar) ? `var(${getCSSColorVariable(index)})` : null))\n}\n\nexport function hexToRgb (hex: string): { r: number; g: number; b: number } {\n const parsed = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex)\n return parsed ? {\n r: parseInt(parsed[1], 16),\n g: parseInt(parsed[2], 16),\n b: parseInt(parsed[3], 16),\n } : { r: 0, g: 0, b: 0 }\n}\n\nexport function hexToBrightness (hex: string): number {\n const rgb = hexToRgb(hex)\n return (0.2126 * rgb.r + 0.7152 * rgb.g + 0.0722 * rgb.b) / 255\n}\n\nexport function getHexValue (s: string, context: HTMLElement | SVGElement): string {\n const hex = isStringCSSVariable(s) ? getCSSVariableValue(s, context) : s\n return color(hex)?.formatHex()\n}\n"],"names":[],"mappings":";;;;;AAUA;AACM,SAAU,QAAQ,CACtB,CAAI,EACJ,QAA0B,EAC1B,KAAc,EACd,oBAA8B,EAAA;IAE9B,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAA;IAExF,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,EAAE,QAA6B,EAAE,KAAK,CAAC,CAAA;AAChE,IAAA,QAAQ,KAAK,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAO,IAAA,EAAA,mBAAmB,CAAC,KAAK,CAAC,CAAA,CAAA,CAAG,GAAG,IAAI,CAAC,EAAC;AAC9G,CAAC;AAEK,SAAU,QAAQ,CAAE,GAAW,EAAA;IACnC,MAAM,MAAM,GAAG,2CAA2C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACpE,OAAO,MAAM,GAAG;QACd,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC1B,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC1B,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC3B,KAAA,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;AAC1B,CAAC;AAEK,SAAU,eAAe,CAAE,GAAW,EAAA;AAC1C,IAAA,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;IACzB,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,GAAG,CAAA;AACjE,CAAC;AAEe,SAAA,WAAW,CAAE,CAAS,EAAE,OAAiC,EAAA;;AACvE,IAAA,MAAM,GAAG,GAAG,mBAAmB,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;IACxE,OAAO,CAAA,EAAA,GAAA,KAAK,CAAC,GAAG,CAAC,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,SAAS,EAAE,CAAA;AAChC;;;;"}
|
package/utils/d3.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Transition } from 'd3-transition';
|
|
2
|
-
import { BaseType, Selection } from 'd3-selection';
|
|
3
|
-
export declare function smartTransition<Element extends BaseType, Datum, ParentElement extends BaseType, ParentDatum>(selection: Selection<Element, Datum, ParentElement, ParentDatum>, duration?: number, easing?: (normalizedTime: number) => number): Selection<Element, Datum, ParentElement, ParentDatum> | Transition<Element, Datum, ParentElement, ParentDatum>;
|
package/utils/d3.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { interrupt } from 'd3-transition';
|
|
2
|
-
|
|
3
|
-
function smartTransition(selection, duration, easing) {
|
|
4
|
-
selection.nodes().forEach(node => interrupt(node)); // Interrupt active transitions if any
|
|
5
|
-
if (duration) {
|
|
6
|
-
const transition = selection.transition().duration(duration);
|
|
7
|
-
if (easing)
|
|
8
|
-
transition.ease(easing);
|
|
9
|
-
return transition;
|
|
10
|
-
}
|
|
11
|
-
else
|
|
12
|
-
return selection;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { smartTransition };
|
|
16
|
-
//# sourceMappingURL=d3.js.map
|
package/utils/d3.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"d3.js","sources":["../../src/utils/d3.ts"],"sourcesContent":["import { interrupt, Transition } from 'd3-transition'\nimport { BaseType, Selection } from 'd3-selection'\n\nexport function smartTransition<Element extends BaseType, Datum, ParentElement extends BaseType, ParentDatum> (\n selection: Selection<Element, Datum, ParentElement, ParentDatum>,\n duration?: number,\n easing?: (normalizedTime: number) => number\n): Selection<Element, Datum, ParentElement, ParentDatum> | Transition<Element, Datum, ParentElement, ParentDatum> {\n selection.nodes().forEach(node => interrupt(node)) // Interrupt active transitions if any\n if (duration) {\n const transition = selection.transition().duration(duration)\n if (easing) transition.ease(easing)\n return transition\n } else return selection\n}\n"],"names":[],"mappings":";;SAGgB,eAAe,CAC7B,SAAgE,EAChE,QAAiB,EACjB,MAA2C,EAAA;AAE3C,IAAA,SAAS,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;AAClD,IAAA,IAAI,QAAQ,EAAE;QACZ,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAC5D,QAAA,IAAI,MAAM;AAAE,YAAA,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACnC,QAAA,OAAO,UAAU,CAAA;AAClB,KAAA;;AAAM,QAAA,OAAO,SAAS,CAAA;AACzB;;;;"}
|
package/utils/data.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { throttle as _throttle } from 'throttle-debounce';
|
|
2
|
-
import { NumericAccessor, StringAccessor, BooleanAccessor, ColorAccessor, GenericAccessor } from "../types/accessor";
|
|
3
|
-
import { StackValuesRecord } from "../types/data";
|
|
4
|
-
export declare const isNumber: <T>(a: T) => boolean;
|
|
5
|
-
export declare const isFunction: <T>(a: T) => boolean;
|
|
6
|
-
export declare const isUndefined: <T>(a: T) => boolean;
|
|
7
|
-
export declare const isNil: <T>(a: T) => boolean;
|
|
8
|
-
export declare const isString: <T>(a: T) => boolean;
|
|
9
|
-
export declare const isArray: <T>(a: T) => boolean;
|
|
10
|
-
export declare const isObject: <T>(a: T) => boolean;
|
|
11
|
-
export declare const isAClassInstance: <T>(a: T) => boolean;
|
|
12
|
-
export declare const isPlainObject: <T>(a: T) => boolean;
|
|
13
|
-
export declare const isEmpty: <T>(obj: T) => boolean;
|
|
14
|
-
export declare const isEqual: (a?: unknown | null, b?: unknown | null, visited?: Set<any>) => boolean;
|
|
15
|
-
export declare const without: <T>(arr: T[], ...args: T[]) => T[];
|
|
16
|
-
export declare const flatten: <T>(arr: (T | T[])[]) => T[];
|
|
17
|
-
export declare const cloneDeep: <T>(obj: T, stack?: Map<any, any>) => T;
|
|
18
|
-
export declare const merge: <T, K>(obj1: T, obj2: K, visited?: Map<any, any>) => T & K;
|
|
19
|
-
export declare const omit: <T extends Record<string | number | symbol, unknown>>(obj: T, props: (keyof T)[]) => Partial<T>;
|
|
20
|
-
export declare const groupBy: <T extends Record<string | number, any>>(arr: T[], accessor: (a: T) => string | number) => Record<string | number, T[]>;
|
|
21
|
-
export declare const sortBy: <T>(arr: T[], accessor: (a: T) => string | number) => T[];
|
|
22
|
-
export declare const throttle: <T extends (...args: any[]) => any>(f: T, delay: number, options?: {
|
|
23
|
-
noTrailing?: boolean;
|
|
24
|
-
noLeading?: boolean;
|
|
25
|
-
debounceMode?: boolean;
|
|
26
|
-
}) => _throttle<T>;
|
|
27
|
-
export declare function getValue<T, ReturnType>(d: T, accessor: NumericAccessor<T> | StringAccessor<T> | BooleanAccessor<T> | ColorAccessor<T> | GenericAccessor<ReturnType, T>, index?: number): ReturnType;
|
|
28
|
-
export declare function getString<T>(d: T, accessor: StringAccessor<T>, i?: number): string | null | undefined;
|
|
29
|
-
export declare function getNumber<T>(d: T, accessor: NumericAccessor<T>, i?: number): number | null | undefined;
|
|
30
|
-
export declare function getBoolean<T>(d: T, accessor: BooleanAccessor<T>, i?: number): boolean | null | undefined;
|
|
31
|
-
export declare function clean<T>(data: T[]): T[];
|
|
32
|
-
export declare function clamp(d: number, min: number, max: number): number;
|
|
33
|
-
export declare function unique<T>(array: T[]): T[];
|
|
34
|
-
export declare function countUnique<T>(array: T[], accessor?: (d: any) => any): number;
|
|
35
|
-
export declare function arrayOfIndices(n: number): number[];
|
|
36
|
-
export declare function shallowDiff(o1?: Record<string, unknown>, o2?: Record<string, unknown>): Record<string, unknown>;
|
|
37
|
-
export declare function getStackedExtent<Datum>(data: Datum[], ...acs: NumericAccessor<Datum>[]): (number | undefined)[];
|
|
38
|
-
export declare function getStackedValues<Datum>(d: Datum, index: number, ...acs: NumericAccessor<Datum>[]): (number | undefined)[];
|
|
39
|
-
export declare function getStackedData<Datum>(data: Datum[], baseline: NumericAccessor<Datum>, acs: NumericAccessor<Datum>[], prevNegative?: boolean[]): StackValuesRecord[];
|
|
40
|
-
export declare function getMin<Datum>(data: Datum[], ...acs: NumericAccessor<Datum>[]): number | undefined;
|
|
41
|
-
export declare function getMax<Datum>(data: Datum[], ...acs: NumericAccessor<Datum>[]): number | undefined;
|
|
42
|
-
export declare function getExtent<Datum>(data: Datum[], ...acs: NumericAccessor<Datum>[]): (number | undefined)[];
|
|
43
|
-
export declare function getNearest<Datum>(data: Datum[], value: number, accessor: NumericAccessor<Datum>): Datum;
|
|
44
|
-
export declare function filterDataByRange<Datum>(data: Datum[], range: [number, number], accessor: NumericAccessor<Datum>): Datum[];
|
|
45
|
-
export declare function isNumberWithinRange(value: number, range: [number, number]): boolean;
|
package/utils/data.js
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { mean, min, max, bisector } from 'd3-array';
|
|
2
|
-
import { throttle as throttle$1 } from 'throttle-debounce';
|
|
3
|
-
|
|
4
|
-
const isNumber = (a) => typeof a === 'number';
|
|
5
|
-
const isFunction = (a) => typeof a === 'function';
|
|
6
|
-
const isUndefined = (a) => a === undefined;
|
|
7
|
-
const isNil = (a) => a == null;
|
|
8
|
-
const isString = (a) => typeof a === 'string';
|
|
9
|
-
const isArray = (a) => Array.isArray(a);
|
|
10
|
-
const isObject = (a) => (a instanceof Object);
|
|
11
|
-
const isAClassInstance = (a) => a.constructor.name !== 'Function' && a.constructor.name !== 'Object';
|
|
12
|
-
const isPlainObject = (a) => isObject(a) && !isArray(a) && !isFunction(a) && !isAClassInstance(a);
|
|
13
|
-
const isEmpty = (obj) => {
|
|
14
|
-
return [Object, Array].includes((obj || {}).constructor) &&
|
|
15
|
-
!Object.entries((obj || {})).length;
|
|
16
|
-
};
|
|
17
|
-
// Based on https://github.com/maplibre/maplibre-gl-js/blob/e78ad7944ef768e67416daa4af86b0464bd0f617/src/style-spec/util/deep_equal.ts, 3-Clause BSD license
|
|
18
|
-
const isEqual = (a, b, visited = new Set()) => {
|
|
19
|
-
if (Array.isArray(a)) {
|
|
20
|
-
if (!Array.isArray(b) || a.length !== b.length)
|
|
21
|
-
return false;
|
|
22
|
-
if (visited.has(a))
|
|
23
|
-
return true;
|
|
24
|
-
else
|
|
25
|
-
visited.add(a);
|
|
26
|
-
for (let i = 0; i < a.length; i++) {
|
|
27
|
-
if (!isEqual(a[i], b[i], visited))
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
if (typeof a === 'object' && a !== null && b !== null) {
|
|
33
|
-
if (!(typeof b === 'object'))
|
|
34
|
-
return false;
|
|
35
|
-
if (a === b)
|
|
36
|
-
return true;
|
|
37
|
-
const keys = Object.keys(a);
|
|
38
|
-
if (keys.length !== Object.keys(b).length)
|
|
39
|
-
return false;
|
|
40
|
-
if (visited.has(a))
|
|
41
|
-
return true;
|
|
42
|
-
else
|
|
43
|
-
visited.add(a);
|
|
44
|
-
for (const key in a) {
|
|
45
|
-
if (!isEqual(a[key], b[key], visited))
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
return a === b;
|
|
51
|
-
};
|
|
52
|
-
const without = (arr, ...args) => arr.filter(item => !args.includes(item));
|
|
53
|
-
const flatten = (arr) => arr.flat();
|
|
54
|
-
const cloneDeep = (obj, stack = new Map()) => {
|
|
55
|
-
if (typeof obj !== 'object' || obj === null) {
|
|
56
|
-
return obj;
|
|
57
|
-
}
|
|
58
|
-
if (obj instanceof Date) {
|
|
59
|
-
return new Date(obj.getTime());
|
|
60
|
-
}
|
|
61
|
-
if (obj instanceof Array) {
|
|
62
|
-
const clone = [];
|
|
63
|
-
stack.set(obj, clone);
|
|
64
|
-
for (const item of obj) {
|
|
65
|
-
clone.push(stack.has(item) ? stack.get(item) : cloneDeep(item, stack));
|
|
66
|
-
}
|
|
67
|
-
return clone;
|
|
68
|
-
}
|
|
69
|
-
// Class instances will be copied without cloning
|
|
70
|
-
if (isAClassInstance(obj)) {
|
|
71
|
-
const clone = obj;
|
|
72
|
-
return clone;
|
|
73
|
-
}
|
|
74
|
-
if (obj instanceof Object) {
|
|
75
|
-
const clone = {};
|
|
76
|
-
stack.set(obj, clone);
|
|
77
|
-
const objAsRecord = obj;
|
|
78
|
-
Object.keys(obj)
|
|
79
|
-
.reduce((newObj, key) => {
|
|
80
|
-
newObj[key] = stack.has(objAsRecord[key]) ? stack.get(objAsRecord[key]) : cloneDeep(objAsRecord[key], stack);
|
|
81
|
-
return newObj;
|
|
82
|
-
}, clone);
|
|
83
|
-
return clone;
|
|
84
|
-
}
|
|
85
|
-
return obj;
|
|
86
|
-
};
|
|
87
|
-
const merge = (obj1, obj2, visited = new Map()) => {
|
|
88
|
-
if (!obj1 || !obj2)
|
|
89
|
-
return obj1;
|
|
90
|
-
if (obj1 === obj2)
|
|
91
|
-
return obj1;
|
|
92
|
-
const newObj = (isAClassInstance(obj1) ? obj1 : cloneDeep(obj1));
|
|
93
|
-
// Taking care of recursive structures
|
|
94
|
-
if (visited.has(obj2))
|
|
95
|
-
return visited.get(obj2);
|
|
96
|
-
else
|
|
97
|
-
visited.set(obj2, newObj);
|
|
98
|
-
Object.keys(obj2).forEach(key => {
|
|
99
|
-
if (isPlainObject(obj1[key]) && isPlainObject(obj2[key])) {
|
|
100
|
-
newObj[key] = merge(obj1[key], obj2[key], visited);
|
|
101
|
-
}
|
|
102
|
-
else if (isAClassInstance(obj2)) {
|
|
103
|
-
newObj[key] = obj2;
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
newObj[key] = cloneDeep(obj2[key]);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
return newObj;
|
|
110
|
-
};
|
|
111
|
-
const omit = (obj, props) => {
|
|
112
|
-
obj = Object.assign({}, obj);
|
|
113
|
-
props.forEach(prop => delete obj[prop]);
|
|
114
|
-
return obj;
|
|
115
|
-
};
|
|
116
|
-
const groupBy = (arr, accessor) => {
|
|
117
|
-
return arr.reduce((grouped, v, i, a, k = accessor(v)) => (((grouped[k] || (grouped[k] = [])).push(v), grouped)), {});
|
|
118
|
-
};
|
|
119
|
-
const sortBy = (arr, accessor) => {
|
|
120
|
-
return arr.concat() // The native sort method modifies the array in place. We use `.concat()` to copy the array first
|
|
121
|
-
.sort((a, b) => {
|
|
122
|
-
return (accessor(a) > accessor(b)) ? 1 : ((accessor(b) > accessor(a)) ? -1 : 0);
|
|
123
|
-
});
|
|
124
|
-
};
|
|
125
|
-
const throttle = (f, delay, options) => throttle$1(delay, f, options);
|
|
126
|
-
function getValue(d, accessor, index) {
|
|
127
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
128
|
-
if (isFunction(accessor))
|
|
129
|
-
return accessor(d, index);
|
|
130
|
-
else
|
|
131
|
-
return accessor;
|
|
132
|
-
}
|
|
133
|
-
function getString(d, accessor, i) {
|
|
134
|
-
return getValue(d, accessor, i);
|
|
135
|
-
}
|
|
136
|
-
function getNumber(d, accessor, i) {
|
|
137
|
-
return getValue(d, accessor, i);
|
|
138
|
-
}
|
|
139
|
-
function getBoolean(d, accessor, i) {
|
|
140
|
-
return getValue(d, accessor, i);
|
|
141
|
-
}
|
|
142
|
-
function clean(data) {
|
|
143
|
-
return data.filter(d => d && !isNumber(d));
|
|
144
|
-
}
|
|
145
|
-
function clamp(d, min, max) {
|
|
146
|
-
return Math.min(Math.max(d, min), max);
|
|
147
|
-
}
|
|
148
|
-
function unique(array) {
|
|
149
|
-
return Array.from(new Set(array));
|
|
150
|
-
}
|
|
151
|
-
function countUnique(array, accessor = d => d) {
|
|
152
|
-
return new Set(array.map(d => accessor(d))).size;
|
|
153
|
-
}
|
|
154
|
-
function arrayOfIndices(n) {
|
|
155
|
-
return [...Array(n).keys()];
|
|
156
|
-
}
|
|
157
|
-
function shallowDiff(o1 = {}, o2 = {}) {
|
|
158
|
-
return Object.keys(o2).reduce((diff, key) => {
|
|
159
|
-
if (o1[key] === o2[key])
|
|
160
|
-
return diff;
|
|
161
|
-
return Object.assign(Object.assign({}, diff), { [key]: o2[key] });
|
|
162
|
-
}, {});
|
|
163
|
-
}
|
|
164
|
-
function getStackedExtent(data, ...acs) {
|
|
165
|
-
if (!data)
|
|
166
|
-
return [undefined, undefined];
|
|
167
|
-
if (isArray(acs)) {
|
|
168
|
-
let minValue = 0;
|
|
169
|
-
let maxValue = 0;
|
|
170
|
-
data.forEach((d, i) => {
|
|
171
|
-
let positiveStack = 0;
|
|
172
|
-
let negativeStack = 0;
|
|
173
|
-
for (const a of acs) {
|
|
174
|
-
const value = getNumber(d, a, i) || 0;
|
|
175
|
-
if (value >= 0)
|
|
176
|
-
positiveStack += value;
|
|
177
|
-
else
|
|
178
|
-
negativeStack += value;
|
|
179
|
-
}
|
|
180
|
-
if (positiveStack > maxValue)
|
|
181
|
-
maxValue = positiveStack;
|
|
182
|
-
if (negativeStack < minValue)
|
|
183
|
-
minValue = negativeStack;
|
|
184
|
-
});
|
|
185
|
-
return [minValue, maxValue];
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
function getStackedValues(d, index, ...acs) {
|
|
189
|
-
const values = [];
|
|
190
|
-
let positiveStack = 0;
|
|
191
|
-
let negativeStack = 0;
|
|
192
|
-
for (const a of acs) {
|
|
193
|
-
const value = getNumber(d, a, index) || 0;
|
|
194
|
-
if (value >= 0) {
|
|
195
|
-
values.push(positiveStack += value);
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
values.push(negativeStack += value);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return values;
|
|
202
|
-
}
|
|
203
|
-
function getStackedData(data, baseline, acs, prevNegative // to help guessing the stack direction (positive/negative) when the values are 0 or null
|
|
204
|
-
) {
|
|
205
|
-
const baselineValues = data.map((d, i) => getNumber(d, baseline, i) || 0);
|
|
206
|
-
const isNegativeStack = acs.map((a, j) => {
|
|
207
|
-
const average = mean(data, (d, i) => getNumber(d, a, i) || 0);
|
|
208
|
-
return (average === 0 && Array.isArray(prevNegative)) ? prevNegative[j] : average < 0;
|
|
209
|
-
});
|
|
210
|
-
const stackedData = acs.map(() => []);
|
|
211
|
-
data.forEach((d, i) => {
|
|
212
|
-
let positiveStack = baselineValues[i];
|
|
213
|
-
let negativeStack = baselineValues[i];
|
|
214
|
-
acs.forEach((a, j) => {
|
|
215
|
-
const value = getNumber(d, a, i) || 0;
|
|
216
|
-
if (!isNegativeStack[j]) {
|
|
217
|
-
stackedData[j].push([positiveStack, positiveStack += value]);
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
stackedData[j].push([negativeStack, negativeStack += value]);
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
// Fill in additional stack information
|
|
225
|
-
stackedData.forEach((stack, i) => {
|
|
226
|
-
stack.negative = isNegativeStack[i];
|
|
227
|
-
});
|
|
228
|
-
stackedData.filter(s => s.negative)
|
|
229
|
-
.forEach((s, i, arr) => {
|
|
230
|
-
s.ending = i === arr.length - 1;
|
|
231
|
-
});
|
|
232
|
-
stackedData.filter(s => !s.negative)
|
|
233
|
-
.forEach((s, i, arr) => {
|
|
234
|
-
s.ending = i === arr.length - 1;
|
|
235
|
-
});
|
|
236
|
-
return stackedData;
|
|
237
|
-
}
|
|
238
|
-
function getMin(data, ...acs) {
|
|
239
|
-
if (!data)
|
|
240
|
-
return undefined;
|
|
241
|
-
const minValue = min(data, (d, i) => min(acs, a => getNumber(d, a, i)));
|
|
242
|
-
return minValue;
|
|
243
|
-
}
|
|
244
|
-
function getMax(data, ...acs) {
|
|
245
|
-
if (!data)
|
|
246
|
-
return undefined;
|
|
247
|
-
const maxValue = max(data, (d, i) => max(acs, a => getNumber(d, a, i)));
|
|
248
|
-
return maxValue;
|
|
249
|
-
}
|
|
250
|
-
function getExtent(data, ...acs) {
|
|
251
|
-
return [getMin(data, ...acs), getMax(data, ...acs)];
|
|
252
|
-
}
|
|
253
|
-
function getNearest(data, value, accessor) {
|
|
254
|
-
if (data.length <= 1)
|
|
255
|
-
return data[0];
|
|
256
|
-
const values = data.map((d, i) => getNumber(d, accessor, i));
|
|
257
|
-
values.sort((a, b) => a - b);
|
|
258
|
-
const xBisector = bisector(d => d).left;
|
|
259
|
-
const index = xBisector(values, value, 1, data.length - 1);
|
|
260
|
-
return value - values[index - 1] > values[index] - value ? data[index] : data[index - 1];
|
|
261
|
-
}
|
|
262
|
-
function filterDataByRange(data, range, accessor) {
|
|
263
|
-
const filteredData = data.filter((d, i) => {
|
|
264
|
-
const value = getNumber(d, accessor, i);
|
|
265
|
-
return (value >= range[0]) && (value < range[1]);
|
|
266
|
-
});
|
|
267
|
-
return filteredData;
|
|
268
|
-
}
|
|
269
|
-
function isNumberWithinRange(value, range) {
|
|
270
|
-
return (value >= range[0]) && (value <= range[1]);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
export { arrayOfIndices, clamp, clean, cloneDeep, countUnique, filterDataByRange, flatten, getBoolean, getExtent, getMax, getMin, getNearest, getNumber, getStackedData, getStackedExtent, getStackedValues, getString, getValue, groupBy, isAClassInstance, isArray, isEmpty, isEqual, isFunction, isNil, isNumber, isNumberWithinRange, isObject, isPlainObject, isString, isUndefined, merge, omit, shallowDiff, sortBy, throttle, unique, without };
|
|
274
|
-
//# sourceMappingURL=data.js.map
|