@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
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { scaleBand } from 'd3-scale';
|
|
2
|
-
import { min, max, range } from 'd3-array';
|
|
3
|
-
import { select } from 'd3';
|
|
4
|
-
import { XYComponentCore } from '../../core/xy-component/index.js';
|
|
5
|
-
import { isArray, getNumber, isNumber, getString, clamp, isEmpty, getMin, getMax, getExtent } from '../../utils/data.js';
|
|
6
|
-
import { roundedRectPath } from '../../utils/path.js';
|
|
7
|
-
import { smartTransition } from '../../utils/d3.js';
|
|
8
|
-
import { getColor } from '../../utils/color.js';
|
|
9
|
-
import { Direction } from '../../types/direction.js';
|
|
10
|
-
import { Orientation } from '../../types/position.js';
|
|
11
|
-
import { GroupedBarConfig } from './config.js';
|
|
12
|
-
import * as style from './style.js';
|
|
13
|
-
import { barGroup, barGroupExit, bar } from './style.js';
|
|
14
|
-
|
|
15
|
-
class GroupedBar extends XYComponentCore {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super();
|
|
18
|
-
this.config = new GroupedBarConfig();
|
|
19
|
-
this.getAccessors = () => isArray(this.config.y) ? this.config.y : [this.config.y];
|
|
20
|
-
this.events = {
|
|
21
|
-
[GroupedBar.selectors.barGroup]: {
|
|
22
|
-
mouseover: this._raiseSelection,
|
|
23
|
-
},
|
|
24
|
-
[GroupedBar.selectors.bar]: {
|
|
25
|
-
mouseover: this._raiseSelection,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
this._barData = [];
|
|
29
|
-
if (config)
|
|
30
|
-
this.config.init(config);
|
|
31
|
-
}
|
|
32
|
-
get bleed() {
|
|
33
|
-
this._barData = this._getVisibleData();
|
|
34
|
-
if (this._barData.length === 0)
|
|
35
|
-
return { top: 0, bottom: 0, left: 0, right: 0 };
|
|
36
|
-
// By default, horizontal orientation is "flipped", i.e. the `yDirection` of `XYContainer` is set to `Direction.North`
|
|
37
|
-
const isHorizontalAndFlipped = !this.isVertical() && (this.dataScale.range()[0] > this.dataScale.range()[1]);
|
|
38
|
-
const dataDomain = this.dataScale.domain();
|
|
39
|
-
const halfGroupWidth = this._getGroupWidth() / 2;
|
|
40
|
-
const dataScaleValues = this._barData.map((d, i) => getNumber(d, this.config.x, i));
|
|
41
|
-
const firstDataValue = min(dataScaleValues);
|
|
42
|
-
const lastDataValue = max(dataScaleValues);
|
|
43
|
-
const firstValuePx = this.dataScale(firstDataValue);
|
|
44
|
-
const lastValuePx = this.dataScale(lastDataValue);
|
|
45
|
-
const dataDomainRequiredStart = this.dataScale.invert(firstValuePx + (isHorizontalAndFlipped ? halfGroupWidth : -halfGroupWidth));
|
|
46
|
-
const dataDomainRequiredEnd = this.dataScale.invert(lastValuePx + (isHorizontalAndFlipped ? -halfGroupWidth : halfGroupWidth));
|
|
47
|
-
const bleedPxStart = dataDomainRequiredStart <= dataDomain[0] ? this.dataScale(dataDomain[0]) - this.dataScale(dataDomainRequiredStart) : 0;
|
|
48
|
-
const bleedPxEnd = dataDomainRequiredEnd > dataDomain[1] ? this.dataScale(dataDomainRequiredEnd) - this.dataScale(dataDomain[1]) : 0;
|
|
49
|
-
return {
|
|
50
|
-
top: this.isVertical() ? 0 : (isHorizontalAndFlipped ? -bleedPxEnd : bleedPxStart),
|
|
51
|
-
bottom: this.isVertical() ? 0 : (isHorizontalAndFlipped ? -bleedPxStart : bleedPxEnd),
|
|
52
|
-
left: this.isVertical() ? bleedPxStart : 0,
|
|
53
|
-
right: this.isVertical() ? bleedPxEnd : 0,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
get dataScale() {
|
|
57
|
-
return this.isVertical() ? this.xScale : this.yScale;
|
|
58
|
-
}
|
|
59
|
-
get valueScale() {
|
|
60
|
-
return this.isVertical() ? this.yScale : this.xScale;
|
|
61
|
-
}
|
|
62
|
-
isVertical() {
|
|
63
|
-
return this.config.orientation === Orientation.Vertical;
|
|
64
|
-
}
|
|
65
|
-
_render(customDuration) {
|
|
66
|
-
const { config } = this;
|
|
67
|
-
const duration = isNumber(customDuration)
|
|
68
|
-
? customDuration
|
|
69
|
-
: config.duration;
|
|
70
|
-
const groupWidth = this._getGroupWidth();
|
|
71
|
-
const yAccessors = this.getAccessors();
|
|
72
|
-
const innerBandScaleRange = [-groupWidth / 2, groupWidth / 2];
|
|
73
|
-
const innerBandScale = scaleBand()
|
|
74
|
-
.domain(range(yAccessors.length))
|
|
75
|
-
.range(innerBandScaleRange)
|
|
76
|
-
.paddingInner(config.barPadding)
|
|
77
|
-
.paddingOuter(config.barPadding);
|
|
78
|
-
const barGroups = this.g
|
|
79
|
-
.selectAll(`.${barGroup}`)
|
|
80
|
-
.data(this._barData, (d, i) => { var _a; return `${(_a = getString(d, config.id, i)) !== null && _a !== void 0 ? _a : i}`; });
|
|
81
|
-
const getBarGroupsTransform = (d, i) => {
|
|
82
|
-
const v = this.dataScale(getNumber(d, config.x, i));
|
|
83
|
-
const x = this.isVertical() ? v : 0;
|
|
84
|
-
const y = this.isVertical() ? 0 : v;
|
|
85
|
-
return `translate(${x},${y})`;
|
|
86
|
-
};
|
|
87
|
-
const barGroupsEnter = barGroups
|
|
88
|
-
.enter()
|
|
89
|
-
.append('g')
|
|
90
|
-
.attr('class', barGroup)
|
|
91
|
-
.attr('transform', getBarGroupsTransform)
|
|
92
|
-
.style('opacity', 1);
|
|
93
|
-
const barGroupsMerged = barGroupsEnter.merge(barGroups);
|
|
94
|
-
smartTransition(barGroupsMerged, duration)
|
|
95
|
-
.attr('transform', getBarGroupsTransform)
|
|
96
|
-
.style('opacity', 1);
|
|
97
|
-
const barGroupExit$1 = barGroups.exit().attr('class', barGroupExit);
|
|
98
|
-
smartTransition(barGroupExit$1, duration).style('opacity', 0).remove();
|
|
99
|
-
// Animate exiting bars going down
|
|
100
|
-
smartTransition(barGroupExit$1.selectAll(`.${bar}`), duration)
|
|
101
|
-
.attr('transform', (d, i, e) => {
|
|
102
|
-
return this.isVertical()
|
|
103
|
-
? `translate(0,${this.yScale(0)}) scale(1,0)`
|
|
104
|
-
: `translate(${this.xScale(0)},0) scale(0,1)`;
|
|
105
|
-
});
|
|
106
|
-
const barWidth = innerBandScale.bandwidth();
|
|
107
|
-
const bars = barGroupsMerged
|
|
108
|
-
.selectAll(`.${bar}`)
|
|
109
|
-
.data((d) => yAccessors.map(() => d));
|
|
110
|
-
const valueAxisDirection = this._getValueAxisDirection();
|
|
111
|
-
const barsEnter = bars
|
|
112
|
-
.enter()
|
|
113
|
-
.append('path')
|
|
114
|
-
.attr('class', bar)
|
|
115
|
-
.attr('d', (d, i) => {
|
|
116
|
-
const x = innerBandScale(i);
|
|
117
|
-
const y = this.valueScale(0);
|
|
118
|
-
const width = barWidth;
|
|
119
|
-
const height = 0;
|
|
120
|
-
return this._getBarPath(x, y, width, height, false, valueAxisDirection);
|
|
121
|
-
})
|
|
122
|
-
.style('fill', (d, i) => getColor(d, config.color, i));
|
|
123
|
-
const barsMerged = barsEnter.merge(bars);
|
|
124
|
-
smartTransition(barsMerged, duration)
|
|
125
|
-
.attr('d', (d, j) => {
|
|
126
|
-
const x = innerBandScale(j);
|
|
127
|
-
const width = barWidth;
|
|
128
|
-
// Todo: Find a way to pass the datum index to `getNumber` below
|
|
129
|
-
const value = getNumber(d, yAccessors[j]);
|
|
130
|
-
const isNegative = value < 0;
|
|
131
|
-
let y = isNegative ? this.valueScale(0) : this.valueScale(value || 0);
|
|
132
|
-
let height = Math.abs(this.valueScale(0) - this.valueScale(value)) || 0;
|
|
133
|
-
// Optionally set minimum bar height
|
|
134
|
-
if (height < config.barMinHeight) {
|
|
135
|
-
const dir = valueAxisDirection === Direction.North ? -1 : 1;
|
|
136
|
-
y = this.valueScale(0) + dir * config.barMinHeight;
|
|
137
|
-
height = config.barMinHeight;
|
|
138
|
-
}
|
|
139
|
-
return this._getBarPath(x, y, width, height, isNegative, valueAxisDirection);
|
|
140
|
-
})
|
|
141
|
-
.style('fill', (d, i) => getColor(d, config.color, i))
|
|
142
|
-
.style('cursor', (d, i) => getString(d, config.cursor, i));
|
|
143
|
-
smartTransition(bars.exit(), duration).remove();
|
|
144
|
-
}
|
|
145
|
-
_getValueAxisDirection() {
|
|
146
|
-
return this.valueScale.range()[0] > this.valueScale.range()[1]
|
|
147
|
-
? Direction.North
|
|
148
|
-
: Direction.South;
|
|
149
|
-
}
|
|
150
|
-
_getVisibleData() {
|
|
151
|
-
const { config, datamodel: { data }, } = this;
|
|
152
|
-
const groupWidth = this._getGroupWidth();
|
|
153
|
-
const halfGroupWidth = data.length < 2 ? 0 : groupWidth / 2;
|
|
154
|
-
const dataScale = this.dataScale;
|
|
155
|
-
const xHalfGroupWidth = Math.abs(dataScale.invert(halfGroupWidth) -
|
|
156
|
-
dataScale.invert(0));
|
|
157
|
-
const filtered = data === null || data === void 0 ? void 0 : data.filter((d, i) => {
|
|
158
|
-
const v = getNumber(d, config.x, i);
|
|
159
|
-
const domain = dataScale.domain();
|
|
160
|
-
const domainMin = +domain[0];
|
|
161
|
-
const domainMax = +domain[1];
|
|
162
|
-
return (v >= domainMin - xHalfGroupWidth && v <= domainMax + xHalfGroupWidth);
|
|
163
|
-
});
|
|
164
|
-
return filtered;
|
|
165
|
-
}
|
|
166
|
-
_getBarPath(x, y, width, height, isNegative, direction) {
|
|
167
|
-
const { config } = this;
|
|
168
|
-
const cornerRadius = config.roundedCorners
|
|
169
|
-
? isNumber(config.roundedCorners)
|
|
170
|
-
? +config.roundedCorners
|
|
171
|
-
: width / 2
|
|
172
|
-
: 0;
|
|
173
|
-
const cornerRadiusClamped = clamp(cornerRadius, 0, Math.min(height, width) / 2);
|
|
174
|
-
const isNorthDirected = direction === Direction.North;
|
|
175
|
-
const roundedTop = this.isVertical() && isNegative !== isNorthDirected;
|
|
176
|
-
const roundedBottom = this.isVertical() && isNegative === isNorthDirected;
|
|
177
|
-
const roundedLeft = !this.isVertical() && isNegative;
|
|
178
|
-
const roundedRight = !this.isVertical() && !isNegative;
|
|
179
|
-
return roundedRectPath({
|
|
180
|
-
x: this.isVertical() ? x : y + (isNorthDirected ? 0 : -height),
|
|
181
|
-
y: this.isVertical() ? y + (isNorthDirected ? 0 : -height) : x,
|
|
182
|
-
w: this.isVertical() ? width : height,
|
|
183
|
-
h: this.isVertical() ? height : width,
|
|
184
|
-
tl: roundedTop || roundedLeft,
|
|
185
|
-
tr: roundedTop || roundedRight,
|
|
186
|
-
bl: roundedBottom || roundedLeft,
|
|
187
|
-
br: roundedBottom || roundedRight,
|
|
188
|
-
r: cornerRadiusClamped,
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
_getGroupWidth() {
|
|
192
|
-
const { config, datamodel: { data }, } = this;
|
|
193
|
-
if (isEmpty(data))
|
|
194
|
-
return 0;
|
|
195
|
-
if (config.groupWidth) {
|
|
196
|
-
return min([config.groupWidth, config.groupMaxWidth]);
|
|
197
|
-
}
|
|
198
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
199
|
-
// @ts-ignore
|
|
200
|
-
const isOrdinal = this.dataScale.bandwidth;
|
|
201
|
-
const domain = (this.dataScale.domain ? this.dataScale.domain() : []);
|
|
202
|
-
const domainLength = isOrdinal ? domain.length : domain[1] - domain[0];
|
|
203
|
-
// If the dataStep property is provided the amount of data elements is calculates as domainLength / dataStep
|
|
204
|
-
// otherwise we get the number of data elements within the domain range
|
|
205
|
-
// Or if the scale is ordinal we use data.length
|
|
206
|
-
let dataSize = 1 + domainLength / config.dataStep ||
|
|
207
|
-
(!isOrdinal &&
|
|
208
|
-
data.filter((d, i) => {
|
|
209
|
-
const value = getNumber(d, config.x, i);
|
|
210
|
-
return value >= domain[0] && value <= domain[1];
|
|
211
|
-
}).length) ||
|
|
212
|
-
data.length;
|
|
213
|
-
// We increase the dataSize by 1 to take into account possible additional domain space
|
|
214
|
-
if (!isOrdinal && dataSize >= 2)
|
|
215
|
-
dataSize += 1;
|
|
216
|
-
const c = dataSize < 2 ? 1 : 1 - config.groupPadding;
|
|
217
|
-
const groupWidth = (c * (this.isVertical() ? this._width : this._height)) / dataSize;
|
|
218
|
-
return min([groupWidth, config.groupMaxWidth]);
|
|
219
|
-
}
|
|
220
|
-
getValueScaleExtent(scaleByVisibleData) {
|
|
221
|
-
const { datamodel } = this;
|
|
222
|
-
const yAccessors = this.getAccessors();
|
|
223
|
-
const data = scaleByVisibleData ? this._getVisibleData() : datamodel.data;
|
|
224
|
-
const min = getMin(data, ...yAccessors);
|
|
225
|
-
const max = getMax(data, ...yAccessors);
|
|
226
|
-
return [min > 0 ? 0 : min, max < 0 ? 0 : max];
|
|
227
|
-
}
|
|
228
|
-
_raiseSelection(d, i, els) {
|
|
229
|
-
select(els[i]).raise();
|
|
230
|
-
}
|
|
231
|
-
getDataScaleExtent() {
|
|
232
|
-
const { config, datamodel } = this;
|
|
233
|
-
return getExtent(datamodel.data, config.x);
|
|
234
|
-
}
|
|
235
|
-
getYDataExtent(scaleByVisibleData) {
|
|
236
|
-
return this.isVertical()
|
|
237
|
-
? this.getValueScaleExtent(scaleByVisibleData)
|
|
238
|
-
: this.getDataScaleExtent();
|
|
239
|
-
}
|
|
240
|
-
getXDataExtent() {
|
|
241
|
-
return this.isVertical()
|
|
242
|
-
? this.getDataScaleExtent()
|
|
243
|
-
: this.getValueScaleExtent(false);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
GroupedBar.selectors = style;
|
|
247
|
-
|
|
248
|
-
export { GroupedBar };
|
|
249
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/grouped-bar/index.ts"],"sourcesContent":["import { scaleBand } from 'd3-scale'\nimport { min, max, range } from 'd3-array'\nimport { select } from 'd3'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { clamp, getExtent, getMax, getMin, getNumber, getString, isArray, isEmpty, isNumber } from 'utils/data'\nimport { roundedRectPath } from 'utils/path'\nimport { smartTransition } from 'utils/d3'\nimport { getColor } from 'utils/color'\n\n// Types\nimport { NumericAccessor } from 'types/accessor'\nimport { Spacing } from 'types/spacing'\nimport { Direction } from 'types/direction'\nimport { Orientation } from 'types/position'\nimport { ContinuousScale } from 'types/scale'\n\n// Config\nimport { GroupedBarConfig, GroupedBarConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class GroupedBar<Datum> extends XYComponentCore<Datum, GroupedBarConfig<Datum>, GroupedBarConfigInterface<Datum>> {\n static selectors = s\n config: GroupedBarConfig<Datum> = new GroupedBarConfig()\n getAccessors = (): NumericAccessor<Datum>[] =>\n isArray(this.config.y) ? this.config.y : [this.config.y]\n\n events = {\n [GroupedBar.selectors.barGroup]: {\n mouseover: this._raiseSelection,\n },\n [GroupedBar.selectors.bar]: {\n mouseover: this._raiseSelection,\n },\n }\n\n private _barData: Datum[] = []\n\n constructor (config?: GroupedBarConfigInterface<Datum>) {\n super()\n if (config) this.config.init(config)\n }\n\n get bleed (): Spacing {\n this._barData = this._getVisibleData()\n if (this._barData.length === 0) return { top: 0, bottom: 0, left: 0, right: 0 }\n\n // By default, horizontal orientation is \"flipped\", i.e. the `yDirection` of `XYContainer` is set to `Direction.North`\n const isHorizontalAndFlipped = !this.isVertical() && (this.dataScale.range()[0] > this.dataScale.range()[1])\n const dataDomain = this.dataScale.domain()\n const halfGroupWidth = this._getGroupWidth() / 2\n\n const dataScaleValues = this._barData.map((d, i) => getNumber(d, this.config.x, i))\n const firstDataValue = min(dataScaleValues)\n const lastDataValue = max(dataScaleValues)\n const firstValuePx = this.dataScale(firstDataValue)\n const lastValuePx = this.dataScale(lastDataValue)\n\n const dataDomainRequiredStart = this.dataScale.invert(firstValuePx + (isHorizontalAndFlipped ? halfGroupWidth : -halfGroupWidth))\n const dataDomainRequiredEnd = this.dataScale.invert(lastValuePx + (isHorizontalAndFlipped ? -halfGroupWidth : halfGroupWidth))\n const bleedPxStart = dataDomainRequiredStart <= dataDomain[0] ? this.dataScale(dataDomain[0]) - this.dataScale(dataDomainRequiredStart) : 0\n const bleedPxEnd = dataDomainRequiredEnd > dataDomain[1] ? this.dataScale(dataDomainRequiredEnd) - this.dataScale(dataDomain[1]) : 0\n\n return {\n top: this.isVertical() ? 0 : (isHorizontalAndFlipped ? -bleedPxEnd : bleedPxStart),\n bottom: this.isVertical() ? 0 : (isHorizontalAndFlipped ? -bleedPxStart : bleedPxEnd),\n left: this.isVertical() ? bleedPxStart : 0,\n right: this.isVertical() ? bleedPxEnd : 0,\n }\n }\n\n private get dataScale (): ContinuousScale {\n return this.isVertical() ? this.xScale : this.yScale\n }\n\n private get valueScale (): ContinuousScale {\n return this.isVertical() ? this.yScale : this.xScale\n }\n\n private isVertical (): boolean {\n return this.config.orientation === Orientation.Vertical\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration)\n ? customDuration\n : config.duration\n const groupWidth = this._getGroupWidth()\n\n const yAccessors = this.getAccessors()\n const innerBandScaleRange = [-groupWidth / 2, groupWidth / 2] as [\n number,\n number,\n ]\n const innerBandScale = scaleBand<number>()\n .domain(range(yAccessors.length))\n .range(innerBandScaleRange)\n .paddingInner(config.barPadding)\n .paddingOuter(config.barPadding)\n\n const barGroups = this.g\n .selectAll<SVGGElement, Datum>(`.${s.barGroup}`)\n .data(this._barData, (d, i) => `${getString(d, config.id, i) ?? i}`)\n\n const getBarGroupsTransform = (d: Datum, i: number): string => {\n const v = this.dataScale(getNumber(d, config.x, i))\n const x = this.isVertical() ? v : 0\n const y = this.isVertical() ? 0 : v\n return `translate(${x},${y})`\n }\n\n const barGroupsEnter = barGroups\n .enter()\n .append('g')\n .attr('class', s.barGroup)\n .attr('transform', getBarGroupsTransform)\n .style('opacity', 1)\n\n const barGroupsMerged = barGroupsEnter.merge(barGroups)\n smartTransition(barGroupsMerged, duration)\n .attr('transform', getBarGroupsTransform)\n .style('opacity', 1)\n\n const barGroupExit = barGroups.exit().attr('class', s.barGroupExit)\n smartTransition(barGroupExit, duration).style('opacity', 0).remove()\n\n // Animate exiting bars going down\n smartTransition(barGroupExit.selectAll<SVGPathElement, Datum>(`.${s.bar}`), duration)\n .attr('transform', (d, i, e) => {\n return this.isVertical()\n ? `translate(0,${this.yScale(0)}) scale(1,0)`\n : `translate(${this.xScale(0)},0) scale(0,1)`\n })\n\n const barWidth = innerBandScale.bandwidth()\n const bars = barGroupsMerged\n .selectAll<SVGPathElement, Datum>(`.${s.bar}`)\n .data((d) => yAccessors.map(() => d))\n\n const valueAxisDirection = this._getValueAxisDirection()\n const barsEnter = bars\n .enter()\n .append('path')\n .attr('class', s.bar)\n .attr('d', (d, i) => {\n const x = innerBandScale(i)\n const y = this.valueScale(0)\n const width = barWidth\n const height = 0\n return this._getBarPath(x, y, width, height, false, valueAxisDirection)\n })\n .style('fill', (d, i) => getColor(d, config.color, i))\n\n const barsMerged = barsEnter.merge(bars)\n smartTransition(barsMerged, duration)\n .attr('d', (d, j) => {\n const x = innerBandScale(j)\n const width = barWidth\n\n // Todo: Find a way to pass the datum index to `getNumber` below\n const value = getNumber(d, yAccessors[j])\n const isNegative = value < 0\n let y = isNegative ? this.valueScale(0) : this.valueScale(value || 0)\n let height = Math.abs(this.valueScale(0) - this.valueScale(value)) || 0\n\n // Optionally set minimum bar height\n if (height < config.barMinHeight) {\n const dir = valueAxisDirection === Direction.North ? -1 : 1\n y = this.valueScale(0) + dir * config.barMinHeight\n height = config.barMinHeight\n }\n return this._getBarPath(x, y, width, height, isNegative, valueAxisDirection)\n })\n .style('fill', (d, i) => getColor(d, config.color, i))\n .style('cursor', (d, i) => getString(d, config.cursor, i))\n\n smartTransition(bars.exit(), duration).remove()\n }\n\n _getValueAxisDirection (): Direction.North | Direction.South {\n return this.valueScale.range()[0] > this.valueScale.range()[1]\n ? Direction.North\n : Direction.South\n }\n\n _getVisibleData (): Datum[] {\n const {\n config,\n datamodel: { data },\n } = this\n const groupWidth = this._getGroupWidth()\n const halfGroupWidth = data.length < 2 ? 0 : groupWidth / 2\n\n const dataScale = this.dataScale\n const xHalfGroupWidth = Math.abs(\n (dataScale.invert(halfGroupWidth) as number) -\n (dataScale.invert(0) as number)\n )\n const filtered = data?.filter((d, i) => {\n const v = getNumber(d, config.x, i)\n const domain: number[] | Date[] = dataScale.domain()\n const domainMin = +domain[0]\n const domainMax = +domain[1]\n return (\n v >= domainMin - xHalfGroupWidth && v <= domainMax + xHalfGroupWidth\n )\n })\n\n return filtered\n }\n\n _getBarPath (\n x: number,\n y: number,\n width: number,\n height: number,\n isNegative: boolean,\n direction: Direction.North | Direction.South\n ): string {\n const { config } = this\n\n const cornerRadius = config.roundedCorners\n ? isNumber(config.roundedCorners)\n ? +config.roundedCorners\n : width / 2\n : 0\n const cornerRadiusClamped = clamp(\n cornerRadius,\n 0,\n Math.min(height, width) / 2\n )\n\n const isNorthDirected = direction === Direction.North\n const roundedTop = this.isVertical() && isNegative !== isNorthDirected\n const roundedBottom = this.isVertical() && isNegative === isNorthDirected\n const roundedLeft = !this.isVertical() && isNegative\n const roundedRight = !this.isVertical() && !isNegative\n\n return roundedRectPath({\n x: this.isVertical() ? x : y + (isNorthDirected ? 0 : -height),\n y: this.isVertical() ? y + (isNorthDirected ? 0 : -height) : x,\n w: this.isVertical() ? width : height,\n h: this.isVertical() ? height : width,\n tl: roundedTop || roundedLeft,\n tr: roundedTop || roundedRight,\n bl: roundedBottom || roundedLeft,\n br: roundedBottom || roundedRight,\n r: cornerRadiusClamped,\n })\n }\n\n _getGroupWidth (): number {\n const {\n config,\n datamodel: { data },\n } = this\n if (isEmpty(data)) return 0\n if (config.groupWidth) { return min([config.groupWidth, config.groupMaxWidth]) }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const isOrdinal = this.dataScale.bandwidth\n const domain = (\n this.dataScale.domain ? this.dataScale.domain() : []\n ) as number[]\n const domainLength = isOrdinal ? domain.length : domain[1] - domain[0]\n\n // If the dataStep property is provided the amount of data elements is calculates as domainLength / dataStep\n // otherwise we get the number of data elements within the domain range\n // Or if the scale is ordinal we use data.length\n let dataSize =\n 1 + domainLength / config.dataStep ||\n (!isOrdinal &&\n data.filter((d, i) => {\n const value = getNumber(d, config.x, i)\n return value >= domain[0] && value <= domain[1]\n }).length) ||\n data.length\n\n // We increase the dataSize by 1 to take into account possible additional domain space\n if (!isOrdinal && dataSize >= 2) dataSize += 1\n\n const c = dataSize < 2 ? 1 : 1 - config.groupPadding\n const groupWidth =\n (c * (this.isVertical() ? this._width : this._height)) / dataSize\n return min([groupWidth, config.groupMaxWidth])\n }\n\n getValueScaleExtent (scaleByVisibleData: boolean): number[] {\n const { datamodel } = this\n const yAccessors = this.getAccessors()\n\n const data = scaleByVisibleData ? this._getVisibleData() : datamodel.data\n const min = getMin(data, ...yAccessors)\n const max = getMax(data, ...yAccessors)\n return [min > 0 ? 0 : min, max < 0 ? 0 : max]\n }\n\n _raiseSelection (d, i, els): void {\n select(els[i]).raise()\n }\n\n getDataScaleExtent (): number[] {\n const { config, datamodel } = this\n return getExtent(datamodel.data, config.x)\n }\n\n getYDataExtent (scaleByVisibleData: boolean): number[] {\n return this.isVertical()\n ? this.getValueScaleExtent(scaleByVisibleData)\n : this.getDataScaleExtent()\n }\n\n getXDataExtent (): number[] {\n return this.isVertical()\n ? this.getDataScaleExtent()\n : this.getValueScaleExtent(false)\n }\n}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AAkB,EAAE,CAAA;KAC9B;IAED,cAAc,GAAA;QACZ,OAAO,IAAI,CAAC,UAAU,EAAE;AACtB,cAAE,IAAI,CAAC,kBAAkB,EAAE;AAC3B,cAAE,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAA;KACpC;;AAxSM,UAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/grouped-bar/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const root = css`\n label: grouped-bar-component;\n`\n\nexport const globalStyles = injectGlobal`\n :root {\n --vis-grouped-bar-cursor: default;\n --vis-grouped-bar-fill-color: var(--vis-color-main);\n --vis-grouped-bar-stroke-color: none;\n --vis-grouped-bar-stroke-width: 0px;\n --vis-grouped-bar-hover-stroke-width: 1px;\n --vis-grouped-bar-hover-stroke-color: none;\n\n\n /* Dark Theme */\n --vis-dark-grouped-bar-stroke-color: none;\n }\n\n body.theme-dark ${`.${root}`} {\n --vis-grouped-bar-stroke-color: var(--vis-dark-grouped-bar-stroke-color);\n }\n`\n\nexport const bar = css`\n label: bar;\n fill: var(--vis-grouped-bar-fill-color);\n stroke: var(--vis-grouped-bar-stroke-color);\n stroke-width: var(--vis-grouped-bar-stroke-width);\n cursor: var(--vis-grouped-bar-cursor);\n\n &:hover {\n stroke-width: var(--vis-grouped-bar-hover-stroke-width);\n stroke: var(--vis-grouped-bar-hover-stroke-color);\n }\n`\n\nexport const barGroup = css`\n label: barGroup;\n`\n\nexport const barGroupExit = css`\n label: barGroupExit;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,YAAY,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;AAcpB,kBAAA,EAAA,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;EAG7B;AAEM,MAAM,GAAG,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;EAWrB;AAEM,MAAM,QAAQ,GAAG,GAAG,CAAA,CAAA;;EAE1B;AAEM,MAAM,YAAY,GAAG,GAAG,CAAA,CAAA;;;;;;"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { LeafletMapConfig, LeafletMapConfigInterface } from "../leaflet-map/config";
|
|
2
|
-
import { ColorAccessor, NumericAccessor } from "../../types/accessor";
|
|
3
|
-
import { GenericDataRecord } from "../../types/data";
|
|
4
|
-
export interface LeafletFlowMapConfigInterface<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> extends LeafletMapConfigInterface<PointDatum> {
|
|
5
|
-
/** Flow source point longitude accessor function or value. Default:.`f => f.sourceLongitude` */
|
|
6
|
-
sourceLongitude?: NumericAccessor<FlowDatum>;
|
|
7
|
-
/** Flow source point latitude accessor function or value. Default: `f => f.sourceLatitude` */
|
|
8
|
-
sourceLatitude?: NumericAccessor<FlowDatum>;
|
|
9
|
-
/** Flow target point longitude accessor function or value. Default: `f => f.targetLongitude` */
|
|
10
|
-
targetLongitude?: NumericAccessor<FlowDatum>;
|
|
11
|
-
/** Flow target point latitude accessor function or value. Default: `f => f.targetLatitude` */
|
|
12
|
-
targetLatitude?: NumericAccessor<FlowDatum>;
|
|
13
|
-
/** Flow source point radius accessor function or value. Default: `3` */
|
|
14
|
-
sourcePointRadius?: NumericAccessor<FlowDatum>;
|
|
15
|
-
/** Source point color accessor function or value. Default: `'#88919f'` */
|
|
16
|
-
sourcePointColor?: ColorAccessor<FlowDatum>;
|
|
17
|
-
/** Flow particle color accessor function or value. Default: `'#949dad'` */
|
|
18
|
-
flowParticleColor?: ColorAccessor<FlowDatum>;
|
|
19
|
-
/** Flow particle radius accessor function or value. Default: `1.1` */
|
|
20
|
-
flowParticleRadius?: NumericAccessor<FlowDatum>;
|
|
21
|
-
/** Flow particle speed accessor function or value. The unit is arbitrary, recommended range is 0 – 0.2. Default: `0.07` */
|
|
22
|
-
flowParticleSpeed?: NumericAccessor<FlowDatum>;
|
|
23
|
-
/** Flow particle density accessor function or value on the range of [0, 1]. Default: `0.6` */
|
|
24
|
-
flowParticleDensity?: NumericAccessor<FlowDatum>;
|
|
25
|
-
/** Flow source point click callback function. Default: `undefined` */
|
|
26
|
-
onSourcePointClick?: (f: FlowDatum, x: number, y: number, event: MouseEvent) => void;
|
|
27
|
-
/** Flow source point mouse over callback function. Default: `undefined` */
|
|
28
|
-
onSourcePointMouseEnter?: (f: FlowDatum, x: number, y: number, event: MouseEvent) => void;
|
|
29
|
-
/** Flow source point mouse leave callback function. Default: `undefined` */
|
|
30
|
-
onSourcePointMouseLeave?: (f: FlowDatum, event: MouseEvent) => void;
|
|
31
|
-
}
|
|
32
|
-
export declare class LeafletFlowMapConfig<PointDatum extends GenericDataRecord = GenericDataRecord, FlowDatum extends GenericDataRecord = GenericDataRecord> extends LeafletMapConfig<PointDatum> implements LeafletFlowMapConfigInterface<PointDatum, FlowDatum> {
|
|
33
|
-
sourceLongitude: (f: FlowDatum) => number;
|
|
34
|
-
sourceLatitude: (f: FlowDatum) => number;
|
|
35
|
-
targetLongitude: (f: FlowDatum) => number;
|
|
36
|
-
targetLatitude: (f: FlowDatum) => number;
|
|
37
|
-
sourcePointRadius: number;
|
|
38
|
-
sourcePointColor: string;
|
|
39
|
-
flowParticleColor: string;
|
|
40
|
-
flowParticleRadius: number;
|
|
41
|
-
flowParticleSpeed: number;
|
|
42
|
-
flowParticleDensity: number;
|
|
43
|
-
onSourcePointClick: any;
|
|
44
|
-
onSourcePointMouseEnter: any;
|
|
45
|
-
onSourcePointMouseLeave: any;
|
|
46
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { LeafletMapConfig } from '../leaflet-map/config.js';
|
|
2
|
-
|
|
3
|
-
/* eslint-disable dot-notation */
|
|
4
|
-
class LeafletFlowMapConfig extends LeafletMapConfig {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.sourceLongitude = (f) => f['sourceLongitude'];
|
|
8
|
-
this.sourceLatitude = (f) => f['sourceLatitude'];
|
|
9
|
-
this.targetLongitude = (f) => f['targetLongitude'];
|
|
10
|
-
this.targetLatitude = (f) => f['targetLatitude'];
|
|
11
|
-
this.sourcePointRadius = 3;
|
|
12
|
-
this.sourcePointColor = '#88919f';
|
|
13
|
-
this.flowParticleColor = '#949dad';
|
|
14
|
-
this.flowParticleRadius = 1.1;
|
|
15
|
-
this.flowParticleSpeed = 0.07;
|
|
16
|
-
this.flowParticleDensity = 0.6;
|
|
17
|
-
// Events
|
|
18
|
-
this.onSourcePointClick = undefined;
|
|
19
|
-
this.onSourcePointMouseEnter = undefined;
|
|
20
|
-
this.onSourcePointMouseLeave = undefined;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { LeafletFlowMapConfig };
|
|
25
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/leaflet-flow-map/config.ts"],"sourcesContent":["/* eslint-disable dot-notation */\n\n// Config\nimport { LeafletMapConfig, LeafletMapConfigInterface } from 'components/leaflet-map/config'\n\n// Types\nimport { ColorAccessor, NumericAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\nexport interface LeafletFlowMapConfigInterface<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> extends LeafletMapConfigInterface<PointDatum> {\n /** Flow source point longitude accessor function or value. Default:.`f => f.sourceLongitude` */\n sourceLongitude?: NumericAccessor<FlowDatum>;\n /** Flow source point latitude accessor function or value. Default: `f => f.sourceLatitude` */\n sourceLatitude?: NumericAccessor<FlowDatum>;\n /** Flow target point longitude accessor function or value. Default: `f => f.targetLongitude` */\n targetLongitude?: NumericAccessor<FlowDatum>;\n /** Flow target point latitude accessor function or value. Default: `f => f.targetLatitude` */\n targetLatitude?: NumericAccessor<FlowDatum>;\n /** Flow source point radius accessor function or value. Default: `3` */\n sourcePointRadius?: NumericAccessor<FlowDatum>;\n /** Source point color accessor function or value. Default: `'#88919f'` */\n sourcePointColor?: ColorAccessor<FlowDatum>;\n /** Flow particle color accessor function or value. Default: `'#949dad'` */\n flowParticleColor?: ColorAccessor<FlowDatum>;\n /** Flow particle radius accessor function or value. Default: `1.1` */\n flowParticleRadius?: NumericAccessor<FlowDatum>;\n /** Flow particle speed accessor function or value. The unit is arbitrary, recommended range is 0 – 0.2. Default: `0.07` */\n flowParticleSpeed?: NumericAccessor<FlowDatum>;\n /** Flow particle density accessor function or value on the range of [0, 1]. Default: `0.6` */\n flowParticleDensity?: NumericAccessor<FlowDatum>;\n\n // Events\n /** Flow source point click callback function. Default: `undefined` */\n onSourcePointClick?: (f: FlowDatum, x: number, y: number, event: MouseEvent) => void;\n /** Flow source point mouse over callback function. Default: `undefined` */\n onSourcePointMouseEnter?: (f: FlowDatum, x: number, y: number, event: MouseEvent) => void;\n /** Flow source point mouse leave callback function. Default: `undefined` */\n onSourcePointMouseLeave?: (f: FlowDatum, event: MouseEvent) => void;\n}\n\nexport class LeafletFlowMapConfig<\n PointDatum extends GenericDataRecord = GenericDataRecord,\n FlowDatum extends GenericDataRecord = GenericDataRecord,\n> extends LeafletMapConfig<PointDatum> implements LeafletFlowMapConfigInterface<PointDatum, FlowDatum> {\n sourceLongitude = (f: FlowDatum): number => f['sourceLongitude'] as number\n sourceLatitude = (f: FlowDatum): number => f['sourceLatitude'] as number\n targetLongitude = (f: FlowDatum): number => f['targetLongitude'] as number\n targetLatitude = (f: FlowDatum): number => f['targetLatitude'] as number\n sourcePointRadius = 3\n sourcePointColor = '#88919f'\n flowParticleColor = '#949dad'\n flowParticleRadius = 1.1\n flowParticleSpeed = 0.07\n flowParticleDensity = 0.6\n\n // Events\n onSourcePointClick = undefined\n onSourcePointMouseEnter = undefined\n onSourcePointMouseLeave = undefined\n}\n"],"names":[],"mappings":";;AAAA;AAwCM,MAAO,oBAGX,SAAQ,gBAA4B,CAAA;AAHtC,IAAA,WAAA,GAAA;;QAIE,IAAe,CAAA,eAAA,GAAG,CAAC,CAAY,KAAa,CAAC,CAAC,iBAAiB,CAAW,CAAA;QAC1E,IAAc,CAAA,cAAA,GAAG,CAAC,CAAY,KAAa,CAAC,CAAC,gBAAgB,CAAW,CAAA;QACxE,IAAe,CAAA,eAAA,GAAG,CAAC,CAAY,KAAa,CAAC,CAAC,iBAAiB,CAAW,CAAA;QAC1E,IAAc,CAAA,cAAA,GAAG,CAAC,CAAY,KAAa,CAAC,CAAC,gBAAgB,CAAW,CAAA;QACxE,IAAiB,CAAA,iBAAA,GAAG,CAAC,CAAA;QACrB,IAAgB,CAAA,gBAAA,GAAG,SAAS,CAAA;QAC5B,IAAiB,CAAA,iBAAA,GAAG,SAAS,CAAA;QAC7B,IAAkB,CAAA,kBAAA,GAAG,GAAG,CAAA;QACxB,IAAiB,CAAA,iBAAA,GAAG,IAAI,CAAA;QACxB,IAAmB,CAAA,mBAAA,GAAG,GAAG,CAAA;;QAGzB,IAAkB,CAAA,kBAAA,GAAG,SAAS,CAAA;QAC9B,IAAuB,CAAA,uBAAA,GAAG,SAAS,CAAA;QACnC,IAAuB,CAAA,uBAAA,GAAG,SAAS,CAAA;KACpC;AAAA;;;;"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ComponentCore } from "../../core/component";
|
|
2
|
-
import { ComponentType } from "../../types/component";
|
|
3
|
-
import { GenericDataRecord } from "../../types/data";
|
|
4
|
-
import { LeafletFlowMapConfig, LeafletFlowMapConfigInterface } from './config';
|
|
5
|
-
import { Particle } from './types';
|
|
6
|
-
export declare class LeafletFlowMap<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> extends ComponentCore<{
|
|
7
|
-
points: PointDatum[];
|
|
8
|
-
flows?: FlowDatum[];
|
|
9
|
-
}, LeafletFlowMapConfig<PointDatum, FlowDatum>, LeafletFlowMapConfigInterface<PointDatum, FlowDatum>> {
|
|
10
|
-
static selectors: typeof import("../leaflet-map/style");
|
|
11
|
-
type: ComponentType;
|
|
12
|
-
private leafletMap;
|
|
13
|
-
private leafletMapInstance;
|
|
14
|
-
private flows;
|
|
15
|
-
private points;
|
|
16
|
-
private hoveredSourcePoint;
|
|
17
|
-
private onCanvasMouseMoveBound;
|
|
18
|
-
private onCanvasClickBound;
|
|
19
|
-
private canvasElement;
|
|
20
|
-
config: LeafletFlowMapConfig<PointDatum, FlowDatum>;
|
|
21
|
-
private panningOffset;
|
|
22
|
-
private resizeObserver;
|
|
23
|
-
private renderer;
|
|
24
|
-
particles: Particle[];
|
|
25
|
-
constructor(container: HTMLDivElement, config?: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>, data?: {
|
|
26
|
-
points: PointDatum[];
|
|
27
|
-
flows?: FlowDatum[];
|
|
28
|
-
});
|
|
29
|
-
setConfig(config: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>): void;
|
|
30
|
-
setData(data: {
|
|
31
|
-
points: PointDatum[];
|
|
32
|
-
flows?: FlowDatum[];
|
|
33
|
-
}): void;
|
|
34
|
-
render(): void;
|
|
35
|
-
initParticles(): void;
|
|
36
|
-
private addParticle;
|
|
37
|
-
private clearParticles;
|
|
38
|
-
private animate;
|
|
39
|
-
private getPointByScreenPos;
|
|
40
|
-
private onCanvasMouseMove;
|
|
41
|
-
private onCanvasClick;
|
|
42
|
-
private onMapMove;
|
|
43
|
-
destroy(): void;
|
|
44
|
-
selectPointById(id: string, centerPoint?: boolean): void;
|
|
45
|
-
getSelectedPointId(): string | number | undefined;
|
|
46
|
-
unselectPoint(): void;
|
|
47
|
-
zoomToPointById(id: string, selectNode?: boolean, customZoomLevel?: number): void;
|
|
48
|
-
zoomIn(increment?: number): void;
|
|
49
|
-
zoomOut(increment?: number): void;
|
|
50
|
-
setZoom(zoomLevel: number): void;
|
|
51
|
-
fitView(): void;
|
|
52
|
-
}
|