@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
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { select } from 'd3-selection';
|
|
2
|
+
import { mean } from 'd3-array';
|
|
3
|
+
import { color } from 'd3-color';
|
|
4
|
+
import { smartTransition } from '../../../utils/d3.js';
|
|
5
|
+
import { isStringCSSVariable, getCSSVariableValue, getCSSVariableValueInPixels } from '../../../utils/misc.js';
|
|
6
|
+
import { hexToBrightness, getColor } from '../../../utils/color.js';
|
|
7
|
+
import { getNumber, getString, getValue } from '../../../utils/data.js';
|
|
8
|
+
import { XYLabelPositioning } from '../types.js';
|
|
9
|
+
|
|
10
|
+
function createLabels(selection) {
|
|
11
|
+
selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y})`);
|
|
12
|
+
selection.append('rect').style('fill', d => d._screen.backgroundColor);
|
|
13
|
+
selection.append('text')
|
|
14
|
+
.style('text-anchor', 'middle')
|
|
15
|
+
.style('dominant-baseline', 'central')
|
|
16
|
+
.style('fill', d => d._screen.backgroundColor)
|
|
17
|
+
.style('pointer-events', 'none');
|
|
18
|
+
selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`);
|
|
19
|
+
}
|
|
20
|
+
function updateLabels(selection, config, duration) {
|
|
21
|
+
selection.each((d, i, elements) => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const group = select(elements[i]);
|
|
24
|
+
const text = group.select('text');
|
|
25
|
+
const rect = group.select('rect');
|
|
26
|
+
const backgroundColor = d._screen.backgroundColor;
|
|
27
|
+
const labelText = (_a = d._screen.labelText) !== null && _a !== void 0 ? _a : '';
|
|
28
|
+
const labelFontSize = d._screen.fontSize;
|
|
29
|
+
let labelColor = d._screen.labelColor;
|
|
30
|
+
// Label background
|
|
31
|
+
const backgroundHeight = labelFontSize * 1.7;
|
|
32
|
+
let backgroundWidth = labelFontSize * labelText.length * 0.7;
|
|
33
|
+
if (backgroundWidth < backgroundHeight)
|
|
34
|
+
backgroundWidth = backgroundHeight;
|
|
35
|
+
smartTransition(rect, duration)
|
|
36
|
+
.attr('width', backgroundWidth)
|
|
37
|
+
.attr('height', backgroundHeight)
|
|
38
|
+
.attr('x', -backgroundWidth / 2)
|
|
39
|
+
.attr('y', -backgroundHeight / 2)
|
|
40
|
+
.attr('rx', labelFontSize)
|
|
41
|
+
.attr('ry', labelFontSize)
|
|
42
|
+
.style('fill', backgroundColor);
|
|
43
|
+
// Label
|
|
44
|
+
if (!labelColor) {
|
|
45
|
+
const hex = (_b = color(isStringCSSVariable(backgroundColor) ? getCSSVariableValue(backgroundColor, group.node()) : backgroundColor)) === null || _b === void 0 ? void 0 : _b.hex();
|
|
46
|
+
const brightness = hexToBrightness(hex);
|
|
47
|
+
labelColor = brightness > config.labelTextBrightnessRatio
|
|
48
|
+
? 'var(--vis-xy-label-text-color-dark)'
|
|
49
|
+
: 'var(--vis-xy-label-text-color-light)';
|
|
50
|
+
}
|
|
51
|
+
text.html(labelText)
|
|
52
|
+
.attr('font-size', labelFontSize);
|
|
53
|
+
smartTransition(text, duration)
|
|
54
|
+
.style('fill', labelColor);
|
|
55
|
+
rect.style('cursor', d._screen.cursor);
|
|
56
|
+
});
|
|
57
|
+
smartTransition(selection, duration)
|
|
58
|
+
.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(1)`);
|
|
59
|
+
}
|
|
60
|
+
function removeLabels(selection, duration) {
|
|
61
|
+
smartTransition(selection, duration)
|
|
62
|
+
.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`)
|
|
63
|
+
.remove();
|
|
64
|
+
}
|
|
65
|
+
function getLabelPosition(value, positioning, scale) {
|
|
66
|
+
var _a;
|
|
67
|
+
switch (positioning) {
|
|
68
|
+
case XYLabelPositioning.DataSpace: return (_a = scale(value)) !== null && _a !== void 0 ? _a : 0;
|
|
69
|
+
case XYLabelPositioning.AbsolutePx: return value;
|
|
70
|
+
case XYLabelPositioning.AbsolutePercentage: {
|
|
71
|
+
const scaleRange = scale.range();
|
|
72
|
+
return scaleRange[0] + (scaleRange[1] - scaleRange[0]) * value / 100;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function getLabelRenderProps(data, el, config, xScale, yScale) {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
const isCluster = Array.isArray(data);
|
|
79
|
+
const fontSize = isCluster
|
|
80
|
+
? ((_a = getNumber(data, config.clusterFontSize)) !== null && _a !== void 0 ? _a : getCSSVariableValueInPixels('var(--vis-xy-label-cluster-font-size)', el))
|
|
81
|
+
: ((_b = getNumber(data, config.labelFontSize)) !== null && _b !== void 0 ? _b : getCSSVariableValueInPixels('var(--vis-xy-label-font-size)', el));
|
|
82
|
+
const labelText = (isCluster ? config.clusterLabel(data) : getString(data, config.label)) || '';
|
|
83
|
+
const backgroundHeight = fontSize * 1.7;
|
|
84
|
+
let backgroundWidth = fontSize * labelText.length * 0.7;
|
|
85
|
+
if (backgroundWidth < backgroundHeight)
|
|
86
|
+
backgroundWidth = backgroundHeight;
|
|
87
|
+
const x = isCluster
|
|
88
|
+
? mean(data, d => d._screen.x)
|
|
89
|
+
: getLabelPosition(getNumber(data, config.x), getValue(data, config.xPositioning), xScale);
|
|
90
|
+
const y = isCluster
|
|
91
|
+
? mean(data, d => d._screen.y)
|
|
92
|
+
: getLabelPosition(getNumber(data, config.y), getValue(data, config.yPositioning), yScale);
|
|
93
|
+
return {
|
|
94
|
+
x,
|
|
95
|
+
y,
|
|
96
|
+
fontSize,
|
|
97
|
+
labelText,
|
|
98
|
+
labelColor: isCluster ? getColor(data, config.clusterLabelColor) : getColor(data, config.color),
|
|
99
|
+
backgroundColor: isCluster ? getColor(data, config.clusterBackgroundColor) : getColor(data, config.backgroundColor),
|
|
100
|
+
cursor: isCluster ? getString(data, config.clusterCursor) : getString(data, config.cursor),
|
|
101
|
+
width: backgroundWidth,
|
|
102
|
+
height: backgroundHeight,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { createLabels, getLabelPosition, getLabelRenderProps, removeLabels, updateLabels };
|
|
107
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","sources":["../../../../src/components/xy-labels/modules/label.ts"],"sourcesContent":["import { Selection, select } from 'd3-selection'\nimport { mean } from 'd3-array'\nimport { color } from 'd3-color'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\nimport { getCSSVariableValueInPixels, getCSSVariableValue, isStringCSSVariable } from 'utils/misc'\nimport { getColor, hexToBrightness } from 'utils/color'\nimport { getNumber, getString, getValue } from 'utils/data'\n\n// Types\nimport { ContinuousScale } from 'types/scale'\n\n// Config\nimport { XYLabelsConfig } from '../config'\n\n// Local Types\nimport { XYLabel, XYLabelCluster, XYLabelPositioning, XYLabelRenderProps } from '../types'\n\nexport function createLabels<Datum> (\n selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>\n): void {\n selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y})`)\n selection.append('rect').style('fill', d => d._screen.backgroundColor)\n selection.append('text')\n .style('text-anchor', 'middle')\n .style('dominant-baseline', 'central')\n .style('fill', d => d._screen.backgroundColor)\n .style('pointer-events', 'none')\n\n selection.attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`)\n}\n\nexport function updateLabels<Datum> (\n selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>,\n config: XYLabelsConfig<Datum>,\n duration: number\n): void {\n selection.each((d, i, elements) => {\n const group: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any> = select(elements[i])\n const text = group.select('text')\n const rect = group.select('rect')\n\n const backgroundColor = d._screen.backgroundColor\n const labelText = d._screen.labelText ?? ''\n const labelFontSize = d._screen.fontSize\n let labelColor = d._screen.labelColor\n\n // Label background\n const backgroundHeight = labelFontSize * 1.7\n let backgroundWidth = labelFontSize * labelText.length * 0.7\n if (backgroundWidth < backgroundHeight) backgroundWidth = backgroundHeight\n smartTransition(rect, duration)\n .attr('width', backgroundWidth)\n .attr('height', backgroundHeight)\n .attr('x', -backgroundWidth / 2)\n .attr('y', -backgroundHeight / 2)\n .attr('rx', labelFontSize)\n .attr('ry', labelFontSize)\n .style('fill', backgroundColor)\n\n // Label\n if (!labelColor) {\n const hex = color(isStringCSSVariable(backgroundColor) ? getCSSVariableValue(backgroundColor, group.node()) : backgroundColor)?.hex()\n const brightness = hexToBrightness(hex)\n labelColor = brightness > config.labelTextBrightnessRatio\n ? 'var(--vis-xy-label-text-color-dark)'\n : 'var(--vis-xy-label-text-color-light)'\n }\n\n text.html(labelText)\n .attr('font-size', labelFontSize)\n\n smartTransition(text, duration)\n .style('fill', labelColor)\n\n rect.style('cursor', d._screen.cursor)\n })\n\n smartTransition(selection, duration)\n .attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(1)`)\n}\n\nexport function removeLabels<Datum> (\n selection: Selection<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>, any, any>,\n duration: number\n): void {\n smartTransition(selection, duration)\n .attr('transform', d => `translate(${d._screen.x},${d._screen.y}) scale(0)`)\n .remove()\n}\n\nexport function getLabelPosition (value: number, positioning: XYLabelPositioning, scale: ContinuousScale): number {\n switch (positioning) {\n case XYLabelPositioning.DataSpace: return scale(value) ?? 0\n case XYLabelPositioning.AbsolutePx: return value\n case XYLabelPositioning.AbsolutePercentage: {\n const scaleRange = scale.range()\n return scaleRange[0] + (scaleRange[1] - scaleRange[0]) * value / 100\n }\n }\n}\n\nexport function getLabelRenderProps<Datum> (\n data: Datum | XYLabel<Datum>[],\n el: SVGGraphicsElement,\n config: XYLabelsConfig<Datum>,\n xScale: ContinuousScale,\n yScale: ContinuousScale\n): XYLabelRenderProps {\n const isCluster = Array.isArray(data)\n const fontSize = isCluster\n ? (getNumber(data, config.clusterFontSize) ?? getCSSVariableValueInPixels('var(--vis-xy-label-cluster-font-size)', el))\n : (getNumber(data, config.labelFontSize) ?? getCSSVariableValueInPixels('var(--vis-xy-label-font-size)', el))\n\n const labelText = (isCluster ? config.clusterLabel(data as XYLabel<Datum>[]) : getString(data, config.label)) || ''\n const backgroundHeight = fontSize * 1.7\n let backgroundWidth = fontSize * labelText.length * 0.7\n if (backgroundWidth < backgroundHeight) backgroundWidth = backgroundHeight\n\n const x = isCluster\n ? mean(data as XYLabel<Datum>[], d => d._screen.x)\n : getLabelPosition(getNumber(data, config.x), getValue(data, config.xPositioning), xScale)\n\n const y = isCluster\n ? mean(data as XYLabel<Datum>[], d => d._screen.y)\n : getLabelPosition(getNumber(data, config.y), getValue(data, config.yPositioning), yScale)\n\n return {\n x,\n y,\n fontSize,\n labelText,\n labelColor: isCluster ? getColor(data, config.clusterLabelColor) : getColor(data, config.color),\n backgroundColor: isCluster ? getColor(data, config.clusterBackgroundColor) : getColor(data, config.backgroundColor),\n cursor: isCluster ? getString(data, config.clusterCursor) : getString(data, config.cursor),\n width: backgroundWidth,\n height: backgroundHeight,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAmBM,SAAU,YAAY,CAC1B,SAAmF,EAAA;IAEnF,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,CAAa,UAAA,EAAA,CAAC,CA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C,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,CAAA;IAE5F,MAAM,CAAC,GAAG,SAAS;AACjB,UAAE,IAAI,CAAC,IAAwB,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;UAChD,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,CAAA;IAE5F,OAAO;QACL,CAAC;QACD,CAAC;QACD,QAAQ;QACR,SAAS;QACT,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,iBAAiB,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC;QAC/F,eAAe,EAAE,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,sBAAsB,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC;QACnH,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;AAC1F,QAAA,KAAK,EAAE,eAAe;AACtB,QAAA,MAAM,EAAE,gBAAgB;KACzB,CAAA;AACH;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { injectGlobal, css } from '@emotion/css';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const globalStyles = injectGlobal `
|
|
4
4
|
:root {
|
|
5
5
|
--vis-xy-label-cursor: default;
|
|
6
6
|
// Undefined by default to allow proper fallback to var(--vis-color-main)
|
|
@@ -17,13 +17,11 @@ export const globalStyles = injectGlobal`
|
|
|
17
17
|
--vis-xy-label-text-color-light: #fff;
|
|
18
18
|
--vis-xy-label-text-font-weight: 500;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export const root = css`
|
|
20
|
+
`;
|
|
21
|
+
const root = css `
|
|
23
22
|
label: xy-labels-component;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export const labelGroup = css`
|
|
23
|
+
`;
|
|
24
|
+
const labelGroup = css `
|
|
27
25
|
label: label-g;
|
|
28
26
|
|
|
29
27
|
> rect, text {
|
|
@@ -46,12 +44,13 @@ export const labelGroup = css`
|
|
|
46
44
|
stroke-width: var(--vis-xy-label-hover-stroke-width);
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export const cluster = css`
|
|
47
|
+
`;
|
|
48
|
+
const cluster = css `
|
|
52
49
|
label: cluster;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export const label = css`
|
|
50
|
+
`;
|
|
51
|
+
const label = css `
|
|
56
52
|
label: label;
|
|
57
|
-
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
export { cluster, globalStyles, label, labelGroup, root };
|
|
56
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../src/components/xy-labels/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const globalStyles = injectGlobal`\n :root {\n --vis-xy-label-cursor: default;\n // Undefined by default to allow proper fallback to var(--vis-color-main)\n /* --vis-xy-label-fill-color */\n --vis-xy-label-stroke-color: none;\n --vis-xy-label-stroke-width: 0px;\n --vis-xy-label-fill-opacity: 1;\n --vis-xy-label-stroke-opacity: 1;\n --vis-xy-label-hover-stroke-width: 1px;\n --vis-xy-label-font-size: 12px;\n --vis-xy-label-cluster-font-size: 14px;\n\n --vis-xy-label-text-color-dark: #5b5f6d;\n --vis-xy-label-text-color-light: #fff;\n --vis-xy-label-text-font-weight: 500;\n }\n`\n\nexport const root = css`\n label: xy-labels-component;\n`\n\nexport const labelGroup = css`\n label: label-g;\n\n > rect, text {\n cursor: var(--vis-xy-label-cursor);\n fill: var(--vis-xy-label-fill-color, var(--vis-color-main));\n fill-opacity: var(--vis-xy-label-fill-opacity);\n stroke-opacity: var(--vis-xy-label-stroke-opacity);\n }\n\n > text {\n font-weight: var(--vis-xy-label-text-font-weight);\n user-select: none;\n }\n\n > rect {\n stroke-width: var(--vis-xy-label-stroke-width);\n stroke: var(--vis-xy-label-stroke-color);\n\n &:hover {\n stroke-width: var(--vis-xy-label-hover-stroke-width);\n }\n }\n`\n\nexport const cluster = css`\n label: cluster;\n`\n\nexport const label = css`\n label: label;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,YAAY,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;EAiBvC;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;EAuB5B;AAEM,MAAM,OAAO,GAAG,GAAG,CAAA,CAAA;;EAEzB;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare 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
|
+
export declare type XYLabel<D> = D & {
|
|
13
|
+
_screen: XYLabelRenderProps;
|
|
14
|
+
};
|
|
15
|
+
export declare type XYLabelCluster<D> = {
|
|
16
|
+
_screen: XYLabelRenderProps;
|
|
17
|
+
records: XYLabel<D>[];
|
|
18
|
+
};
|
|
19
|
+
export declare enum XYLabelPositioning {
|
|
20
|
+
AbsolutePx = "absolute_px",
|
|
21
|
+
AbsolutePercentage = "absolute_percentage",
|
|
22
|
+
DataSpace = "data_space"
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var XYLabelPositioning;
|
|
2
|
+
(function (XYLabelPositioning) {
|
|
3
|
+
XYLabelPositioning["AbsolutePx"] = "absolute_px";
|
|
4
|
+
XYLabelPositioning["AbsolutePercentage"] = "absolute_percentage";
|
|
5
|
+
XYLabelPositioning["DataSpace"] = "data_space";
|
|
6
|
+
})(XYLabelPositioning || (XYLabelPositioning = {}));
|
|
7
|
+
|
|
8
|
+
export { XYLabelPositioning };
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/components/xy-labels/types.ts"],"sourcesContent":["export type XYLabelRenderProps = {\n x: number;\n y: number;\n fontSize: number;\n backgroundColor: string | null;\n labelText: string | null;\n labelColor: string | null;\n cursor: string | null;\n width: number;\n height: number;\n}\n\nexport type XYLabel<D> = D & {\n _screen: XYLabelRenderProps;\n}\n\nexport type XYLabelCluster<D> = {\n _screen: XYLabelRenderProps;\n records: XYLabel<D>[];\n}\n\nexport enum XYLabelPositioning {\n AbsolutePx = 'absolute_px',\n AbsolutePercentage = 'absolute_percentage',\n DataSpace = 'data_space',\n}\n"],"names":[],"mappings":"IAqBY,mBAIX;AAJD,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,YAAA,CAAA,GAAA,aAA0B,CAAA;AAC1B,IAAA,kBAAA,CAAA,oBAAA,CAAA,GAAA,qBAA0C,CAAA;AAC1C,IAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,YAAwB,CAAA;AAC1B,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,GAI7B,EAAA,CAAA,CAAA;;;;"}
|
package/components.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export { ComponentCore } from "./core/component";
|
|
2
|
+
export { ComponentConfigInterface } from "./core/component/config";
|
|
3
|
+
export { XYComponentCore } from "./core/xy-component";
|
|
4
|
+
export { XYComponentConfigInterface } from "./core/xy-component/config";
|
|
5
|
+
export { Tooltip } from "./components/tooltip";
|
|
6
|
+
export { Line } from './components/line';
|
|
7
|
+
export { StackedBar } from './components/stacked-bar';
|
|
8
|
+
export { GroupedBar } from './components/grouped-bar';
|
|
9
|
+
export { Axis } from './components/axis';
|
|
10
|
+
export { Scatter } from './components/scatter';
|
|
11
|
+
export { Brush } from './components/brush';
|
|
12
|
+
export { BulletLegend } from './components/bullet-legend';
|
|
13
|
+
export { FlowLegend } from './components/flow-legend';
|
|
14
|
+
export { Crosshair } from './components/crosshair';
|
|
15
|
+
export { Timeline } from './components/timeline';
|
|
16
|
+
export { Sankey } from './components/sankey';
|
|
17
|
+
export { Area } from './components/area';
|
|
18
|
+
export { TopoJSONMap } from './components/topojson-map';
|
|
19
|
+
export { LeafletMap } from './components/leaflet-map';
|
|
20
|
+
export { MapLibreArcticDark, MapLibreArcticLight } from './components/leaflet-map/renderer/map-style';
|
|
21
|
+
export { LeafletFlowMap } from './components/leaflet-flow-map';
|
|
22
|
+
export { ChordDiagram } from './components/chord-diagram';
|
|
23
|
+
export { Graph } from './components/graph';
|
|
24
|
+
export { VisControls } from './components/vis-controls';
|
|
25
|
+
export { Donut } from './components/donut';
|
|
26
|
+
export { FreeBrush } from './components/free-brush';
|
|
27
|
+
export { XYLabels } from './components/xy-labels';
|
|
28
|
+
export { NestedDonut } from './components/nested-donut';
|
|
29
|
+
export type { LineConfigInterface } from './components/line/config';
|
|
30
|
+
export type { StackedBarConfigInterface } from './components/stacked-bar/config';
|
|
31
|
+
export type { GroupedBarConfigInterface } from './components/grouped-bar/config';
|
|
32
|
+
export type { ScatterConfigInterface } from './components/scatter/config';
|
|
33
|
+
export type { TooltipConfigInterface } from './components/tooltip/config';
|
|
34
|
+
export type { BrushConfigInterface } from './components/brush/config';
|
|
35
|
+
export type { AxisConfigInterface } from './components/axis/config';
|
|
36
|
+
export type { BulletLegendConfigInterface } from './components/bullet-legend/config';
|
|
37
|
+
export type { FlowLegendConfigInterface } from './components/flow-legend/config';
|
|
38
|
+
export type { CrosshairConfigInterface } from './components/crosshair/config';
|
|
39
|
+
export type { TimelineConfigInterface } from './components/timeline/config';
|
|
40
|
+
export type { SankeyConfigInterface } from './components/sankey/config';
|
|
41
|
+
export type { AreaConfigInterface } from './components/area/config';
|
|
42
|
+
export type { TopoJSONMapConfigInterface } from './components/topojson-map/config';
|
|
43
|
+
export type { LeafletMapConfigInterface } from './components/leaflet-map/config';
|
|
44
|
+
export type { LeafletFlowMapConfigInterface } from './components/leaflet-flow-map/config';
|
|
45
|
+
export type { ChordDiagramConfigInterface } from './components/chord-diagram/config';
|
|
46
|
+
export type { GraphConfigInterface } from './components/graph/config';
|
|
47
|
+
export type { VisControlsConfigInterface } from './components/vis-controls/config';
|
|
48
|
+
export type { DonutConfigInterface } from './components/donut/config';
|
|
49
|
+
export type { FreeBrushConfigInterface } from './components/free-brush/config';
|
|
50
|
+
export type { XYLabelsConfigInterface } from './components/xy-labels/config';
|
|
51
|
+
export type { NestedDonutConfigInterface } from './components/nested-donut/config';
|
package/components.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { ComponentCore } from './core/component/index.js';
|
|
2
|
+
export { XYComponentCore } from './core/xy-component/index.js';
|
|
3
|
+
export { Tooltip } from './components/tooltip/index.js';
|
|
4
|
+
export { Line } from './components/line/index.js';
|
|
5
|
+
export { StackedBar } from './components/stacked-bar/index.js';
|
|
6
|
+
export { GroupedBar } from './components/grouped-bar/index.js';
|
|
7
|
+
export { Axis } from './components/axis/index.js';
|
|
8
|
+
export { Scatter } from './components/scatter/index.js';
|
|
9
|
+
export { Brush } from './components/brush/index.js';
|
|
10
|
+
export { BulletLegend } from './components/bullet-legend/index.js';
|
|
11
|
+
export { FlowLegend } from './components/flow-legend/index.js';
|
|
12
|
+
export { Crosshair } from './components/crosshair/index.js';
|
|
13
|
+
export { Timeline } from './components/timeline/index.js';
|
|
14
|
+
export { Sankey } from './components/sankey/index.js';
|
|
15
|
+
export { Area } from './components/area/index.js';
|
|
16
|
+
export { TopoJSONMap } from './components/topojson-map/index.js';
|
|
17
|
+
export { LeafletMap } from './components/leaflet-map/index.js';
|
|
18
|
+
export { MapLibreArcticDark, MapLibreArcticLight } from './components/leaflet-map/renderer/map-style.js';
|
|
19
|
+
export { LeafletFlowMap } from './components/leaflet-flow-map/index.js';
|
|
20
|
+
export { ChordDiagram } from './components/chord-diagram/index.js';
|
|
21
|
+
export { Graph } from './components/graph/index.js';
|
|
22
|
+
export { VisControls } from './components/vis-controls/index.js';
|
|
23
|
+
export { Donut } from './components/donut/index.js';
|
|
24
|
+
export { FreeBrush } from './components/free-brush/index.js';
|
|
25
|
+
export { XYLabels } from './components/xy-labels/index.js';
|
|
26
|
+
export { NestedDonut } from './components/nested-donut/index.js';
|
|
27
|
+
|
|
28
|
+
// Core
|
|
29
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../src/components.ts"],"sourcesContent":["// Core\nexport { ComponentCore } from 'core/component'\nexport type { ComponentConfigInterface } from 'core/component/config'\nexport { XYComponentCore } from 'core/xy-component'\nexport type { XYComponentConfigInterface } from 'core/xy-component/config'\n\n// Components\nexport { Tooltip } from 'components/tooltip'\nexport { Line } from './components/line'\nexport { StackedBar } from './components/stacked-bar'\nexport { GroupedBar } from './components/grouped-bar'\nexport { Axis } from './components/axis'\nexport { Scatter } from './components/scatter'\nexport { Brush } from './components/brush'\nexport { BulletLegend } from './components/bullet-legend'\nexport { FlowLegend } from './components/flow-legend'\nexport { Crosshair } from './components/crosshair'\nexport { Timeline } from './components/timeline'\nexport { Sankey } from './components/sankey'\nexport { Area } from './components/area'\nexport { TopoJSONMap } from './components/topojson-map'\nexport { LeafletMap } from './components/leaflet-map'\nexport { MapLibreArcticDark, MapLibreArcticLight } from './components/leaflet-map/renderer/map-style'\nexport { LeafletFlowMap } from './components/leaflet-flow-map'\nexport { ChordDiagram } from './components/chord-diagram'\nexport { Graph } from './components/graph'\nexport { VisControls } from './components/vis-controls'\nexport { Donut } from './components/donut'\nexport { FreeBrush } from './components/free-brush'\nexport { XYLabels } from './components/xy-labels'\nexport { NestedDonut } from './components/nested-donut'\n\n// Config Interfaces\nexport type { LineConfigInterface } from './components/line/config'\nexport type { StackedBarConfigInterface } from './components/stacked-bar/config'\nexport type { GroupedBarConfigInterface } from './components/grouped-bar/config'\nexport type { ScatterConfigInterface } from './components/scatter/config'\nexport type { TooltipConfigInterface } from './components/tooltip/config'\nexport type { BrushConfigInterface } from './components/brush/config'\nexport type { AxisConfigInterface } from './components/axis/config'\nexport type { BulletLegendConfigInterface } from './components/bullet-legend/config'\nexport type { FlowLegendConfigInterface } from './components/flow-legend/config'\nexport type { CrosshairConfigInterface } from './components/crosshair/config'\nexport type { TimelineConfigInterface } from './components/timeline/config'\nexport type { SankeyConfigInterface } from './components/sankey/config'\nexport type { AreaConfigInterface } from './components/area/config'\nexport type { TopoJSONMapConfigInterface } from './components/topojson-map/config'\nexport type { LeafletMapConfigInterface } from './components/leaflet-map/config'\nexport type { LeafletFlowMapConfigInterface } from './components/leaflet-flow-map/config'\nexport type { ChordDiagramConfigInterface } from './components/chord-diagram/config'\nexport type { GraphConfigInterface } from './components/graph/config'\nexport type { VisControlsConfigInterface } from './components/vis-controls/config'\nexport type { DonutConfigInterface } from './components/donut/config'\nexport type { FreeBrushConfigInterface } from './components/free-brush/config'\nexport type { XYLabelsConfigInterface } from './components/xy-labels/config'\nexport type { NestedDonutConfigInterface } from './components/nested-donut/config'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ContainerConfig, ContainerConfigInterface } from "../../core/container/config";
|
|
2
|
+
import { ComponentCore } from "../../core/component";
|
|
3
|
+
import { Tooltip } from "../../components/tooltip";
|
|
4
|
+
export interface SingleContainerConfigInterface<Datum> extends ContainerConfigInterface {
|
|
5
|
+
/** Visualization component. Default: `undefined` */
|
|
6
|
+
component?: ComponentCore<Datum>;
|
|
7
|
+
/** Tooltip component. Default: `undefined` */
|
|
8
|
+
tooltip?: Tooltip;
|
|
9
|
+
}
|
|
10
|
+
export declare class SingleContainerConfig<Datum> extends ContainerConfig implements SingleContainerConfigInterface<Datum> {
|
|
11
|
+
tooltip: any;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ContainerConfig } from '../../core/container/config.js';
|
|
2
|
+
|
|
3
|
+
// Core
|
|
4
|
+
class SingleContainerConfig extends ContainerConfig {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.tooltip = undefined;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { SingleContainerConfig };
|
|
12
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/containers/single-container/config.ts"],"sourcesContent":["// Core\nimport { ContainerConfig, ContainerConfigInterface } from 'core/container/config'\nimport { ComponentCore } from 'core/component'\nimport { Tooltip } from 'components/tooltip'\n\nexport interface SingleContainerConfigInterface<Datum> extends ContainerConfigInterface {\n /** Visualization component. Default: `undefined` */\n component?: ComponentCore<Datum>;\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip;\n}\n\nexport class SingleContainerConfig<Datum> extends ContainerConfig implements SingleContainerConfigInterface<Datum> {\n tooltip = undefined\n}\n"],"names":[],"mappings":";;AAAA;AAYM,MAAO,qBAA6B,SAAQ,eAAe,CAAA;AAAjE,IAAA,WAAA,GAAA;;QACE,IAAO,CAAA,OAAA,GAAG,SAAS,CAAA;KACpB;AAAA;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "../../styles/index";
|
|
2
|
+
import { ContainerCore } from "../../core/container";
|
|
3
|
+
import { ComponentCore } from "../../core/component";
|
|
4
|
+
import { ComponentConfigInterface } from "../../core/component/config";
|
|
5
|
+
import { SingleContainerConfig, SingleContainerConfigInterface } from './config';
|
|
6
|
+
export declare class SingleContainer<Data> extends ContainerCore {
|
|
7
|
+
component: ComponentCore<Data>;
|
|
8
|
+
config: SingleContainerConfig<Data>;
|
|
9
|
+
constructor(element: HTMLElement, config?: SingleContainerConfigInterface<Data>, data?: Data);
|
|
10
|
+
setData(data: Data, preventRender?: boolean): void;
|
|
11
|
+
updateContainer(containerConfig: SingleContainerConfigInterface<Data>, preventRender?: boolean): void;
|
|
12
|
+
updateComponent(componentConfig: ComponentConfigInterface, preventRender?: boolean): void;
|
|
13
|
+
update(containerConfig: SingleContainerConfigInterface<Data>, componentConfig?: ComponentConfigInterface, data?: Data): void;
|
|
14
|
+
getFitWidthScale(): number;
|
|
15
|
+
_render(duration?: number): void;
|
|
16
|
+
render(duration?: any): void;
|
|
17
|
+
_onResize(): void;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import '../../styles/index.js';
|
|
2
|
+
import { ContainerCore } from '../../core/container/index.js';
|
|
3
|
+
import { smartTransition } from '../../utils/d3.js';
|
|
4
|
+
import { Sizing } from '../../types/component.js';
|
|
5
|
+
import { SingleContainerConfig } from './config.js';
|
|
6
|
+
|
|
7
|
+
// Global CSS variables (side effects import)
|
|
8
|
+
class SingleContainer extends ContainerCore {
|
|
9
|
+
constructor(element, config, data) {
|
|
10
|
+
var _a;
|
|
11
|
+
super(element);
|
|
12
|
+
this.config = new SingleContainerConfig();
|
|
13
|
+
if (config) {
|
|
14
|
+
this.updateContainer(config, true);
|
|
15
|
+
this.component = config.component;
|
|
16
|
+
}
|
|
17
|
+
if (data) {
|
|
18
|
+
this.setData(data, true);
|
|
19
|
+
}
|
|
20
|
+
// Render if component exists and has data
|
|
21
|
+
if ((_a = this.component) === null || _a === void 0 ? void 0 : _a.datamodel.data)
|
|
22
|
+
this.render();
|
|
23
|
+
}
|
|
24
|
+
setData(data, preventRender) {
|
|
25
|
+
var _a;
|
|
26
|
+
const { config } = this;
|
|
27
|
+
if (this.component)
|
|
28
|
+
this.component.setData(data);
|
|
29
|
+
if (!preventRender)
|
|
30
|
+
this.render();
|
|
31
|
+
(_a = config.tooltip) === null || _a === void 0 ? void 0 : _a.hide();
|
|
32
|
+
}
|
|
33
|
+
updateContainer(containerConfig, preventRender) {
|
|
34
|
+
super.updateContainer(containerConfig);
|
|
35
|
+
this.removeAllChildren();
|
|
36
|
+
this.component = containerConfig.component;
|
|
37
|
+
if (containerConfig.sizing)
|
|
38
|
+
this.component.sizing = containerConfig.sizing;
|
|
39
|
+
this.element.appendChild(this.component.element);
|
|
40
|
+
const tooltip = containerConfig.tooltip;
|
|
41
|
+
if (tooltip) {
|
|
42
|
+
if (!tooltip.hasContainer())
|
|
43
|
+
tooltip.setContainer(this._container);
|
|
44
|
+
tooltip.setComponents([this.component]);
|
|
45
|
+
}
|
|
46
|
+
if (!preventRender)
|
|
47
|
+
this.render();
|
|
48
|
+
}
|
|
49
|
+
updateComponent(componentConfig, preventRender) {
|
|
50
|
+
this.component.setConfig(componentConfig);
|
|
51
|
+
if (!preventRender)
|
|
52
|
+
this.render();
|
|
53
|
+
}
|
|
54
|
+
update(containerConfig, componentConfig, data) {
|
|
55
|
+
if (containerConfig)
|
|
56
|
+
this.updateContainer(containerConfig, true);
|
|
57
|
+
if (componentConfig)
|
|
58
|
+
this.updateComponent(componentConfig, true);
|
|
59
|
+
if (data)
|
|
60
|
+
this.setData(data, true);
|
|
61
|
+
this.render();
|
|
62
|
+
}
|
|
63
|
+
getFitWidthScale() {
|
|
64
|
+
const { config, component } = this;
|
|
65
|
+
const extendedSizeComponent = component;
|
|
66
|
+
if (!extendedSizeComponent.getWidth)
|
|
67
|
+
return 1;
|
|
68
|
+
const componentWidth = extendedSizeComponent.getWidth() + config.margin.left + config.margin.right;
|
|
69
|
+
return this.width / componentWidth;
|
|
70
|
+
}
|
|
71
|
+
_render(duration) {
|
|
72
|
+
const { config, component } = this;
|
|
73
|
+
super._render(duration);
|
|
74
|
+
component.setSize(this.width, this.height, this.containerWidth, this.containerHeight);
|
|
75
|
+
component.g.attr('transform', `translate(${config.margin.left},${config.margin.top})`);
|
|
76
|
+
component.render(duration);
|
|
77
|
+
if (config.tooltip)
|
|
78
|
+
config.tooltip.update();
|
|
79
|
+
}
|
|
80
|
+
// Re-defining the `render()` function to handle different sizing techniques (`Sizing.Extend` and `Sizing.FitWidth`)
|
|
81
|
+
// Not calling `super.render()` because we don't want it to interfere with setting the SVG size here.
|
|
82
|
+
render(duration = this.config.duration) {
|
|
83
|
+
const { config, component } = this;
|
|
84
|
+
if (config.sizing === Sizing.Extend || config.sizing === Sizing.FitWidth) {
|
|
85
|
+
const fitToWidth = config.sizing === Sizing.FitWidth;
|
|
86
|
+
const extendedSizeComponent = component;
|
|
87
|
+
const componentWidth = extendedSizeComponent.getWidth() + config.margin.left + config.margin.right;
|
|
88
|
+
const componentHeight = extendedSizeComponent.getHeight() + config.margin.top + config.margin.bottom;
|
|
89
|
+
const scale = fitToWidth ? this.getFitWidthScale() : 1;
|
|
90
|
+
const currentWidth = this.svg.attr('width');
|
|
91
|
+
const currentHeight = this.svg.attr('height');
|
|
92
|
+
const scaledWidth = componentWidth * scale;
|
|
93
|
+
const scaledHeight = componentHeight * scale;
|
|
94
|
+
const animated = currentWidth || currentHeight;
|
|
95
|
+
smartTransition(this.svg, animated ? duration : 0)
|
|
96
|
+
.attr('width', scaledWidth)
|
|
97
|
+
.attr('height', scaledHeight)
|
|
98
|
+
.attr('viewBox', `${0} ${0} ${componentWidth} ${fitToWidth ? scaledHeight : componentHeight}`)
|
|
99
|
+
.attr('preserveAspectRatio', 'xMinYMin');
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
this.svg
|
|
103
|
+
.attr('width', this.config.width || this.containerWidth)
|
|
104
|
+
.attr('height', this.config.height || this.containerHeight);
|
|
105
|
+
}
|
|
106
|
+
// Schedule the actual rendering in the next frame
|
|
107
|
+
cancelAnimationFrame(this._requestedAnimationFrame);
|
|
108
|
+
this._requestedAnimationFrame = requestAnimationFrame(() => {
|
|
109
|
+
this._render(duration);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
_onResize() {
|
|
113
|
+
var _a;
|
|
114
|
+
const { config } = this;
|
|
115
|
+
super._onResize();
|
|
116
|
+
(_a = config.tooltip) === null || _a === void 0 ? void 0 : _a.hide();
|
|
117
|
+
}
|
|
118
|
+
destroy() {
|
|
119
|
+
var _a;
|
|
120
|
+
const { component, config } = this;
|
|
121
|
+
super.destroy();
|
|
122
|
+
component === null || component === void 0 ? void 0 : component.destroy();
|
|
123
|
+
(_a = config.tooltip) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export { SingleContainer };
|
|
128
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.ts"],"sourcesContent":["// Global CSS variables (side effects import)\nimport 'styles/index'\n\n// Core\nimport { ContainerCore } from 'core/container'\nimport { ComponentCore } from 'core/component'\nimport { ComponentConfigInterface } from 'core/component/config'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\n\n// Types\nimport { Sizing, ExtendedSizeComponent } from 'types/component'\n\n// Config\nimport { SingleContainerConfig, SingleContainerConfigInterface } from './config'\n\nexport class SingleContainer<Data> extends ContainerCore {\n component: ComponentCore<Data>\n config: SingleContainerConfig<Data> = new SingleContainerConfig()\n\n constructor (element: HTMLElement, config?: SingleContainerConfigInterface<Data>, data?: Data) {\n super(element)\n\n if (config) {\n this.updateContainer(config, true)\n this.component = config.component\n }\n\n if (data) {\n this.setData(data, true)\n }\n\n // Render if component exists and has data\n if (this.component?.datamodel.data) this.render()\n }\n\n public setData (data: Data, preventRender?: boolean): void {\n const { config } = this\n\n if (this.component) this.component.setData(data)\n if (!preventRender) this.render()\n config.tooltip?.hide()\n }\n\n public updateContainer (containerConfig: SingleContainerConfigInterface<Data>, preventRender?: boolean): void {\n super.updateContainer(containerConfig)\n this.removeAllChildren()\n\n this.component = containerConfig.component\n if (containerConfig.sizing) this.component.sizing = containerConfig.sizing\n this.element.appendChild(this.component.element)\n\n const tooltip = containerConfig.tooltip\n if (tooltip) {\n if (!tooltip.hasContainer()) tooltip.setContainer(this._container)\n tooltip.setComponents([this.component])\n }\n\n if (!preventRender) this.render()\n }\n\n public updateComponent (componentConfig: ComponentConfigInterface, preventRender?: boolean): void {\n this.component.setConfig(componentConfig)\n if (!preventRender) this.render()\n }\n\n public update (\n containerConfig: SingleContainerConfigInterface<Data>,\n componentConfig?: ComponentConfigInterface,\n data?: Data\n ): void {\n if (containerConfig) this.updateContainer(containerConfig, true)\n if (componentConfig) this.updateComponent(componentConfig, true)\n if (data) this.setData(data, true)\n this.render()\n }\n\n public getFitWidthScale (): number {\n const { config, component } = this\n\n const extendedSizeComponent = component as ExtendedSizeComponent\n if (!extendedSizeComponent.getWidth) return 1\n\n const componentWidth = extendedSizeComponent.getWidth() + config.margin.left + config.margin.right\n return this.width / componentWidth\n }\n\n _render (duration?: number): void {\n const { config, component } = this\n super._render(duration)\n\n component.setSize(this.width, this.height, this.containerWidth, this.containerHeight)\n component.g.attr('transform', `translate(${config.margin.left},${config.margin.top})`)\n component.render(duration)\n\n if (config.tooltip) config.tooltip.update()\n }\n\n // Re-defining the `render()` function to handle different sizing techniques (`Sizing.Extend` and `Sizing.FitWidth`)\n // Not calling `super.render()` because we don't want it to interfere with setting the SVG size here.\n render (duration = this.config.duration): void {\n const { config, component } = this\n\n if (config.sizing === Sizing.Extend || config.sizing === Sizing.FitWidth) {\n const fitToWidth = config.sizing === Sizing.FitWidth\n const extendedSizeComponent = component as ExtendedSizeComponent\n\n const componentWidth = extendedSizeComponent.getWidth() + config.margin.left + config.margin.right\n const componentHeight = extendedSizeComponent.getHeight() + config.margin.top + config.margin.bottom\n const scale = fitToWidth ? this.getFitWidthScale() : 1\n\n const currentWidth = this.svg.attr('width')\n const currentHeight = this.svg.attr('height')\n const scaledWidth = componentWidth * scale\n const scaledHeight = componentHeight * scale\n const animated = currentWidth || currentHeight\n\n smartTransition(this.svg, animated ? duration : 0)\n .attr('width', scaledWidth)\n .attr('height', scaledHeight)\n .attr('viewBox', `${0} ${0} ${componentWidth} ${fitToWidth ? scaledHeight : componentHeight}`)\n .attr('preserveAspectRatio', 'xMinYMin')\n } else {\n this.svg\n .attr('width', this.config.width || this.containerWidth)\n .attr('height', this.config.height || this.containerHeight)\n }\n\n // Schedule the actual rendering in the next frame\n cancelAnimationFrame(this._requestedAnimationFrame)\n this._requestedAnimationFrame = requestAnimationFrame(() => {\n this._render(duration)\n })\n }\n\n _onResize (): void {\n const { config } = this\n super._onResize()\n config.tooltip?.hide()\n }\n\n public destroy (): void {\n const { component, config } = this\n super.destroy()\n\n component?.destroy()\n config.tooltip?.destroy()\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;AAiBM,MAAO,eAAsB,SAAQ,aAAa,CAAA;AAItD,IAAA,WAAA,CAAa,OAAoB,EAAE,MAA6C,EAAE,IAAW,EAAA;;QAC3F,KAAK,CAAC,OAAO,CAAC,CAAA;AAHhB,QAAA,IAAA,CAAA,MAAM,GAAgC,IAAI,qBAAqB,EAAE,CAAA;AAK/D,QAAA,IAAI,MAAM,EAAE;AACV,YAAA,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAClC,YAAA,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;AAClC,SAAA;AAED,QAAA,IAAI,IAAI,EAAE;AACR,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACzB,SAAA;;AAGD,QAAA,IAAI,MAAA,IAAI,CAAC,SAAS,MAAE,IAAA,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,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAI,EAAE,CAAA;KACvB;IAEM,OAAO,GAAA;;AACZ,QAAA,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QAClC,KAAK,CAAC,OAAO,EAAE,CAAA;AAEf,QAAA,SAAS,aAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,EAAE,CAAA;AACpB,QAAA,CAAA,EAAA,GAAA,MAAM,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,EAAE,CAAA;KAC1B;AACF;;;;"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { XYComponentCore } from "../../core/xy-component";
|
|
2
|
+
import { ContainerConfig, ContainerConfigInterface } from "../../core/container/config";
|
|
3
|
+
import { Tooltip } from "../../components/tooltip";
|
|
4
|
+
import { Axis } from "../../components/axis";
|
|
5
|
+
import { Crosshair } from "../../components/crosshair";
|
|
6
|
+
import { ContinuousScale } from "../../types/scale";
|
|
7
|
+
import { Direction } from "../../types/direction";
|
|
8
|
+
export interface XYContainerConfigInterface<Datum> extends ContainerConfigInterface {
|
|
9
|
+
/** An array of visualization components. Default: `[]` */
|
|
10
|
+
components?: XYComponentCore<Datum>[];
|
|
11
|
+
/** Scale for X dimension, e.g. Scale.scaleLinear().
|
|
12
|
+
* If set, this value will override the components' xScale and they will have a single shared xScale instance.
|
|
13
|
+
* By default the components have their own scale instances but their `domain` and `range` values are synchronized.
|
|
14
|
+
* Default: `undefined` */
|
|
15
|
+
xScale?: ContinuousScale;
|
|
16
|
+
/** Scale domain (data extent) for X dimension. By default this value is calculated automatically based on data. */
|
|
17
|
+
xDomain?: [number | undefined, number | undefined];
|
|
18
|
+
/** Constraint the minimum value of the X scale domain. Useful when the data is plotted along the X axis.
|
|
19
|
+
* For example, imagine that you have a chart with dynamic data that has negative values. When values are small
|
|
20
|
+
* (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
|
|
21
|
+
* be achieved by setting `xDomainMinConstraint` to `[undefined, -1]`. In addition to that, if you want to cut off the
|
|
22
|
+
* values that are too low (let's say lower than -100), you can set the constraint to `[-100, -1]`
|
|
23
|
+
* Default: `undefined` */
|
|
24
|
+
xDomainMinConstraint?: [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. When values are small
|
|
27
|
+
* (let's say < 0.01), you might still want the chart to display some meaningful value range (e.g. [0, 1]). That can
|
|
28
|
+
* be achieved by setting `xDomainMaxConstraint` to `[1, undefined]`. In addition to that, if you want to cut off the
|
|
29
|
+
* values that are too high (let's say higher than 100), you can set the constraint to `[1, 100]`
|
|
30
|
+
* Default: `undefined` */
|
|
31
|
+
xDomainMaxConstraint?: [number | undefined, number | undefined];
|
|
32
|
+
/** Force set the X scale range (in the screen space). By default the range is calculated automatically based on the
|
|
33
|
+
* chart's set up */
|
|
34
|
+
xRange?: [number, number];
|
|
35
|
+
/** Scale for Y dimension, e.g. Scale.scaleLinear().
|
|
36
|
+
* If set, this value will override the components' yScale and they will have a single shared yScale instance.
|
|
37
|
+
* By default the components have their own scale instances but their `domain` and `range` values are synchronized.
|
|
38
|
+
* Default: `undefined` */
|
|
39
|
+
yScale?: ContinuousScale;
|
|
40
|
+
/** Scale domain (data extent) for Y dimension. By default this value is calculated automatically based on data. */
|
|
41
|
+
yDomain?: [number | undefined, number | undefined];
|
|
42
|
+
/** Constraint the minimum value of the Y scale domain.
|
|
43
|
+
* For example, imagine that you have a chart with dynamic data that has negative values. When values are small
|
|
44
|
+
* (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
|
|
45
|
+
* be achieved by setting `yDomainMinConstraint` to `[undefined, -1]`. In addition to that, if you want to cut off the
|
|
46
|
+
* values that are too low (let's say lower than -100), you can set the constraint to `[-100, -1]`
|
|
47
|
+
* Default: `undefined` */
|
|
48
|
+
yDomainMinConstraint?: [number | undefined, number | undefined];
|
|
49
|
+
/** Constraint the minimum value of the Y scale domain.
|
|
50
|
+
* For example, imagine that you have a chart with dynamic data. When values are small
|
|
51
|
+
* (let's say < 0.01), you might still want the chart to display some meaningful value range (e.g. [0, 1]). That can
|
|
52
|
+
* be achieved by setting `yDomainMaxConstraint` to `[1, undefined]`. In addition to that, if you want to cut off the
|
|
53
|
+
* values that are too high (let's say higher than 100), you can set the constraint to `[1, 100]`
|
|
54
|
+
* Default: `undefined` */
|
|
55
|
+
yDomainMaxConstraint?: [number | undefined, number | undefined];
|
|
56
|
+
/** Force set the Y scale range (in the screen space). By default the range is calculated automatically based on the
|
|
57
|
+
* chart's set up */
|
|
58
|
+
yRange?: [number, number];
|
|
59
|
+
/** Y Axis direction. Default: `Direction.North` */
|
|
60
|
+
yDirection?: Direction.South | Direction.North | string;
|
|
61
|
+
/** X Axis component instance. Default: `undefined` */
|
|
62
|
+
xAxis?: Axis<Datum>;
|
|
63
|
+
/** Y Axis component instance. Default: `undefined` */
|
|
64
|
+
yAxis?: Axis<Datum>;
|
|
65
|
+
/** Enables automatic calculation of chart margins based on the size of the axes. Default: `true` */
|
|
66
|
+
autoMargin?: boolean;
|
|
67
|
+
/** Tooltip component. Default: `undefined` */
|
|
68
|
+
tooltip?: Tooltip | undefined;
|
|
69
|
+
/** Crosshair component. Default: `undefined` */
|
|
70
|
+
crosshair?: Crosshair<Datum> | undefined;
|
|
71
|
+
/** Prevents the chart domain from being empty (when domain's min and max values are equal).
|
|
72
|
+
* That usually happens when all the data values are the same.
|
|
73
|
+
* Setting to `true` will automatically extend the domain by `+1` when needed.
|
|
74
|
+
* Default: `true` */
|
|
75
|
+
preventEmptyDomain?: boolean;
|
|
76
|
+
/** Sets the Y scale domain based on the current X scale domain (not the whole dataset). Default: `false` */
|
|
77
|
+
scaleByDomain?: boolean;
|
|
78
|
+
}
|
|
79
|
+
export declare class XYContainerConfig<Datum> extends ContainerConfig implements XYContainerConfigInterface<Datum> {
|
|
80
|
+
components: any[];
|
|
81
|
+
tooltip: Tooltip;
|
|
82
|
+
crosshair: Crosshair<Datum>;
|
|
83
|
+
xAxis: Axis<Datum>;
|
|
84
|
+
yAxis: Axis<Datum>;
|
|
85
|
+
autoMargin: boolean;
|
|
86
|
+
xScale: any;
|
|
87
|
+
xDomain: any;
|
|
88
|
+
xDomainMinConstraint: any;
|
|
89
|
+
xDomainMaxConstraint: any;
|
|
90
|
+
xRange: any;
|
|
91
|
+
yScale: any;
|
|
92
|
+
yDomain: any;
|
|
93
|
+
yDomainMinConstraint: any;
|
|
94
|
+
yDomainMaxConstraint: any;
|
|
95
|
+
yRange: any;
|
|
96
|
+
yDirection: Direction;
|
|
97
|
+
preventEmptyDomain: boolean;
|
|
98
|
+
scaleByDomain: boolean;
|
|
99
|
+
}
|