@unovis/ts 1.1.1-beta.7 → 1.1.1-beta.8
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/components/area/config.d.ts +25 -0
- package/components/area/config.js +16 -0
- package/components/area/config.js.map +1 -0
- package/components/area/index.d.ts +19 -0
- package/components/area/index.js +102 -0
- package/components/area/index.js.map +1 -0
- package/components/area/style.d.ts +3 -0
- package/{src/components/area/style.ts → components/area/style.js} +10 -9
- package/components/area/style.js.map +1 -0
- package/components/area/types.d.ts +6 -0
- package/components/axis/config.d.ts +71 -0
- package/components/axis/config.js +32 -0
- package/components/axis/config.js.map +1 -0
- package/components/axis/index.d.ts +44 -0
- package/components/axis/index.js +305 -0
- package/components/axis/index.js.map +1 -0
- package/components/axis/style.d.ts +9 -0
- package/{src/components/axis/style.ts → components/axis/style.js} +22 -27
- package/components/axis/style.js.map +1 -0
- package/components/axis/types.d.ts +4 -0
- package/components/axis/types.js +8 -0
- package/components/axis/types.js.map +1 -0
- package/components/brush/config.d.ts +42 -0
- package/components/brush/config.js +24 -0
- package/components/brush/config.js.map +1 -0
- package/components/brush/index.d.ts +28 -0
- package/components/brush/index.js +199 -0
- package/components/brush/index.js.map +1 -0
- package/components/brush/style.d.ts +5 -0
- package/{src/components/brush/style.ts → components/brush/style.js} +14 -15
- package/components/brush/style.js.map +1 -0
- package/components/brush/types.d.ts +7 -0
- package/components/brush/types.js +8 -0
- package/components/brush/types.js.map +1 -0
- package/components/bullet-legend/config.d.ts +34 -0
- package/components/bullet-legend/config.js +16 -0
- package/components/bullet-legend/config.js.map +1 -0
- package/components/bullet-legend/index.d.ts +19 -0
- package/components/bullet-legend/index.js +79 -0
- package/components/bullet-legend/index.js.map +1 -0
- package/components/bullet-legend/style.d.ts +6 -0
- package/{src/components/bullet-legend/style.ts → components/bullet-legend/style.js} +16 -18
- package/components/bullet-legend/style.js.map +1 -0
- package/components/bullet-legend/types.d.ts +7 -0
- package/components/bullet-legend/types.js +2 -0
- package/components/bullet-legend/types.js.map +1 -0
- package/components/chord-diagram/config.d.ts +44 -0
- package/components/chord-diagram/config.js +25 -0
- package/components/chord-diagram/config.js.map +1 -0
- package/components/chord-diagram/index.d.ts +42 -0
- package/components/chord-diagram/index.js +305 -0
- package/components/chord-diagram/index.js.map +1 -0
- package/components/chord-diagram/modules/label.d.ts +8 -0
- package/components/chord-diagram/modules/label.js +115 -0
- package/components/chord-diagram/modules/label.js.map +1 -0
- package/components/chord-diagram/modules/link.d.ts +21 -0
- package/components/chord-diagram/modules/link.js +63 -0
- package/components/chord-diagram/modules/link.js.map +1 -0
- package/components/chord-diagram/modules/node.d.ts +17 -0
- package/components/chord-diagram/modules/node.js +52 -0
- package/components/chord-diagram/modules/node.js.map +1 -0
- package/components/chord-diagram/style.d.ts +13 -0
- package/{src/components/chord-diagram/style.ts → components/chord-diagram/style.js} +30 -39
- package/components/chord-diagram/style.js.map +1 -0
- package/components/chord-diagram/types.d.ts +58 -0
- package/components/chord-diagram/types.js +8 -0
- package/components/chord-diagram/types.js.map +1 -0
- package/components/crosshair/config.d.ts +43 -0
- package/components/crosshair/config.js +19 -0
- package/components/crosshair/config.js.map +1 -0
- package/components/crosshair/index.d.ts +35 -0
- package/components/crosshair/index.js +183 -0
- package/components/crosshair/index.js.map +1 -0
- package/components/crosshair/style.d.ts +4 -0
- package/{src/components/crosshair/style.ts → components/crosshair/style.js} +12 -12
- package/components/crosshair/style.js.map +1 -0
- package/components/crosshair/types.d.ts +13 -0
- package/components/crosshair/types.js +2 -0
- package/components/crosshair/types.js.map +1 -0
- package/components/donut/config.d.ts +59 -0
- package/components/donut/config.js +28 -0
- package/components/donut/config.js.map +1 -0
- package/components/donut/index.d.ts +21 -0
- package/components/donut/index.js +107 -0
- package/components/donut/index.js.map +1 -0
- package/components/donut/modules/arc.d.ts +10 -0
- package/components/donut/modules/arc.js +59 -0
- package/components/donut/modules/arc.js.map +1 -0
- package/components/donut/style.d.ts +7 -0
- package/{src/components/donut/style.ts → components/donut/style.js} +18 -20
- package/components/donut/style.js.map +1 -0
- package/components/donut/types.d.ts +20 -0
- package/components/flow-legend/config.d.ts +29 -0
- package/components/flow-legend/config.js +18 -0
- package/components/flow-legend/config.js.map +1 -0
- package/components/flow-legend/index.d.ts +16 -0
- package/components/flow-legend/index.js +75 -0
- package/components/flow-legend/index.js.map +1 -0
- package/components/flow-legend/style.d.ts +8 -0
- package/{src/components/flow-legend/style.ts → components/flow-legend/style.js} +21 -25
- package/components/flow-legend/style.js.map +1 -0
- package/components/flow-legend/types.d.ts +9 -0
- package/components/flow-legend/types.js +8 -0
- package/components/flow-legend/types.js.map +1 -0
- package/components/free-brush/config.d.ts +45 -0
- package/components/free-brush/config.js +24 -0
- package/components/free-brush/config.js.map +1 -0
- package/components/free-brush/index.d.ts +20 -0
- package/components/free-brush/index.js +192 -0
- package/components/free-brush/index.js.map +1 -0
- package/components/free-brush/style.d.ts +4 -0
- package/{src/components/free-brush/style.ts → components/free-brush/style.js} +12 -12
- package/components/free-brush/style.js.map +1 -0
- package/components/free-brush/types.d.ts +7 -0
- package/components/free-brush/types.js +9 -0
- package/components/free-brush/types.js.map +1 -0
- package/components/graph/config.d.ts +238 -0
- package/components/graph/config.js +84 -0
- package/components/graph/config.js.map +1 -0
- package/components/graph/index.d.ts +126 -0
- package/components/graph/index.js +656 -0
- package/components/graph/index.js.map +1 -0
- package/components/graph/modules/layout-helpers.d.ts +21 -0
- package/components/graph/modules/layout-helpers.js +69 -0
- package/components/graph/modules/layout-helpers.js.map +1 -0
- package/components/graph/modules/layout.d.ts +10 -0
- package/components/graph/modules/layout.js +399 -0
- package/components/graph/modules/layout.js.map +1 -0
- package/components/graph/modules/link/helper.d.ts +25 -0
- package/components/graph/modules/link/helper.js +74 -0
- package/components/graph/modules/link/helper.js.map +1 -0
- package/components/graph/modules/link/index.d.ts +11 -0
- package/components/graph/modules/link/index.js +212 -0
- package/components/graph/modules/link/index.js.map +1 -0
- package/components/graph/modules/link/style.d.ts +15 -0
- package/{src/components/graph/modules/link/style.ts → components/graph/modules/link/style.js} +34 -45
- package/components/graph/modules/link/style.js.map +1 -0
- package/components/graph/modules/node/helper.d.ts +21 -0
- package/components/graph/modules/node/helper.js +126 -0
- package/components/graph/modules/node/helper.js.map +1 -0
- package/components/graph/modules/node/index.d.ts +11 -0
- package/components/graph/modules/node/index.js +252 -0
- package/components/graph/modules/node/index.js.map +1 -0
- package/components/graph/modules/node/style.d.ts +24 -0
- package/{src/components/graph/modules/node/style.ts → components/graph/modules/node/style.js} +52 -72
- package/components/graph/modules/node/style.js.map +1 -0
- package/components/graph/modules/panel/helper.d.ts +18 -0
- package/components/graph/modules/panel/helper.js +111 -0
- package/components/graph/modules/panel/helper.js.map +1 -0
- package/components/graph/modules/panel/index.d.ts +7 -0
- package/components/graph/modules/panel/index.js +98 -0
- package/components/graph/modules/panel/index.js.map +1 -0
- package/components/graph/modules/panel/style.d.ts +14 -0
- package/{src/components/graph/modules/panel/style.ts → components/graph/modules/panel/style.js} +32 -42
- package/components/graph/modules/panel/style.js.map +1 -0
- package/components/graph/modules/shape.d.ts +6 -0
- package/components/graph/modules/shape.js +80 -0
- package/components/graph/modules/shape.js.map +1 -0
- package/components/graph/modules/zoom-levels.d.ts +6 -0
- package/components/graph/modules/zoom-levels.js +10 -0
- package/components/graph/modules/zoom-levels.js.map +1 -0
- package/components/graph/style.d.ts +6 -0
- package/components/graph/style.js +66 -0
- package/components/graph/style.js.map +1 -0
- package/components/graph/types.d.ts +125 -0
- package/components/graph/types.js +30 -0
- package/components/graph/types.js.map +1 -0
- package/components/grouped-bar/config.d.ts +36 -0
- package/components/grouped-bar/config.js +20 -0
- package/components/grouped-bar/config.js.map +1 -0
- package/components/grouped-bar/index.d.ts +32 -0
- package/components/grouped-bar/index.js +249 -0
- package/components/grouped-bar/index.js.map +1 -0
- package/components/grouped-bar/style.d.ts +5 -0
- package/{src/components/grouped-bar/style.ts → components/grouped-bar/style.js} +14 -15
- package/components/grouped-bar/style.js.map +1 -0
- package/components/leaflet-flow-map/config.d.ts +46 -0
- package/components/leaflet-flow-map/config.js +25 -0
- package/components/leaflet-flow-map/config.js.map +1 -0
- package/components/leaflet-flow-map/index.d.ts +52 -0
- package/components/leaflet-flow-map/index.js +220 -0
- package/components/leaflet-flow-map/index.js.map +1 -0
- package/components/leaflet-flow-map/renderer-utils.d.ts +5 -0
- package/components/leaflet-flow-map/renderer-utils.js +15 -0
- package/components/leaflet-flow-map/renderer-utils.js.map +1 -0
- package/components/leaflet-flow-map/renderer.d.ts +26 -0
- package/components/leaflet-flow-map/renderer.js +117 -0
- package/components/leaflet-flow-map/renderer.js.map +1 -0
- package/components/leaflet-flow-map/shaders.d.ts +2 -0
- package/{src/components/leaflet-flow-map/shaders.ts → components/leaflet-flow-map/shaders.js} +7 -4
- package/components/leaflet-flow-map/shaders.js.map +1 -0
- package/components/leaflet-flow-map/types.d.ts +23 -0
- package/components/leaflet-map/config.d.ts +193 -0
- package/components/leaflet-map/config.js +71 -0
- package/components/leaflet-map/config.js.map +1 -0
- package/components/leaflet-map/index.d.ts +130 -0
- package/components/leaflet-map/index.js +690 -0
- package/components/leaflet-map/index.js.map +1 -0
- package/components/leaflet-map/leaflet.css.js +5 -0
- package/components/leaflet-map/leaflet.css.js.map +1 -0
- package/components/leaflet-map/modules/clusterBackground.d.ts +5 -0
- package/components/leaflet-map/modules/clusterBackground.js +27 -0
- package/components/leaflet-map/modules/clusterBackground.js.map +1 -0
- package/components/leaflet-map/modules/donut.d.ts +3 -0
- package/components/leaflet-map/modules/donut.js +25 -0
- package/components/leaflet-map/modules/donut.js.map +1 -0
- package/components/leaflet-map/modules/map.d.ts +14 -0
- package/components/leaflet-map/modules/map.js +154 -0
- package/components/leaflet-map/modules/map.js.map +1 -0
- package/components/leaflet-map/modules/node.d.ts +9 -0
- package/components/leaflet-map/modules/node.js +162 -0
- package/components/leaflet-map/modules/node.js.map +1 -0
- package/components/leaflet-map/modules/selectionRing.d.ts +7 -0
- package/components/leaflet-map/modules/selectionRing.js +41 -0
- package/components/leaflet-map/modules/selectionRing.js.map +1 -0
- package/components/leaflet-map/modules/utils.d.ts +50 -0
- package/components/leaflet-map/modules/utils.js +210 -0
- package/components/leaflet-map/modules/utils.js.map +1 -0
- package/{src/components → components}/leaflet-map/renderer/leaflet-maplibre-gl.js +78 -76
- package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +1 -0
- package/components/leaflet-map/renderer/map-style.d.ts +4 -0
- package/components/leaflet-map/renderer/map-style.js +15 -0
- package/components/leaflet-map/renderer/map-style.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js +40 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js +40 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js +4981 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +8 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.js +27 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +4 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.js +39 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -0
- package/{src/components → components}/leaflet-map/renderer/maplibre-gl.css.js +4 -2
- package/components/leaflet-map/renderer/maplibre-gl.css.js.map +1 -0
- package/components/leaflet-map/style.d.ts +52 -0
- package/components/leaflet-map/style.js +183 -0
- package/components/leaflet-map/style.js.map +1 -0
- package/components/leaflet-map/types.d.ts +75 -0
- package/components/leaflet-map/types.js +15 -0
- package/components/leaflet-map/types.js.map +1 -0
- package/components/line/config.d.ts +30 -0
- package/components/line/config.js +17 -0
- package/components/line/config.js.map +1 -0
- package/components/line/index.d.ts +27 -0
- package/components/line/index.js +152 -0
- package/components/line/index.js.map +1 -0
- package/components/line/style.d.ts +6 -0
- package/{src/components/line/style.ts → components/line/style.js} +16 -18
- package/components/line/style.js.map +1 -0
- package/components/line/types.d.ts +12 -0
- package/components/nested-donut/config.d.ts +59 -0
- package/components/nested-donut/config.js +19 -0
- package/components/nested-donut/config.js.map +1 -0
- package/components/nested-donut/index.d.ts +38 -0
- package/components/nested-donut/index.js +133 -0
- package/components/nested-donut/index.js.map +1 -0
- package/components/nested-donut/modules/arc.d.ts +17 -0
- package/components/nested-donut/modules/arc.js +50 -0
- package/components/nested-donut/modules/arc.js.map +1 -0
- package/components/nested-donut/modules/label.d.ts +7 -0
- package/components/nested-donut/modules/label.js +34 -0
- package/components/nested-donut/modules/label.js.map +1 -0
- package/components/nested-donut/style.d.ts +26 -0
- package/components/nested-donut/style.js +70 -0
- package/components/nested-donut/style.js.map +1 -0
- package/components/nested-donut/types.d.ts +24 -0
- package/components/nested-donut/types.js +11 -0
- package/components/nested-donut/types.js.map +1 -0
- package/components/sankey/config.d.ts +162 -0
- package/components/sankey/config.js +65 -0
- package/components/sankey/config.js.map +1 -0
- package/components/sankey/index.d.ts +59 -0
- package/components/sankey/index.js +306 -0
- package/components/sankey/index.js.map +1 -0
- package/components/sankey/modules/label.d.ts +23 -0
- package/components/sankey/modules/label.js +168 -0
- package/components/sankey/modules/label.js.map +1 -0
- package/components/sankey/modules/link.d.ts +14 -0
- package/components/sankey/modules/link.js +108 -0
- package/components/sankey/modules/link.js.map +1 -0
- package/components/sankey/modules/node.d.ts +10 -0
- package/components/sankey/modules/node.js +156 -0
- package/components/sankey/modules/node.js.map +1 -0
- package/components/sankey/style.d.ts +20 -0
- package/{src/components/sankey/style.ts → components/sankey/style.js} +44 -60
- package/components/sankey/style.js.map +1 -0
- package/components/sankey/types.d.ts +84 -0
- package/components/sankey/types.js +34 -0
- package/components/sankey/types.js.map +1 -0
- package/components/scatter/config.d.ts +44 -0
- package/components/scatter/config.js +23 -0
- package/components/scatter/config.js.map +1 -0
- package/components/scatter/index.d.ts +28 -0
- package/components/scatter/index.js +167 -0
- package/components/scatter/index.js.map +1 -0
- package/components/scatter/modules/point.d.ts +7 -0
- package/components/scatter/modules/point.js +86 -0
- package/components/scatter/modules/point.js.map +1 -0
- package/components/scatter/modules/utils.d.ts +11 -0
- package/components/scatter/modules/utils.js +112 -0
- package/components/scatter/modules/utils.js.map +1 -0
- package/components/scatter/style.d.ts +5 -0
- package/{src/components/scatter/style.ts → components/scatter/style.js} +14 -15
- package/components/scatter/style.js.map +1 -0
- package/components/scatter/types.d.ts +19 -0
- package/components/stacked-bar/config.d.ts +38 -0
- package/components/stacked-bar/config.js +20 -0
- package/components/stacked-bar/config.js.map +1 -0
- package/components/stacked-bar/index.d.ts +28 -0
- package/components/stacked-bar/index.js +208 -0
- package/components/stacked-bar/index.js.map +1 -0
- package/components/stacked-bar/style.d.ts +5 -0
- package/{src/components/stacked-bar/style.ts → components/stacked-bar/style.js} +14 -15
- package/components/stacked-bar/style.js.map +1 -0
- package/components/stacked-bar/types.d.ts +5 -0
- package/components/timeline/config.d.ts +43 -0
- package/components/timeline/config.js +24 -0
- package/components/timeline/config.js.map +1 -0
- package/components/timeline/index.d.ts +41 -0
- package/components/timeline/index.js +244 -0
- package/components/timeline/index.js.map +1 -0
- package/components/timeline/style.d.ts +13 -0
- package/{src/components/timeline/style.ts → components/timeline/style.js} +30 -39
- package/components/timeline/style.js.map +1 -0
- package/components/tooltip/config.d.ts +68 -0
- package/components/tooltip/config.js +20 -0
- package/components/tooltip/config.js.map +1 -0
- package/components/tooltip/index.d.ts +36 -0
- package/components/tooltip/index.js +184 -0
- package/components/tooltip/index.js.map +1 -0
- package/{src/components → components}/tooltip/style.js +14 -11
- package/components/tooltip/style.js.map +1 -0
- package/components/topojson-map/config.d.ts +99 -0
- package/components/topojson-map/config.js +42 -0
- package/components/topojson-map/config.js.map +1 -0
- package/components/topojson-map/index.d.ts +52 -0
- package/components/topojson-map/index.js +355 -0
- package/components/topojson-map/index.js.map +1 -0
- package/components/topojson-map/style.d.ts +11 -0
- package/{src/components/topojson-map/style.ts → components/topojson-map/style.js} +26 -33
- package/components/topojson-map/style.js.map +1 -0
- package/components/topojson-map/types.d.ts +78 -0
- package/components/topojson-map/types.js +80 -0
- package/components/topojson-map/types.js.map +1 -0
- package/components/topojson-map/utils.d.ts +3 -0
- package/components/topojson-map/utils.js +30 -0
- package/components/topojson-map/utils.js.map +1 -0
- package/components/vis-controls/config.d.ts +12 -0
- package/components/vis-controls/config.js +13 -0
- package/components/vis-controls/config.js.map +1 -0
- package/components/vis-controls/index.d.ts +14 -0
- package/components/vis-controls/index.js +52 -0
- package/components/vis-controls/index.js.map +1 -0
- package/components/vis-controls/style.d.ts +11 -0
- package/{src/components/vis-controls/style.ts → components/vis-controls/style.js} +27 -34
- package/components/vis-controls/style.js.map +1 -0
- package/components/vis-controls/types.d.ts +13 -0
- package/components/vis-controls/types.js +8 -0
- package/components/vis-controls/types.js.map +1 -0
- package/components/xy-labels/config.d.ts +48 -0
- package/components/xy-labels/config.js +25 -0
- package/components/xy-labels/config.js.map +1 -0
- package/components/xy-labels/index.d.ts +15 -0
- package/components/xy-labels/index.js +87 -0
- package/components/xy-labels/index.js.map +1 -0
- package/components/xy-labels/modules/label.d.ts +9 -0
- package/components/xy-labels/modules/label.js +107 -0
- package/components/xy-labels/modules/label.js.map +1 -0
- package/components/xy-labels/style.d.ts +5 -0
- package/{src/components/xy-labels/style.ts → components/xy-labels/style.js} +14 -15
- package/components/xy-labels/style.js.map +1 -0
- package/components/xy-labels/types.d.ts +23 -0
- package/components/xy-labels/types.js +9 -0
- package/components/xy-labels/types.js.map +1 -0
- package/components.d.ts +51 -0
- package/components.js +29 -0
- package/components.js.map +1 -0
- package/containers/single-container/config.d.ts +12 -0
- package/containers/single-container/config.js +12 -0
- package/containers/single-container/config.js.map +1 -0
- package/containers/single-container/index.d.ts +19 -0
- package/containers/single-container/index.js +128 -0
- package/containers/single-container/index.js.map +1 -0
- package/containers/xy-container/config.d.ts +99 -0
- package/containers/xy-container/config.js +30 -0
- package/containers/xy-container/config.js.map +1 -0
- package/containers/xy-container/index.d.ts +34 -0
- package/containers/xy-container/index.js +330 -0
- package/containers/xy-container/index.js.map +1 -0
- package/containers.d.ts +6 -0
- package/containers.js +4 -0
- package/containers.js.map +1 -0
- package/core/component/config.d.ts +58 -0
- package/core/component/config.js +14 -0
- package/core/component/config.js.map +1 -0
- package/core/component/index.d.ts +43 -0
- package/core/component/index.js +118 -0
- package/core/component/index.js.map +1 -0
- package/core/component/types.d.ts +2 -0
- package/core/component/types.js +2 -0
- package/core/component/types.js.map +1 -0
- package/core/config/index.d.ts +3 -0
- package/core/config/index.js +16 -0
- package/core/config/index.js.map +1 -0
- package/core/container/config.d.ts +48 -0
- package/core/container/config.js +29 -0
- package/core/container/config.js.map +1 -0
- package/core/container/index.d.ts +26 -0
- package/core/container/index.js +106 -0
- package/core/container/index.js.map +1 -0
- package/core/xy-component/config.d.ts +38 -0
- package/core/xy-component/config.js +20 -0
- package/core/xy-component/config.js.map +1 -0
- package/core/xy-component/index.d.ts +27 -0
- package/core/xy-component/index.js +74 -0
- package/core/xy-component/index.js.map +1 -0
- package/data-models/core.d.ts +6 -0
- package/data-models/core.js +14 -0
- package/data-models/core.js.map +1 -0
- package/data-models/graph.d.ts +24 -0
- package/data-models/graph.js +107 -0
- package/data-models/graph.js.map +1 -0
- package/data-models/map-graph.d.ts +21 -0
- package/data-models/map-graph.js +62 -0
- package/data-models/map-graph.js.map +1 -0
- package/data-models/map.d.ts +5 -0
- package/data-models/map.js +12 -0
- package/data-models/map.js.map +1 -0
- package/data-models/series.d.ts +6 -0
- package/data-models/series.js +19 -0
- package/data-models/series.js.map +1 -0
- package/index.d.ts +7 -0
- package/index.js +55 -0
- package/index.js.map +1 -0
- package/maps/china-provinces.json.js +140373 -0
- package/maps/fr-regions.json.js +14162 -0
- package/maps/germany-regions.json.js +35760 -0
- package/maps/ind-regions.json.js +290584 -0
- package/maps/uk-regions.json.js +96233 -0
- package/maps/us-counties.json.js +206318 -0
- package/maps/us-states.json.js +16345 -0
- package/maps/world-110m-alpha.json.js +251366 -0
- package/maps/world-simple.json.js +89428 -0
- package/maps/world-simplest.json.js +28175 -0
- package/maps.d.ts +60 -0
- package/maps.js +23 -0
- package/package.json +1 -1
- package/styles/colors.d.ts +7 -0
- package/styles/colors.js +24 -0
- package/styles/colors.js.map +1 -0
- package/styles/index.d.ts +7 -0
- package/styles/index.js +38 -0
- package/styles/index.js.map +1 -0
- package/styles/sizes.d.ts +2 -0
- package/{src/styles/sizes.ts → styles/sizes.js} +8 -6
- package/styles/sizes.js.map +1 -0
- package/types/accessor.d.ts +5 -0
- package/types/accessor.js +2 -0
- package/types/accessor.js.map +1 -0
- package/types/component.d.ts +13 -0
- package/types/component.js +14 -0
- package/types/component.js.map +1 -0
- package/types/curve.d.ts +40 -0
- package/types/curve.js +46 -0
- package/types/curve.js.map +1 -0
- package/types/data.d.ts +7 -0
- package/types/data.js +2 -0
- package/types/data.js.map +1 -0
- package/types/direction.d.ts +6 -0
- package/types/direction.js +10 -0
- package/types/direction.js.map +1 -0
- package/types/graph.d.ts +35 -0
- package/types/graph.js +2 -0
- package/types/graph.js.map +1 -0
- package/types/map.d.ts +4 -0
- package/types/map.js +2 -0
- package/types/map.js.map +1 -0
- package/types/misc.d.ts +8 -0
- package/types/position.d.ts +20 -0
- package/types/position.js +27 -0
- package/types/position.js.map +1 -0
- package/types/scale.d.ts +23 -0
- package/types/scale.js +27 -0
- package/types/scale.js.map +1 -0
- package/types/shape.d.ts +7 -0
- package/types/shape.js +11 -0
- package/types/shape.js.map +1 -0
- package/types/spacing.d.ts +6 -0
- package/types/spacing.js +2 -0
- package/types/spacing.js.map +1 -0
- package/types/svg.d.ts +18 -0
- package/types/svg.js +22 -0
- package/types/svg.js.map +1 -0
- package/types/symbol.d.ts +18 -0
- package/types/symbol.js +24 -0
- package/types/symbol.js.map +1 -0
- package/types/text.d.ts +47 -0
- package/types/text.js +26 -0
- package/types/text.js.map +1 -0
- package/types.d.ts +27 -0
- package/types.js +30 -0
- package/types.js.map +1 -0
- package/utils/color.d.ts +10 -0
- package/utils/color.js +32 -0
- package/utils/color.js.map +1 -0
- package/utils/d3.d.ts +3 -0
- package/utils/d3.js +16 -0
- package/utils/d3.js.map +1 -0
- package/utils/data.d.ts +45 -0
- package/utils/data.js +274 -0
- package/utils/data.js.map +1 -0
- package/utils/html.d.ts +1 -0
- package/utils/html.js +16 -0
- package/utils/html.js.map +1 -0
- package/utils/map.d.ts +2 -0
- package/utils/map.js +20 -0
- package/utils/map.js.map +1 -0
- package/utils/misc.d.ts +9 -0
- package/utils/misc.js +47 -0
- package/utils/misc.js.map +1 -0
- package/utils/path.d.ts +23 -0
- package/utils/path.js +144 -0
- package/utils/path.js.map +1 -0
- package/utils/scale.d.ts +1 -0
- package/utils/style.d.ts +6 -0
- package/utils/style.js +24 -0
- package/utils/style.js.map +1 -0
- package/utils/svg.d.ts +3 -0
- package/utils/text.d.ts +139 -0
- package/utils/text.js +443 -0
- package/utils/text.js.map +1 -0
- package/utils/type.d.ts +5 -0
- package/declaration.d.ts +0 -1
- package/index.ts +0 -1
- package/licences.txt +0 -43
- package/maps.ts +0 -1
- package/rollup.config.js +0 -71
- package/rules/ts-getter-setter.js +0 -35
- package/src/components/area/config.ts +0 -29
- package/src/components/area/index.ts +0 -133
- package/src/components/area/types.ts +0 -2
- package/src/components/axis/config.ts +0 -76
- package/src/components/axis/index.ts +0 -363
- package/src/components/axis/types.ts +0 -4
- package/src/components/brush/config.ts +0 -51
- package/src/components/brush/index.ts +0 -233
- package/src/components/brush/types.ts +0 -8
- package/src/components/bullet-legend/config.ts +0 -38
- package/src/components/bullet-legend/index.ts +0 -104
- package/src/components/bullet-legend/types.ts +0 -7
- package/src/components/chord-diagram/config.ts +0 -53
- package/src/components/chord-diagram/index.ts +0 -401
- package/src/components/chord-diagram/modules/label.ts +0 -155
- package/src/components/chord-diagram/modules/link.ts +0 -91
- package/src/components/chord-diagram/modules/node.ts +0 -80
- package/src/components/chord-diagram/types.ts +0 -68
- package/src/components/crosshair/config.ts +0 -48
- package/src/components/crosshair/index.ts +0 -220
- package/src/components/crosshair/types.ts +0 -15
- package/src/components/donut/config.ts +0 -65
- package/src/components/donut/index.ts +0 -148
- package/src/components/donut/modules/arc.ts +0 -86
- package/src/components/donut/types.ts +0 -17
- package/src/components/flow-legend/config.ts +0 -31
- package/src/components/flow-legend/index.ts +0 -103
- package/src/components/flow-legend/types.ts +0 -10
- package/src/components/free-brush/config.ts +0 -54
- package/src/components/free-brush/index.ts +0 -207
- package/src/components/free-brush/types.ts +0 -8
- package/src/components/graph/config.ts +0 -280
- package/src/components/graph/index.ts +0 -809
- package/src/components/graph/modules/layout-helpers.ts +0 -96
- package/src/components/graph/modules/layout.ts +0 -502
- package/src/components/graph/modules/link/helper.ts +0 -105
- package/src/components/graph/modules/link/index.ts +0 -302
- package/src/components/graph/modules/node/helper.ts +0 -162
- package/src/components/graph/modules/node/index.ts +0 -343
- package/src/components/graph/modules/panel/helper.ts +0 -160
- package/src/components/graph/modules/panel/index.ts +0 -137
- package/src/components/graph/modules/shape.ts +0 -108
- package/src/components/graph/modules/zoom-levels.ts +0 -6
- package/src/components/graph/style.ts +0 -72
- package/src/components/graph/types.ts +0 -152
- package/src/components/grouped-bar/config.ts +0 -40
- package/src/components/grouped-bar/index.ts +0 -325
- package/src/components/leaflet-flow-map/config.ts +0 -60
- package/src/components/leaflet-flow-map/index.ts +0 -279
- package/src/components/leaflet-flow-map/renderer-utils.ts +0 -14
- package/src/components/leaflet-flow-map/renderer.ts +0 -146
- package/src/components/leaflet-flow-map/types.ts +0 -18
- package/src/components/leaflet-map/config.ts +0 -234
- package/src/components/leaflet-map/index.ts +0 -808
- package/src/components/leaflet-map/leaflet.css +0 -625
- package/src/components/leaflet-map/modules/clusterBackground.ts +0 -34
- package/src/components/leaflet-map/modules/donut.ts +0 -37
- package/src/components/leaflet-map/modules/map.ts +0 -178
- package/src/components/leaflet-map/modules/node.ts +0 -208
- package/src/components/leaflet-map/modules/selectionRing.ts +0 -63
- package/src/components/leaflet-map/modules/utils.ts +0 -290
- package/src/components/leaflet-map/renderer/map-style.ts +0 -24
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json +0 -35
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json +0 -35
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json +0 -2185
- package/src/components/leaflet-map/renderer/mapboxgl-layer.ts +0 -43
- package/src/components/leaflet-map/renderer/mapboxgl-utils.ts +0 -40
- package/src/components/leaflet-map/style.ts +0 -217
- package/src/components/leaflet-map/types.ts +0 -75
- package/src/components/line/config.ts +0 -34
- package/src/components/line/index.ts +0 -188
- package/src/components/line/types.ts +0 -3
- package/src/components/nested-donut/config.ts +0 -75
- package/src/components/nested-donut/index.ts +0 -176
- package/src/components/nested-donut/modules/arc.ts +0 -78
- package/src/components/nested-donut/modules/label.ts +0 -63
- package/src/components/nested-donut/style.ts +0 -82
- package/src/components/nested-donut/types.ts +0 -29
- package/src/components/sankey/config.ts +0 -195
- package/src/components/sankey/index.ts +0 -387
- package/src/components/sankey/modules/label.ts +0 -228
- package/src/components/sankey/modules/link.ts +0 -141
- package/src/components/sankey/modules/node.ts +0 -221
- package/src/components/sankey/types.ts +0 -95
- package/src/components/scatter/config.ts +0 -49
- package/src/components/scatter/index.ts +0 -220
- package/src/components/scatter/modules/point.ts +0 -123
- package/src/components/scatter/modules/utils.ts +0 -150
- package/src/components/scatter/types.ts +0 -21
- package/src/components/stacked-bar/config.ts +0 -42
- package/src/components/stacked-bar/index.ts +0 -267
- package/src/components/stacked-bar/types.ts +0 -5
- package/src/components/timeline/config.ts +0 -49
- package/src/components/timeline/index.ts +0 -302
- package/src/components/tooltip/config.ts +0 -69
- package/src/components/tooltip/index.ts +0 -220
- package/src/components/topojson-map/config.ts +0 -124
- package/src/components/topojson-map/index.ts +0 -436
- package/src/components/topojson-map/types.ts +0 -123
- package/src/components/topojson-map/utils.ts +0 -29
- package/src/components/vis-controls/config.ts +0 -16
- package/src/components/vis-controls/index.ts +0 -68
- package/src/components/vis-controls/types.ts +0 -14
- package/src/components/xy-labels/config.ts +0 -56
- package/src/components/xy-labels/index.ts +0 -109
- package/src/components/xy-labels/modules/label.ts +0 -140
- package/src/components/xy-labels/types.ts +0 -26
- package/src/components.ts +0 -56
- package/src/containers/single-container/config.ts +0 -15
- package/src/containers/single-container/index.ts +0 -150
- package/src/containers/xy-container/config.ts +0 -112
- package/src/containers/xy-container/index.ts +0 -407
- package/src/containers.ts +0 -6
- package/src/core/component/config.ts +0 -61
- package/src/core/component/index.ts +0 -154
- package/src/core/component/types.ts +0 -9
- package/src/core/config/index.ts +0 -12
- package/src/core/container/config.ts +0 -56
- package/src/core/container/index.ts +0 -136
- package/src/core/xy-component/config.ts +0 -46
- package/src/core/xy-component/index.ts +0 -90
- package/src/data-models/core.ts +0 -15
- package/src/data-models/graph.ts +0 -138
- package/src/data-models/map-graph.ts +0 -72
- package/src/data-models/map.ts +0 -18
- package/src/data-models/series.ts +0 -16
- package/src/index.ts +0 -7
- package/src/maps/china-provinces.json +0 -1
- package/src/maps/fr-regions.json +0 -1
- package/src/maps/germany-regions.json +0 -1
- package/src/maps/ind-regions.json +0 -1
- package/src/maps/uk-regions.json +0 -1
- package/src/maps/us-counties.json +0 -1
- package/src/maps/us-states.json +0 -1
- package/src/maps/world-110m-alpha.json +0 -1
- package/src/maps/world-simple.json +0 -1
- package/src/maps/world-simplest.json +0 -1
- package/src/maps.ts +0 -34
- package/src/styles/colors.ts +0 -28
- package/src/styles/index.ts +0 -38
- package/src/types/accessor.ts +0 -5
- package/src/types/component.ts +0 -15
- package/src/types/curve.ts +0 -62
- package/src/types/data.ts +0 -5
- package/src/types/direction.ts +0 -6
- package/src/types/graph.ts +0 -40
- package/src/types/map.ts +0 -5
- package/src/types/misc.ts +0 -10
- package/src/types/position.ts +0 -23
- package/src/types/scale.ts +0 -47
- package/src/types/shape.ts +0 -7
- package/src/types/spacing.ts +0 -6
- package/src/types/svg.ts +0 -32
- package/src/types/symbol.ts +0 -21
- package/src/types/text.ts +0 -71
- package/src/types.ts +0 -31
- package/src/utils/color.ts +0 -41
- package/src/utils/d3.ts +0 -15
- package/src/utils/data.ts +0 -328
- package/src/utils/html.ts +0 -13
- package/src/utils/map.ts +0 -29
- package/src/utils/misc.ts +0 -54
- package/src/utils/path.ts +0 -196
- package/src/utils/scale.ts +0 -1
- package/src/utils/style.ts +0 -37
- package/src/utils/svg.ts +0 -49
- package/src/utils/text.ts +0 -529
- package/src/utils/type.ts +0 -9
- package/tsconfig.json +0 -29
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// Core
|
|
2
|
-
import { XYComponentConfigInterface, XYComponentConfig } from 'core/xy-component/config'
|
|
3
|
-
|
|
4
|
-
// Types
|
|
5
|
-
import { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'
|
|
6
|
-
|
|
7
|
-
// Local Types
|
|
8
|
-
import { XYLabel, XYLabelPositioning } from './types'
|
|
9
|
-
|
|
10
|
-
export interface XYLabelsConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {
|
|
11
|
-
/** Single Y accessor function. Default: `undefined` */
|
|
12
|
-
y: NumericAccessor<Datum>;
|
|
13
|
-
/** Defines how to position the label horizontally: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */
|
|
14
|
-
xPositioning?: GenericAccessor<XYLabelPositioning | string, Datum>;
|
|
15
|
-
/** Defines how to position the label vertically: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */
|
|
16
|
-
yPositioning?: GenericAccessor<XYLabelPositioning | string, Datum>;
|
|
17
|
-
/** Font size accessor function or constant value in pixels. If not provided, the value of CSS variable `--vis-xy-label-font-size` will be used. Default: `undefined` */
|
|
18
|
-
labelFontSize?: NumericAccessor<Datum>;
|
|
19
|
-
/** Label accessor function or string. Default: `undefined` */
|
|
20
|
-
label?: StringAccessor<Datum>;
|
|
21
|
-
/** Label color. Default: `undefined` */
|
|
22
|
-
backgroundColor?: ColorAccessor<Datum>;
|
|
23
|
-
/** Optional label cursor. Default: `null` */
|
|
24
|
-
cursor?: StringAccessor<Datum>;
|
|
25
|
-
/** Label color brightness ratio for switching between dark and light text label color. Default: `0.65` */
|
|
26
|
-
labelTextBrightnessRatio?: number;
|
|
27
|
-
/** Enable label clustering. Default: `true` */
|
|
28
|
-
clustering?: boolean;
|
|
29
|
-
/** Label accessor for clusters. Default: `undefined` */
|
|
30
|
-
clusterLabel?: StringAccessor<XYLabel<Datum>[]>;
|
|
31
|
-
/** Font size accessor for clusters, the value is in pixels. If not provided, the value of CSS variable `--vis-xy-label-cluster-font-size` will be used. Default: `undefined` */
|
|
32
|
-
clusterFontSize?: NumericAccessor<XYLabel<Datum>[]>;
|
|
33
|
-
/** Background color accessor for clusters. Default: `undefined` */
|
|
34
|
-
clusterBackgroundColor?: ColorAccessor<XYLabel<Datum>[]>;
|
|
35
|
-
/** Optional cluster cursor. Default: `null` */
|
|
36
|
-
clusterCursor?: StringAccessor<XYLabel<Datum>[]>;
|
|
37
|
-
/** Cluster label color accessor function. Default: `null` */
|
|
38
|
-
clusterLabelColor?: ColorAccessor<XYLabel<Datum>[]>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export class XYLabelsConfig<Datum> extends XYComponentConfig<Datum> implements XYLabelsConfigInterface<Datum> {
|
|
42
|
-
xPositioning = XYLabelPositioning.DataSpace
|
|
43
|
-
yPositioning = XYLabelPositioning.DataSpace
|
|
44
|
-
labelFontSize = undefined
|
|
45
|
-
label = undefined
|
|
46
|
-
backgroundColor = undefined
|
|
47
|
-
cursor = null
|
|
48
|
-
labelTextBrightnessRatio = 0.65
|
|
49
|
-
|
|
50
|
-
clustering = true
|
|
51
|
-
clusterLabel = (records: XYLabel<Datum>[]): string => records.length.toString()
|
|
52
|
-
clusterFontSize = undefined
|
|
53
|
-
clusterBackgroundColor = undefined
|
|
54
|
-
clusterCursor = undefined
|
|
55
|
-
clusterLabelColor = null
|
|
56
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
// Core
|
|
2
|
-
import { XYComponentCore } from 'core/xy-component'
|
|
3
|
-
|
|
4
|
-
// Utils
|
|
5
|
-
import { getValue, isNumber, isNumberWithinRange } from 'utils/data'
|
|
6
|
-
import { rectIntersect } from 'utils/misc'
|
|
7
|
-
|
|
8
|
-
// Local Types
|
|
9
|
-
import { XYLabelCluster, XYLabel, XYLabelPositioning } from './types'
|
|
10
|
-
|
|
11
|
-
// Config
|
|
12
|
-
import { XYLabelsConfig, XYLabelsConfigInterface } from './config'
|
|
13
|
-
|
|
14
|
-
// Modules
|
|
15
|
-
import { createLabels, updateLabels, removeLabels, getLabelRenderProps } from './modules/label'
|
|
16
|
-
|
|
17
|
-
// Styles
|
|
18
|
-
import * as s from './style'
|
|
19
|
-
|
|
20
|
-
export class XYLabels<Datum> extends XYComponentCore<Datum, XYLabelsConfig<Datum>, XYLabelsConfigInterface<Datum>> {
|
|
21
|
-
static selectors = s
|
|
22
|
-
clippable = false
|
|
23
|
-
config: XYLabelsConfig<Datum> = new XYLabelsConfig()
|
|
24
|
-
events = {
|
|
25
|
-
[XYLabels.selectors.label]: {},
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
constructor (config?: XYLabelsConfigInterface<Datum>) {
|
|
29
|
-
super()
|
|
30
|
-
if (config) this.setConfig(config)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
_render (customDuration?: number): void {
|
|
34
|
-
const { config } = this
|
|
35
|
-
const duration = isNumber(customDuration) ? customDuration : config.duration
|
|
36
|
-
|
|
37
|
-
const labelGroups = this.g
|
|
38
|
-
.selectAll<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>>(`.${s.labelGroup}`)
|
|
39
|
-
.data(this._getDataToRender())
|
|
40
|
-
|
|
41
|
-
const labelGroupsExit = labelGroups.exit<XYLabel<Datum> | XYLabelCluster<Datum>>()
|
|
42
|
-
removeLabels(labelGroupsExit, duration)
|
|
43
|
-
|
|
44
|
-
const labelGroupsEnter = labelGroups.enter().append('g')
|
|
45
|
-
.attr('class', s.labelGroup)
|
|
46
|
-
.call(createLabels)
|
|
47
|
-
|
|
48
|
-
const labelGroupsMerged = labelGroupsEnter
|
|
49
|
-
.merge(labelGroups)
|
|
50
|
-
.classed(s.cluster, d => !!(d as XYLabelCluster<Datum>).records)
|
|
51
|
-
.classed(s.label, d => !(d as XYLabelCluster<Datum>).records)
|
|
52
|
-
|
|
53
|
-
labelGroupsMerged.call(updateLabels, config, duration)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
private _getDataToRender (): (XYLabel<Datum> | XYLabelCluster<Datum>)[] {
|
|
57
|
-
const { config, datamodel } = this
|
|
58
|
-
|
|
59
|
-
const xRange = this.xScale.range() as [number, number]
|
|
60
|
-
const yRange = this.xScale.range() as [number, number]
|
|
61
|
-
|
|
62
|
-
const labels = datamodel.data?.reduce<XYLabel<Datum>[]>((acc, d) => {
|
|
63
|
-
const xPositioning = getValue<Datum, XYLabelPositioning>(d, config.xPositioning)
|
|
64
|
-
const yPositioning = getValue<Datum, XYLabelPositioning>(d, config.yPositioning)
|
|
65
|
-
const props = getLabelRenderProps(d, this.element, config, this.xScale, this.yScale)
|
|
66
|
-
|
|
67
|
-
if (
|
|
68
|
-
((xPositioning !== XYLabelPositioning.DataSpace) || isNumberWithinRange(props.x, xRange)) &&
|
|
69
|
-
((yPositioning !== XYLabelPositioning.DataSpace) || isNumberWithinRange(props.y, yRange))
|
|
70
|
-
) {
|
|
71
|
-
acc.push({ ...d, _screen: props })
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return acc
|
|
75
|
-
}, []) ?? []
|
|
76
|
-
|
|
77
|
-
return this._getClusteredLabels(labels)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
private _getClusteredLabels (labels: XYLabel<Datum>[]): (XYLabel<Datum> | XYLabelCluster<Datum>)[] {
|
|
81
|
-
const labelsNonOverlapping = [...labels]
|
|
82
|
-
const clusterMap = new Map<XYLabel<Datum>, XYLabel<Datum>[]>()
|
|
83
|
-
for (let i = 0; i < labelsNonOverlapping.length; i += 1) {
|
|
84
|
-
const label1 = labelsNonOverlapping[i]
|
|
85
|
-
for (let j = i + 1; j < labelsNonOverlapping.length; j += 1) {
|
|
86
|
-
const label2 = labelsNonOverlapping[j]
|
|
87
|
-
const isIntersecting = rectIntersect(label1._screen, label2._screen)
|
|
88
|
-
if (isIntersecting) {
|
|
89
|
-
if (!clusterMap.has(label1)) clusterMap.set(label1, [label1])
|
|
90
|
-
clusterMap.get(label1).push(label2)
|
|
91
|
-
labelsNonOverlapping.splice(j, 1)
|
|
92
|
-
j -= 1
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (clusterMap.has(label1)) {
|
|
97
|
-
labelsNonOverlapping.splice(i, 1)
|
|
98
|
-
i -= 1
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const clusters = Array.from(clusterMap.values()).map(records => ({
|
|
103
|
-
_screen: getLabelRenderProps(records, this.element, this.config, this.xScale, this.yScale),
|
|
104
|
-
records,
|
|
105
|
-
}))
|
|
106
|
-
|
|
107
|
-
return [...labelsNonOverlapping, ...clusters]
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { Selection, select } from 'd3-selection'
|
|
2
|
-
import { mean } from 'd3-array'
|
|
3
|
-
import { color } from 'd3-color'
|
|
4
|
-
|
|
5
|
-
// Utils
|
|
6
|
-
import { smartTransition } from 'utils/d3'
|
|
7
|
-
import { getCSSVariableValueInPixels, getCSSVariableValue, isStringCSSVariable } from 'utils/misc'
|
|
8
|
-
import { getColor, hexToBrightness } from 'utils/color'
|
|
9
|
-
import { getNumber, getString, getValue } from 'utils/data'
|
|
10
|
-
|
|
11
|
-
// Types
|
|
12
|
-
import { ContinuousScale } from 'types/scale'
|
|
13
|
-
|
|
14
|
-
// Config
|
|
15
|
-
import { XYLabelsConfig } from '../config'
|
|
16
|
-
|
|
17
|
-
// Local Types
|
|
18
|
-
import { XYLabel, XYLabelCluster, XYLabelPositioning, XYLabelRenderProps } from '../types'
|
|
19
|
-
|
|
20
|
-
export function createLabels<Datum> (
|
|
21
|
-
selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>
|
|
22
|
-
): void {
|
|
23
|
-
selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y})`)
|
|
24
|
-
selection.append('rect').style('fill', d => d._screen.backgroundColor)
|
|
25
|
-
selection.append('text')
|
|
26
|
-
.style('text-anchor', 'middle')
|
|
27
|
-
.style('dominant-baseline', 'central')
|
|
28
|
-
.style('fill', d => d._screen.backgroundColor)
|
|
29
|
-
.style('pointer-events', 'none')
|
|
30
|
-
|
|
31
|
-
selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function updateLabels<Datum> (
|
|
35
|
-
selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>,
|
|
36
|
-
config: XYLabelsConfig<Datum>,
|
|
37
|
-
duration: number
|
|
38
|
-
): void {
|
|
39
|
-
selection.each((d, i, elements) => {
|
|
40
|
-
const group: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any> = select(elements[i])
|
|
41
|
-
const text = group.select('text')
|
|
42
|
-
const rect = group.select('rect')
|
|
43
|
-
|
|
44
|
-
const backgroundColor = d._screen.backgroundColor
|
|
45
|
-
const labelText = d._screen.labelText ?? ''
|
|
46
|
-
const labelFontSize = d._screen.fontSize
|
|
47
|
-
let labelColor = d._screen.labelColor
|
|
48
|
-
|
|
49
|
-
// Label background
|
|
50
|
-
const backgroundHeight = labelFontSize * 1.7
|
|
51
|
-
let backgroundWidth = labelFontSize * labelText.length * 0.7
|
|
52
|
-
if (backgroundWidth < backgroundHeight) backgroundWidth = backgroundHeight
|
|
53
|
-
smartTransition(rect, duration)
|
|
54
|
-
.attr('width', backgroundWidth)
|
|
55
|
-
.attr('height', backgroundHeight)
|
|
56
|
-
.attr('x', -backgroundWidth / 2)
|
|
57
|
-
.attr('y', -backgroundHeight / 2)
|
|
58
|
-
.attr('rx', labelFontSize)
|
|
59
|
-
.attr('ry', labelFontSize)
|
|
60
|
-
.style('fill', backgroundColor)
|
|
61
|
-
|
|
62
|
-
// Label
|
|
63
|
-
if (!labelColor) {
|
|
64
|
-
const hex = color(isStringCSSVariable(backgroundColor) ? getCSSVariableValue(backgroundColor, group.node()) : backgroundColor)?.hex()
|
|
65
|
-
const brightness = hexToBrightness(hex)
|
|
66
|
-
labelColor = brightness > config.labelTextBrightnessRatio
|
|
67
|
-
? 'var(--vis-xy-label-text-color-dark)'
|
|
68
|
-
: 'var(--vis-xy-label-text-color-light)'
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
text.html(labelText)
|
|
72
|
-
.attr('font-size', labelFontSize)
|
|
73
|
-
|
|
74
|
-
smartTransition(text, duration)
|
|
75
|
-
.style('fill', labelColor)
|
|
76
|
-
|
|
77
|
-
rect.style('cursor', d._screen.cursor)
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
smartTransition(selection, duration)
|
|
81
|
-
.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(1)`)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function removeLabels<Datum> (
|
|
85
|
-
selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>,
|
|
86
|
-
duration: number
|
|
87
|
-
): void {
|
|
88
|
-
smartTransition(selection, duration)
|
|
89
|
-
.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`)
|
|
90
|
-
.remove()
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export function getLabelPosition (value: number, positioning: XYLabelPositioning, scale: ContinuousScale): number {
|
|
94
|
-
switch (positioning) {
|
|
95
|
-
case XYLabelPositioning.DataSpace: return scale(value) ?? 0
|
|
96
|
-
case XYLabelPositioning.AbsolutePx: return value
|
|
97
|
-
case XYLabelPositioning.AbsolutePercentage: {
|
|
98
|
-
const scaleRange = scale.range()
|
|
99
|
-
return scaleRange[0] + (scaleRange[1] - scaleRange[0]) * value / 100
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function getLabelRenderProps<Datum> (
|
|
105
|
-
data: Datum | XYLabel<Datum>[],
|
|
106
|
-
el: SVGGraphicsElement,
|
|
107
|
-
config: XYLabelsConfig<Datum>,
|
|
108
|
-
xScale: ContinuousScale,
|
|
109
|
-
yScale: ContinuousScale
|
|
110
|
-
): XYLabelRenderProps {
|
|
111
|
-
const isCluster = Array.isArray(data)
|
|
112
|
-
const fontSize = isCluster
|
|
113
|
-
? (getNumber(data, config.clusterFontSize) ?? getCSSVariableValueInPixels('var(--vis-xy-label-cluster-font-size)', el))
|
|
114
|
-
: (getNumber(data, config.labelFontSize) ?? getCSSVariableValueInPixels('var(--vis-xy-label-font-size)', el))
|
|
115
|
-
|
|
116
|
-
const labelText = (isCluster ? config.clusterLabel(data as XYLabel<Datum>[]) : getString(data, config.label)) || ''
|
|
117
|
-
const backgroundHeight = fontSize * 1.7
|
|
118
|
-
let backgroundWidth = fontSize * labelText.length * 0.7
|
|
119
|
-
if (backgroundWidth < backgroundHeight) backgroundWidth = backgroundHeight
|
|
120
|
-
|
|
121
|
-
const x = isCluster
|
|
122
|
-
? mean(data as XYLabel<Datum>[], d => d._screen.x)
|
|
123
|
-
: getLabelPosition(getNumber(data, config.x), getValue(data, config.xPositioning), xScale)
|
|
124
|
-
|
|
125
|
-
const y = isCluster
|
|
126
|
-
? mean(data as XYLabel<Datum>[], d => d._screen.y)
|
|
127
|
-
: getLabelPosition(getNumber(data, config.y), getValue(data, config.yPositioning), yScale)
|
|
128
|
-
|
|
129
|
-
return {
|
|
130
|
-
x,
|
|
131
|
-
y,
|
|
132
|
-
fontSize,
|
|
133
|
-
labelText,
|
|
134
|
-
labelColor: isCluster ? getColor(data, config.clusterLabelColor) : getColor(data, config.color),
|
|
135
|
-
backgroundColor: isCluster ? getColor(data, config.clusterBackgroundColor) : getColor(data, config.backgroundColor),
|
|
136
|
-
cursor: isCluster ? getString(data, config.clusterCursor) : getString(data, config.cursor),
|
|
137
|
-
width: backgroundWidth,
|
|
138
|
-
height: backgroundHeight,
|
|
139
|
-
}
|
|
140
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export type XYLabelRenderProps = {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
fontSize: number;
|
|
5
|
-
backgroundColor: string | null;
|
|
6
|
-
labelText: string | null;
|
|
7
|
-
labelColor: string | null;
|
|
8
|
-
cursor: string | null;
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type XYLabel<D> = D & {
|
|
14
|
-
_screen: XYLabelRenderProps;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type XYLabelCluster<D> = {
|
|
18
|
-
_screen: XYLabelRenderProps;
|
|
19
|
-
records: XYLabel<D>[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export enum XYLabelPositioning {
|
|
23
|
-
AbsolutePx = 'absolute_px',
|
|
24
|
-
AbsolutePercentage = 'absolute_percentage',
|
|
25
|
-
DataSpace = 'data_space',
|
|
26
|
-
}
|
package/src/components.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// Core
|
|
2
|
-
export { ComponentCore } from 'core/component'
|
|
3
|
-
export type { ComponentConfigInterface } from 'core/component/config'
|
|
4
|
-
export { XYComponentCore } from 'core/xy-component'
|
|
5
|
-
export type { XYComponentConfigInterface } from 'core/xy-component/config'
|
|
6
|
-
|
|
7
|
-
// Components
|
|
8
|
-
export { Tooltip } from 'components/tooltip'
|
|
9
|
-
export { Line } from './components/line'
|
|
10
|
-
export { StackedBar } from './components/stacked-bar'
|
|
11
|
-
export { GroupedBar } from './components/grouped-bar'
|
|
12
|
-
export { Axis } from './components/axis'
|
|
13
|
-
export { Scatter } from './components/scatter'
|
|
14
|
-
export { Brush } from './components/brush'
|
|
15
|
-
export { BulletLegend } from './components/bullet-legend'
|
|
16
|
-
export { FlowLegend } from './components/flow-legend'
|
|
17
|
-
export { Crosshair } from './components/crosshair'
|
|
18
|
-
export { Timeline } from './components/timeline'
|
|
19
|
-
export { Sankey } from './components/sankey'
|
|
20
|
-
export { Area } from './components/area'
|
|
21
|
-
export { TopoJSONMap } from './components/topojson-map'
|
|
22
|
-
export { LeafletMap } from './components/leaflet-map'
|
|
23
|
-
export { MapLibreArcticDark, MapLibreArcticLight } from './components/leaflet-map/renderer/map-style'
|
|
24
|
-
export { LeafletFlowMap } from './components/leaflet-flow-map'
|
|
25
|
-
export { ChordDiagram } from './components/chord-diagram'
|
|
26
|
-
export { Graph } from './components/graph'
|
|
27
|
-
export { VisControls } from './components/vis-controls'
|
|
28
|
-
export { Donut } from './components/donut'
|
|
29
|
-
export { FreeBrush } from './components/free-brush'
|
|
30
|
-
export { XYLabels } from './components/xy-labels'
|
|
31
|
-
export { NestedDonut } from './components/nested-donut'
|
|
32
|
-
|
|
33
|
-
// Config Interfaces
|
|
34
|
-
export type { LineConfigInterface } from './components/line/config'
|
|
35
|
-
export type { StackedBarConfigInterface } from './components/stacked-bar/config'
|
|
36
|
-
export type { GroupedBarConfigInterface } from './components/grouped-bar/config'
|
|
37
|
-
export type { ScatterConfigInterface } from './components/scatter/config'
|
|
38
|
-
export type { TooltipConfigInterface } from './components/tooltip/config'
|
|
39
|
-
export type { BrushConfigInterface } from './components/brush/config'
|
|
40
|
-
export type { AxisConfigInterface } from './components/axis/config'
|
|
41
|
-
export type { BulletLegendConfigInterface } from './components/bullet-legend/config'
|
|
42
|
-
export type { FlowLegendConfigInterface } from './components/flow-legend/config'
|
|
43
|
-
export type { CrosshairConfigInterface } from './components/crosshair/config'
|
|
44
|
-
export type { TimelineConfigInterface } from './components/timeline/config'
|
|
45
|
-
export type { SankeyConfigInterface } from './components/sankey/config'
|
|
46
|
-
export type { AreaConfigInterface } from './components/area/config'
|
|
47
|
-
export type { TopoJSONMapConfigInterface } from './components/topojson-map/config'
|
|
48
|
-
export type { LeafletMapConfigInterface } from './components/leaflet-map/config'
|
|
49
|
-
export type { LeafletFlowMapConfigInterface } from './components/leaflet-flow-map/config'
|
|
50
|
-
export type { ChordDiagramConfigInterface } from './components/chord-diagram/config'
|
|
51
|
-
export type { GraphConfigInterface } from './components/graph/config'
|
|
52
|
-
export type { VisControlsConfigInterface } from './components/vis-controls/config'
|
|
53
|
-
export type { DonutConfigInterface } from './components/donut/config'
|
|
54
|
-
export type { FreeBrushConfigInterface } from './components/free-brush/config'
|
|
55
|
-
export type { XYLabelsConfigInterface } from './components/xy-labels/config'
|
|
56
|
-
export type { NestedDonutConfigInterface } from './components/nested-donut/config'
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Core
|
|
2
|
-
import { ContainerConfig, ContainerConfigInterface } from 'core/container/config'
|
|
3
|
-
import { ComponentCore } from 'core/component'
|
|
4
|
-
import { Tooltip } from 'components/tooltip'
|
|
5
|
-
|
|
6
|
-
export interface SingleContainerConfigInterface<Datum> extends ContainerConfigInterface {
|
|
7
|
-
/** Visualization component. Default: `undefined` */
|
|
8
|
-
component?: ComponentCore<Datum>;
|
|
9
|
-
/** Tooltip component. Default: `undefined` */
|
|
10
|
-
tooltip?: Tooltip;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class SingleContainerConfig<Datum> extends ContainerConfig implements SingleContainerConfigInterface<Datum> {
|
|
14
|
-
tooltip = undefined
|
|
15
|
-
}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
// Global CSS variables (side effects import)
|
|
2
|
-
import 'styles/index'
|
|
3
|
-
|
|
4
|
-
// Core
|
|
5
|
-
import { ContainerCore } from 'core/container'
|
|
6
|
-
import { ComponentCore } from 'core/component'
|
|
7
|
-
import { ComponentConfigInterface } from 'core/component/config'
|
|
8
|
-
|
|
9
|
-
// Utils
|
|
10
|
-
import { smartTransition } from 'utils/d3'
|
|
11
|
-
|
|
12
|
-
// Types
|
|
13
|
-
import { Sizing, ExtendedSizeComponent } from 'types/component'
|
|
14
|
-
|
|
15
|
-
// Config
|
|
16
|
-
import { SingleContainerConfig, SingleContainerConfigInterface } from './config'
|
|
17
|
-
|
|
18
|
-
export class SingleContainer<Data> extends ContainerCore {
|
|
19
|
-
component: ComponentCore<Data>
|
|
20
|
-
config: SingleContainerConfig<Data> = new SingleContainerConfig()
|
|
21
|
-
|
|
22
|
-
constructor (element: HTMLElement, config?: SingleContainerConfigInterface<Data>, data?: Data) {
|
|
23
|
-
super(element)
|
|
24
|
-
|
|
25
|
-
if (config) {
|
|
26
|
-
this.updateContainer(config, true)
|
|
27
|
-
this.component = config.component
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (data) {
|
|
31
|
-
this.setData(data, true)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Render if component exists and has data
|
|
35
|
-
if (this.component?.datamodel.data) this.render()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public setData (data: Data, preventRender?: boolean): void {
|
|
39
|
-
const { config } = this
|
|
40
|
-
|
|
41
|
-
if (this.component) this.component.setData(data)
|
|
42
|
-
if (!preventRender) this.render()
|
|
43
|
-
config.tooltip?.hide()
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
public updateContainer (containerConfig: SingleContainerConfigInterface<Data>, preventRender?: boolean): void {
|
|
47
|
-
super.updateContainer(containerConfig)
|
|
48
|
-
this.removeAllChildren()
|
|
49
|
-
|
|
50
|
-
this.component = containerConfig.component
|
|
51
|
-
if (containerConfig.sizing) this.component.sizing = containerConfig.sizing
|
|
52
|
-
this.element.appendChild(this.component.element)
|
|
53
|
-
|
|
54
|
-
const tooltip = containerConfig.tooltip
|
|
55
|
-
if (tooltip) {
|
|
56
|
-
if (!tooltip.hasContainer()) tooltip.setContainer(this._container)
|
|
57
|
-
tooltip.setComponents([this.component])
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (!preventRender) this.render()
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public updateComponent (componentConfig: ComponentConfigInterface, preventRender?: boolean): void {
|
|
64
|
-
this.component.setConfig(componentConfig)
|
|
65
|
-
if (!preventRender) this.render()
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public update (
|
|
69
|
-
containerConfig: SingleContainerConfigInterface<Data>,
|
|
70
|
-
componentConfig?: ComponentConfigInterface,
|
|
71
|
-
data?: Data
|
|
72
|
-
): void {
|
|
73
|
-
if (containerConfig) this.updateContainer(containerConfig, true)
|
|
74
|
-
if (componentConfig) this.updateComponent(componentConfig, true)
|
|
75
|
-
if (data) this.setData(data, true)
|
|
76
|
-
this.render()
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public getFitWidthScale (): number {
|
|
80
|
-
const { config, component } = this
|
|
81
|
-
|
|
82
|
-
const extendedSizeComponent = component as ExtendedSizeComponent
|
|
83
|
-
if (!extendedSizeComponent.getWidth) return 1
|
|
84
|
-
|
|
85
|
-
const componentWidth = extendedSizeComponent.getWidth() + config.margin.left + config.margin.right
|
|
86
|
-
return this.width / componentWidth
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
_render (duration?: number): void {
|
|
90
|
-
const { config, component } = this
|
|
91
|
-
super._render(duration)
|
|
92
|
-
|
|
93
|
-
component.setSize(this.width, this.height, this.containerWidth, this.containerHeight)
|
|
94
|
-
component.g.attr('transform', `translate(${config.margin.left},${config.margin.top})`)
|
|
95
|
-
component.render(duration)
|
|
96
|
-
|
|
97
|
-
if (config.tooltip) config.tooltip.update()
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Re-defining the `render()` function to handle different sizing techniques (`Sizing.Extend` and `Sizing.FitWidth`)
|
|
101
|
-
// Not calling `super.render()` because we don't want it to interfere with setting the SVG size here.
|
|
102
|
-
render (duration = this.config.duration): void {
|
|
103
|
-
const { config, component } = this
|
|
104
|
-
|
|
105
|
-
if (config.sizing === Sizing.Extend || config.sizing === Sizing.FitWidth) {
|
|
106
|
-
const fitToWidth = config.sizing === Sizing.FitWidth
|
|
107
|
-
const extendedSizeComponent = component as ExtendedSizeComponent
|
|
108
|
-
|
|
109
|
-
const componentWidth = extendedSizeComponent.getWidth() + config.margin.left + config.margin.right
|
|
110
|
-
const componentHeight = extendedSizeComponent.getHeight() + config.margin.top + config.margin.bottom
|
|
111
|
-
const scale = fitToWidth ? this.getFitWidthScale() : 1
|
|
112
|
-
|
|
113
|
-
const currentWidth = this.svg.attr('width')
|
|
114
|
-
const currentHeight = this.svg.attr('height')
|
|
115
|
-
const scaledWidth = componentWidth * scale
|
|
116
|
-
const scaledHeight = componentHeight * scale
|
|
117
|
-
const animated = currentWidth || currentHeight
|
|
118
|
-
|
|
119
|
-
smartTransition(this.svg, animated ? duration : 0)
|
|
120
|
-
.attr('width', scaledWidth)
|
|
121
|
-
.attr('height', scaledHeight)
|
|
122
|
-
.attr('viewBox', `${0} ${0} ${componentWidth} ${fitToWidth ? scaledHeight : componentHeight}`)
|
|
123
|
-
.attr('preserveAspectRatio', 'xMinYMin')
|
|
124
|
-
} else {
|
|
125
|
-
this.svg
|
|
126
|
-
.attr('width', this.config.width || this.containerWidth)
|
|
127
|
-
.attr('height', this.config.height || this.containerHeight)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Schedule the actual rendering in the next frame
|
|
131
|
-
cancelAnimationFrame(this._requestedAnimationFrame)
|
|
132
|
-
this._requestedAnimationFrame = requestAnimationFrame(() => {
|
|
133
|
-
this._render(duration)
|
|
134
|
-
})
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
_onResize (): void {
|
|
138
|
-
const { config } = this
|
|
139
|
-
super._onResize()
|
|
140
|
-
config.tooltip?.hide()
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
public destroy (): void {
|
|
144
|
-
const { component, config } = this
|
|
145
|
-
super.destroy()
|
|
146
|
-
|
|
147
|
-
component?.destroy()
|
|
148
|
-
config.tooltip?.destroy()
|
|
149
|
-
}
|
|
150
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// Core
|
|
2
|
-
import { XYComponentCore } from 'core/xy-component'
|
|
3
|
-
import { ContainerConfig, ContainerConfigInterface } from 'core/container/config'
|
|
4
|
-
import { Tooltip } from 'components/tooltip'
|
|
5
|
-
|
|
6
|
-
// Components
|
|
7
|
-
import { Axis } from 'components/axis'
|
|
8
|
-
import { Crosshair } from 'components/crosshair'
|
|
9
|
-
|
|
10
|
-
// Types
|
|
11
|
-
import { ContinuousScale } from 'types/scale'
|
|
12
|
-
import { Direction } from 'types/direction'
|
|
13
|
-
|
|
14
|
-
export interface XYContainerConfigInterface<Datum> extends ContainerConfigInterface {
|
|
15
|
-
/** An array of visualization components. Default: `[]` */
|
|
16
|
-
components?: XYComponentCore<Datum>[];
|
|
17
|
-
|
|
18
|
-
/** Scale for X dimension, e.g. Scale.scaleLinear().
|
|
19
|
-
* If set, this value will override the components' xScale and they will have a single shared xScale instance.
|
|
20
|
-
* By default the components have their own scale instances but their `domain` and `range` values are synchronized.
|
|
21
|
-
* Default: `undefined` */
|
|
22
|
-
xScale?: ContinuousScale;
|
|
23
|
-
/** Scale domain (data extent) for X dimension. By default this value is calculated automatically based on data. */
|
|
24
|
-
xDomain?: [number | undefined, number | undefined];
|
|
25
|
-
/** Constraint the minimum value of the X scale domain. Useful when the data is plotted along the X axis.
|
|
26
|
-
* For example, imagine that you have a chart with dynamic data that has negative values. When values are small
|
|
27
|
-
* (let's say in the range of [-0.01, 0]), you might still want the chart to display some meaningful value range (e.g. [-1, 0]). That can
|
|
28
|
-
* be achieved by setting `xDomainMinConstraint` to `[undefined, -1]`. In addition to that, if you want to cut off the
|
|
29
|
-
* values that are too low (let's say lower than -100), you can set the constraint to `[-100, -1]`
|
|
30
|
-
* Default: `undefined` */
|
|
31
|
-
xDomainMinConstraint?: [number | undefined, number | undefined];
|
|
32
|
-
/** Constraint the minimum value of the X scale domain. Useful when the data is plotted along the X axis.
|
|
33
|
-
* For example, imagine that you have a chart with dynamic data. When values are small
|
|
34
|
-
* (let's say < 0.01), you might still want the chart to display some meaningful value range (e.g. [0, 1]). That can
|
|
35
|
-
* be achieved by setting `xDomainMaxConstraint` to `[1, undefined]`. In addition to that, if you want to cut off the
|
|
36
|
-
* values that are too high (let's say higher than 100), you can set the constraint to `[1, 100]`
|
|
37
|
-
* Default: `undefined` */
|
|
38
|
-
xDomainMaxConstraint?: [number | undefined, number | undefined];
|
|
39
|
-
/** Force set the X scale range (in the screen space). By default the range is calculated automatically based on the
|
|
40
|
-
* chart's set up */
|
|
41
|
-
xRange?: [number, number];
|
|
42
|
-
|
|
43
|
-
/** Scale for Y dimension, e.g. Scale.scaleLinear().
|
|
44
|
-
* If set, this value will override the components' yScale and they will have a single shared yScale instance.
|
|
45
|
-
* By default the components have their own scale instances but their `domain` and `range` values are synchronized.
|
|
46
|
-
* Default: `undefined` */
|
|
47
|
-
yScale?: ContinuousScale;
|
|
48
|
-
/** Scale domain (data extent) for Y dimension. By default this value is calculated automatically based on data. */
|
|
49
|
-
yDomain?: [number | undefined, number | undefined];
|
|
50
|
-
/** Constraint the minimum value of the Y scale domain.
|
|
51
|
-
* For example, imagine that you have a chart with dynamic data that has negative values. When values are small
|
|
52
|
-
* (let's say in the range of [-0.01, 0]), you might still want the chart to display some meaningful value range (e.g. [-1, 0]). That can
|
|
53
|
-
* be achieved by setting `yDomainMinConstraint` to `[undefined, -1]`. In addition to that, if you want to cut off the
|
|
54
|
-
* values that are too low (let's say lower than -100), you can set the constraint to `[-100, -1]`
|
|
55
|
-
* Default: `undefined` */
|
|
56
|
-
yDomainMinConstraint?: [number | undefined, number | undefined];
|
|
57
|
-
/** Constraint the minimum value of the Y scale domain.
|
|
58
|
-
* For example, imagine that you have a chart with dynamic data. When values are small
|
|
59
|
-
* (let's say < 0.01), you might still want the chart to display some meaningful value range (e.g. [0, 1]). That can
|
|
60
|
-
* be achieved by setting `yDomainMaxConstraint` to `[1, undefined]`. In addition to that, if you want to cut off the
|
|
61
|
-
* values that are too high (let's say higher than 100), you can set the constraint to `[1, 100]`
|
|
62
|
-
* Default: `undefined` */
|
|
63
|
-
yDomainMaxConstraint?: [number | undefined, number | undefined];
|
|
64
|
-
/** Force set the Y scale range (in the screen space). By default the range is calculated automatically based on the
|
|
65
|
-
* chart's set up */
|
|
66
|
-
yRange?: [number, number];
|
|
67
|
-
/** Y Axis direction. Default: `Direction.North` */
|
|
68
|
-
yDirection?: Direction.South | Direction.North | string;
|
|
69
|
-
|
|
70
|
-
/** X Axis component instance. Default: `undefined` */
|
|
71
|
-
xAxis?: Axis<Datum>;
|
|
72
|
-
/** Y Axis component instance. Default: `undefined` */
|
|
73
|
-
yAxis?: Axis<Datum>;
|
|
74
|
-
/** Enables automatic calculation of chart margins based on the size of the axes. Default: `true` */
|
|
75
|
-
autoMargin?: boolean;
|
|
76
|
-
/** Tooltip component. Default: `undefined` */
|
|
77
|
-
tooltip?: Tooltip | undefined;
|
|
78
|
-
/** Crosshair component. Default: `undefined` */
|
|
79
|
-
crosshair?: Crosshair<Datum> | undefined;
|
|
80
|
-
/** Prevents the chart domain from being empty (when domain's min and max values are equal).
|
|
81
|
-
* That usually happens when all the data values are the same.
|
|
82
|
-
* Setting to `true` will automatically extend the domain by `+1` when needed.
|
|
83
|
-
* Default: `true` */
|
|
84
|
-
preventEmptyDomain?: boolean;
|
|
85
|
-
/** Sets the Y scale domain based on the current X scale domain (not the whole dataset). Default: `false` */
|
|
86
|
-
scaleByDomain?: boolean;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export class XYContainerConfig<Datum> extends ContainerConfig implements XYContainerConfigInterface<Datum> {
|
|
90
|
-
components = []
|
|
91
|
-
tooltip: Tooltip = undefined
|
|
92
|
-
crosshair: Crosshair<Datum> = undefined
|
|
93
|
-
xAxis: Axis<Datum> = undefined
|
|
94
|
-
yAxis: Axis<Datum> = undefined
|
|
95
|
-
autoMargin = true
|
|
96
|
-
|
|
97
|
-
xScale = undefined
|
|
98
|
-
xDomain = undefined
|
|
99
|
-
xDomainMinConstraint = undefined
|
|
100
|
-
xDomainMaxConstraint = undefined
|
|
101
|
-
xRange = undefined
|
|
102
|
-
|
|
103
|
-
yScale = undefined
|
|
104
|
-
yDomain = undefined
|
|
105
|
-
yDomainMinConstraint = undefined
|
|
106
|
-
yDomainMaxConstraint = undefined
|
|
107
|
-
yRange = undefined
|
|
108
|
-
yDirection = Direction.North
|
|
109
|
-
|
|
110
|
-
preventEmptyDomain = true
|
|
111
|
-
scaleByDomain = false
|
|
112
|
-
}
|