@unovis/ts 1.0.0-beta.0
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/.cache/.npm/_cacache/content-v2/sha512/61/45/6fe676782aa108257b260c25e8140c6d37bbc18450696066eeeb68af0ecc30da712b9d888ddf31844ec3334478f2b142f957298bebde9cba8de0ffc3c2d7 +0 -0
- package/.cache/.npm/_cacache/content-v2/sha512/c1/fd/5918e37e37c05cdfc4482fae30721b118c227a6b70b2830ff04cd62a82899a4ad1beaa562b4c673122c932c2eb017af2f4da3c8b7f9a0affbd1d926341a0 +0 -0
- package/.cache/.npm/_cacache/index-v5/1f/ac/9e290f9c0248c783167cd161d22fe850034423d1a425963bd64808710219 +3 -0
- package/LICENSE +193 -0
- 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 +103 -0
- package/components/area/index.js.map +1 -0
- package/components/area/style.d.ts +3 -0
- package/components/area/style.js +32 -0
- package/components/area/style.js.map +1 -0
- package/components/area/types.d.ts +6 -0
- package/components/axis/config.d.ts +74 -0
- package/components/axis/config.js +33 -0
- package/components/axis/config.js.map +1 -0
- package/components/axis/index.d.ts +51 -0
- package/components/axis/index.js +291 -0
- package/components/axis/index.js.map +1 -0
- package/components/axis/modules/tick.d.ts +5 -0
- package/components/axis/modules/tick.js +48 -0
- package/components/axis/modules/tick.js.map +1 -0
- package/components/axis/style.d.ts +9 -0
- package/components/axis/style.js +95 -0
- 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/components/brush/style.js +63 -0
- 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 +24 -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/components/bullet-legend/style.js +66 -0
- package/components/bullet-legend/style.js.map +1 -0
- package/components/bullet-legend/types.d.ts +7 -0
- package/components/chord-diagram/config.d.ts +42 -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 +49 -0
- package/components/chord-diagram/index.js +280 -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 +128 -0
- package/components/chord-diagram/modules/label.js.map +1 -0
- package/components/chord-diagram/modules/link.d.ts +20 -0
- package/components/chord-diagram/modules/link.js +32 -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/components/chord-diagram/style.js +88 -0
- package/components/chord-diagram/style.js.map +1 -0
- package/components/chord-diagram/types.d.ts +40 -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 +180 -0
- package/components/crosshair/index.js.map +1 -0
- package/components/crosshair/style.d.ts +4 -0
- package/components/crosshair/style.js +25 -0
- package/components/crosshair/style.js.map +1 -0
- package/components/crosshair/types.d.ts +13 -0
- package/components/donut/config.d.ts +45 -0
- package/components/donut/config.js +25 -0
- package/components/donut/config.js.map +1 -0
- package/components/donut/index.d.ts +20 -0
- package/components/donut/index.js +84 -0
- package/components/donut/index.js.map +1 -0
- package/components/donut/modules/arc.d.ts +10 -0
- package/components/donut/modules/arc.js +53 -0
- package/components/donut/modules/arc.js.map +1 -0
- package/components/donut/style.d.ts +6 -0
- package/components/donut/style.js +53 -0
- package/components/donut/style.js.map +1 -0
- package/components/donut/types.d.ts +12 -0
- package/components/flow-legend/config.d.ts +26 -0
- package/components/flow-legend/config.js +17 -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 +73 -0
- package/components/flow-legend/index.js.map +1 -0
- package/components/flow-legend/style.d.ts +8 -0
- package/components/flow-legend/style.js +80 -0
- 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 +191 -0
- package/components/free-brush/index.js.map +1 -0
- package/components/free-brush/style.d.ts +4 -0
- package/components/free-brush/style.js +50 -0
- 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 +207 -0
- package/components/graph/config.js +75 -0
- package/components/graph/config.js.map +1 -0
- package/components/graph/index.d.ts +121 -0
- package/components/graph/index.js +653 -0
- package/components/graph/index.js.map +1 -0
- package/components/graph/modules/layout-helpers.d.ts +2 -0
- package/components/graph/modules/layout-helpers.js +11 -0
- package/components/graph/modules/layout-helpers.js.map +1 -0
- package/components/graph/modules/layout.d.ts +9 -0
- package/components/graph/modules/layout.js +343 -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 +78 -0
- package/components/graph/modules/link/helper.js.map +1 -0
- package/components/graph/modules/link/index.d.ts +12 -0
- package/components/graph/modules/link/index.js +201 -0
- package/components/graph/modules/link/index.js.map +1 -0
- package/components/graph/modules/link/style.d.ts +15 -0
- package/components/graph/modules/link/style.js +112 -0
- 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 +127 -0
- package/components/graph/modules/node/helper.js.map +1 -0
- package/components/graph/modules/node/index.d.ts +12 -0
- package/components/graph/modules/node/index.js +248 -0
- package/components/graph/modules/node/index.js.map +1 -0
- package/components/graph/modules/node/style.d.ts +24 -0
- package/components/graph/modules/node/style.js +273 -0
- package/components/graph/modules/node/style.js.map +1 -0
- package/components/graph/modules/panel/helper.d.ts +16 -0
- package/components/graph/modules/panel/helper.js +110 -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 +103 -0
- package/components/graph/modules/panel/index.js.map +1 -0
- package/components/graph/modules/panel/style.d.ts +14 -0
- package/components/graph/modules/panel/style.js +123 -0
- package/components/graph/modules/panel/style.js.map +1 -0
- package/components/graph/modules/shape.d.ts +7 -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 +120 -0
- package/components/graph/types.js +29 -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 +30 -0
- package/components/grouped-bar/index.js +231 -0
- package/components/grouped-bar/index.js.map +1 -0
- package/components/grouped-bar/style.d.ts +5 -0
- package/components/grouped-bar/style.js +36 -0
- 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 +51 -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/components/leaflet-flow-map/shaders.js +27 -0
- 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 +175 -0
- package/components/leaflet-map/config.js +67 -0
- package/components/leaflet-map/config.js.map +1 -0
- package/components/leaflet-map/index.d.ts +95 -0
- package/components/leaflet-map/index.js +648 -0
- package/components/leaflet-map/index.js.map +1 -0
- package/components/leaflet-map/leaflet.css.js +4 -0
- package/components/leaflet-map/leaflet.css.js.map +1 -0
- package/components/leaflet-map/modules/clusterBackground.d.ts +4 -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 +13 -0
- package/components/leaflet-map/modules/map.js +139 -0
- package/components/leaflet-map/modules/map.js.map +1 -0
- package/components/leaflet-map/modules/node.d.ts +8 -0
- package/components/leaflet-map/modules/node.js +148 -0
- package/components/leaflet-map/modules/node.js.map +1 -0
- package/components/leaflet-map/modules/selectionRing.d.ts +6 -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 +49 -0
- package/components/leaflet-map/modules/utils.js +207 -0
- package/components/leaflet-map/modules/utils.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 +4987 -0
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +7 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.js +28 -0
- package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +5 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.js +39 -0
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -0
- package/components/leaflet-map/style.d.ts +19 -0
- package/components/leaflet-map/style.js +192 -0
- package/components/leaflet-map/style.js.map +1 -0
- package/components/leaflet-map/types.d.ts +70 -0
- package/components/leaflet-map/types.js +10 -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 +139 -0
- package/components/line/index.js.map +1 -0
- package/components/line/style.d.ts +6 -0
- package/components/line/style.js +35 -0
- package/components/line/style.js.map +1 -0
- package/components/line/types.d.ts +12 -0
- package/components/radial-dendrogram/config.d.ts +34 -0
- package/components/radial-dendrogram/config.js +20 -0
- package/components/radial-dendrogram/config.js.map +1 -0
- package/components/radial-dendrogram/index.d.ts +22 -0
- package/components/radial-dendrogram/index.js +98 -0
- package/components/radial-dendrogram/index.js.map +1 -0
- package/components/radial-dendrogram/modules/label.d.ts +8 -0
- package/components/radial-dendrogram/modules/label.js +70 -0
- package/components/radial-dendrogram/modules/label.js.map +1 -0
- package/components/radial-dendrogram/modules/link.d.ts +19 -0
- package/components/radial-dendrogram/modules/link.js +59 -0
- package/components/radial-dendrogram/modules/link.js.map +1 -0
- package/components/radial-dendrogram/modules/node.d.ts +16 -0
- package/components/radial-dendrogram/modules/node.js +51 -0
- package/components/radial-dendrogram/modules/node.js.map +1 -0
- package/components/radial-dendrogram/style.d.ts +6 -0
- package/components/radial-dendrogram/style.js +54 -0
- package/components/radial-dendrogram/style.js.map +1 -0
- package/components/radial-dendrogram/types.d.ts +34 -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 +56 -0
- package/components/sankey/index.js +299 -0
- package/components/sankey/index.js.map +1 -0
- package/components/sankey/modules/label.d.ts +23 -0
- package/components/sankey/modules/label.js +164 -0
- package/components/sankey/modules/label.js.map +1 -0
- package/components/sankey/modules/link.d.ts +13 -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/components/sankey/style.js +164 -0
- 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 +19 -0
- package/components/scatter/index.js +123 -0
- package/components/scatter/index.js.map +1 -0
- package/components/scatter/modules/point.d.ts +7 -0
- package/components/scatter/modules/point.js +98 -0
- package/components/scatter/modules/point.js.map +1 -0
- package/components/scatter/style.d.ts +5 -0
- package/components/scatter/style.js +53 -0
- package/components/scatter/style.js.map +1 -0
- package/components/scatter/types.d.ts +13 -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 +27 -0
- package/components/stacked-bar/index.js +193 -0
- package/components/stacked-bar/index.js.map +1 -0
- package/components/stacked-bar/style.d.ts +5 -0
- package/components/stacked-bar/style.js +36 -0
- 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 +23 -0
- package/components/timeline/config.js.map +1 -0
- package/components/timeline/index.d.ts +43 -0
- package/components/timeline/index.js +235 -0
- package/components/timeline/index.js.map +1 -0
- package/components/timeline/style.d.ts +12 -0
- package/components/timeline/style.js +86 -0
- package/components/timeline/style.js.map +1 -0
- package/components/tooltip/config.d.ts +46 -0
- package/components/tooltip/config.js +19 -0
- package/components/tooltip/config.js.map +1 -0
- package/components/tooltip/index.d.ts +34 -0
- package/components/tooltip/index.js +147 -0
- package/components/tooltip/index.js.map +1 -0
- package/components/tooltip/style.js +72 -0
- 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/components/topojson-map/style.js +97 -0
- package/components/topojson-map/style.js.map +1 -0
- package/components/topojson-map/types.d.ts +48 -0
- package/components/topojson-map/types.js +45 -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/components/vis-controls/style.js +75 -0
- 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 +86 -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 +105 -0
- package/components/xy-labels/modules/label.js.map +1 -0
- package/components/xy-labels/style.d.ts +5 -0
- package/components/xy-labels/style.js +53 -0
- 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 +52 -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 +17 -0
- package/containers/single-container/index.js +115 -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 +33 -0
- package/containers/xy-container/index.js +322 -0
- package/containers/xy-container/index.js.map +1 -0
- package/containers.d.ts +6 -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 +38 -0
- package/core/component/index.js +112 -0
- package/core/component/index.js.map +1 -0
- package/core/component/types.d.ts +2 -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 +38 -0
- package/core/container/config.js +29 -0
- package/core/container/config.js.map +1 -0
- package/core/container/index.d.ts +25 -0
- package/core/container/index.js +92 -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 +25 -0
- package/core/xy-component/index.js +65 -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 +101 -0
- package/data-models/graph.js.map +1 -0
- package/data-models/map-graph.d.ts +23 -0
- package/data-models/map-graph.js +59 -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/external/maplibre-gl/dist/maplibre-gl.css.js +4 -0
- package/external/maplibre-gl/dist/maplibre-gl.css.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.js +49 -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 +61 -0
- package/styles/colors.d.ts +4 -0
- package/styles/colors.js +11 -0
- package/styles/colors.js.map +1 -0
- package/styles/css-variables.d.ts +2 -0
- package/styles/css-variables.js +16 -0
- package/styles/css-variables.js.map +1 -0
- package/types/accessor.d.ts +5 -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/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/map.d.ts +4 -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/symbol.d.ts +18 -0
- package/types/symbol.js +24 -0
- package/types/symbol.js.map +1 -0
- package/types/text.d.ts +38 -0
- package/types/text.js +31 -0
- package/types/text.js.map +1 -0
- package/types.d.ts +28 -0
- package/utils/color.d.ts +9 -0
- package/utils/color.js +26 -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 +123 -0
- package/utils/data.js +193 -0
- package/utils/data.js.map +1 -0
- package/utils/html.d.ts +1 -0
- package/utils/html.js +15 -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 +16 -0
- package/utils/misc.js +42 -0
- package/utils/misc.js.map +1 -0
- package/utils/path.d.ts +21 -0
- package/utils/path.js +144 -0
- package/utils/path.js.map +1 -0
- package/utils/scale.d.ts +1 -0
- package/utils/text.d.ts +17 -0
- package/utils/text.js +196 -0
- package/utils/text.js.map +1 -0
package/utils/misc.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isString } from './data.js';
|
|
2
|
+
|
|
3
|
+
const getBoundingClientRectObject = (element) => {
|
|
4
|
+
const { top, right, bottom, left, width, height, x, y } = element.getBoundingClientRect();
|
|
5
|
+
return { top, right, bottom, left, width, height, x, y };
|
|
6
|
+
};
|
|
7
|
+
function guid() {
|
|
8
|
+
const s4 = () => Math.floor((1 + Math.random()) * 0x10000)
|
|
9
|
+
.toString(16)
|
|
10
|
+
.substring(1);
|
|
11
|
+
return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;
|
|
12
|
+
}
|
|
13
|
+
function stringToHtmlId(str) {
|
|
14
|
+
return (str || '').replace(/\W/g, '_');
|
|
15
|
+
}
|
|
16
|
+
function isStringCSSVariable(s) {
|
|
17
|
+
return isString(s) ? (s.substring(0, 6) === 'var(--') : false;
|
|
18
|
+
}
|
|
19
|
+
function getCSSVariableValue(s, context) {
|
|
20
|
+
if (!isString(s))
|
|
21
|
+
return '';
|
|
22
|
+
const variableName = s.substr(4, s.length - 5);
|
|
23
|
+
return getComputedStyle(context).getPropertyValue(variableName);
|
|
24
|
+
}
|
|
25
|
+
function rectIntersect(rect1, rect2, tolerance = 0) {
|
|
26
|
+
const [left1, top1, right1, bottom1] = [
|
|
27
|
+
rect1.x + tolerance,
|
|
28
|
+
rect1.y + rect1.height - 2 * tolerance,
|
|
29
|
+
rect1.x + rect1.width - 2 * tolerance,
|
|
30
|
+
rect1.y + tolerance,
|
|
31
|
+
];
|
|
32
|
+
const [left2, top2, right2, bottom2] = [
|
|
33
|
+
rect2.x + tolerance,
|
|
34
|
+
rect2.y + rect2.height - 2 * tolerance,
|
|
35
|
+
rect2.x + rect2.width - 2 * tolerance,
|
|
36
|
+
rect2.y + tolerance,
|
|
37
|
+
];
|
|
38
|
+
return !(top1 < bottom2 || top2 < bottom1 || right1 < left2 || right2 < left1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { getBoundingClientRectObject, getCSSVariableValue, guid, isStringCSSVariable, rectIntersect, stringToHtmlId };
|
|
42
|
+
//# sourceMappingURL=misc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"misc.js","sources":["../../src/utils/misc.ts"],"sourcesContent":["import { Rect } from 'types/misc'\nimport { isString } from 'utils/data'\n\nexport const getBoundingClientRectObject = (element: HTMLElement):\n{ top: number; right: number; bottom: number; left: number; width: number; height: number; x: number; y: number } => {\n const { top, right, bottom, left, width, height, x, y } = element.getBoundingClientRect()\n return { top, right, bottom, left, width, height, x, y }\n}\n\nexport function guid (): string {\n const s4 = (): string =>\n Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1)\n\n return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`\n}\n\nexport function stringToHtmlId (str: string): string {\n return (str || '').replace(/\\W/g, '_')\n}\n\nexport function isStringCSSVariable (s: string): boolean {\n return isString(s) ? (s.substring(0, 6) === 'var(--') : false\n}\n\nexport function getCSSVariableValue (s: string, context: HTMLElement | SVGGElement): string {\n if (!isString(s)) return ''\n const variableName = s.substr(4, s.length - 5)\n return getComputedStyle(context).getPropertyValue(variableName)\n}\n\nexport function rectIntersect (rect1: Rect, rect2: Rect, tolerance = 0): boolean {\n const [left1, top1, right1, bottom1] = [\n rect1.x + tolerance,\n rect1.y + rect1.height - 2 * tolerance,\n rect1.x + rect1.width - 2 * tolerance,\n rect1.y + tolerance,\n ]\n const [left2, top2, right2, bottom2] = [\n rect2.x + tolerance,\n rect2.y + rect2.height - 2 * tolerance,\n rect2.x + rect2.width - 2 * tolerance,\n rect2.y + tolerance,\n ]\n\n return !(top1 < bottom2 || top2 < bottom1 || right1 < left2 || right2 < left1)\n}\n"],"names":[],"mappings":";;AAGa,MAAA,2BAA2B,GAAG,CAAC,OAAoB,KACoD;IAClH,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAA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AC,CAAC,CAAA;IAC9C,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAA;AACjE,CAAC;AAEK,SAAU,aAAa,CAAE,KAAW,EAAE,KAAW,EAAE,SAAS,GAAG,CAAC,EAAA;IACpE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG;QACrC,KAAK,CAAC,CAAC,GAAG,SAAS;QACnB,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,SAAS;QACtC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,SAAS;QACrC,KAAK,CAAC,CAAC,GAAG,SAAS;KACpB,CAAA;IACD,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG;QACrC,KAAK,CAAC,CAAC,GAAG,SAAS;QACnB,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,SAAS;QACtC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,SAAS;QACrC,KAAK,CAAC,CAAC,GAAG,SAAS;KACpB,CAAA;AAED,IAAA,OAAO,EAAE,IAAI,GAAG,OAAO,IAAI,IAAI,GAAG,OAAO,IAAI,MAAM,GAAG,KAAK,IAAI,MAAM,GAAG,KAAK,CAAC,CAAA;AAChF;;;;"}
|
package/utils/path.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare function roundedRectPath({ x, y, w, h, tl, tr, bl, br, r }: {
|
|
2
|
+
x: any;
|
|
3
|
+
y: any;
|
|
4
|
+
w: any;
|
|
5
|
+
h: any;
|
|
6
|
+
tl?: boolean;
|
|
7
|
+
tr?: boolean;
|
|
8
|
+
bl?: boolean;
|
|
9
|
+
br?: boolean;
|
|
10
|
+
r?: number;
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function polygon(size: number, n?: number, endAngle?: number, open?: boolean): string;
|
|
13
|
+
export declare function circlePath(cx: number, cy: number, r: number): string;
|
|
14
|
+
export declare function scoreRectPath({ x, y, w, h, r, score }: {
|
|
15
|
+
x: any;
|
|
16
|
+
y: any;
|
|
17
|
+
w: any;
|
|
18
|
+
h: any;
|
|
19
|
+
r?: number;
|
|
20
|
+
score?: number;
|
|
21
|
+
}): string;
|
package/utils/path.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { range, min, max } from 'd3-array';
|
|
2
|
+
import { line, curveCardinal, curveCardinalClosed } from 'd3-shape';
|
|
3
|
+
import { clamp } from './data.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Generate SVG path for rectangle with rounded corners
|
|
7
|
+
*
|
|
8
|
+
* @param {Object} props - Configuration object
|
|
9
|
+
* @param {Number} props.x - Rect top left X coordinate
|
|
10
|
+
* @param {Number} props.y - Rect top left Y coordinate
|
|
11
|
+
* @param {Number} props.w - Rect width
|
|
12
|
+
* @param {Number} props.h - Rect height
|
|
13
|
+
* @param {Bool} [props.tl=false] - Round top left corner
|
|
14
|
+
* @param {Bool} [props.tr=false] - Round top right corner
|
|
15
|
+
* @param {Bool} [props.bl=false] - Round bottom left corner
|
|
16
|
+
* @param {Bool} [props.br=false] - Round bottom right corner
|
|
17
|
+
* @param {Number} [props.r=0] - Corner Radius
|
|
18
|
+
* @return {String} Path string for the `d` attribute
|
|
19
|
+
*/
|
|
20
|
+
function roundedRectPath({ x, y, w, h, tl = false, tr = false, bl = false, br = false, r = 0 }) {
|
|
21
|
+
let path;
|
|
22
|
+
path = `M${x + r},${y}h${w - 2 * r}`;
|
|
23
|
+
let roundedR = tr ? r : 0;
|
|
24
|
+
let angularR = tr ? 0 : r;
|
|
25
|
+
path += `a${roundedR},${roundedR} 0 0 1 ${roundedR},${roundedR}`;
|
|
26
|
+
path += `h${angularR}v${angularR}`;
|
|
27
|
+
path += `v${h - 2 * r}`;
|
|
28
|
+
roundedR = br ? r : 0;
|
|
29
|
+
angularR = br ? 0 : r;
|
|
30
|
+
path += `a${roundedR},${roundedR} 0 0 1 ${-roundedR},${roundedR}`;
|
|
31
|
+
path += `v${angularR}h${-angularR}`;
|
|
32
|
+
path += `h${2 * r - w}`;
|
|
33
|
+
roundedR = bl ? r : 0;
|
|
34
|
+
angularR = bl ? 0 : r;
|
|
35
|
+
path += `a${roundedR},${roundedR} 0 0 1 ${-roundedR},${-roundedR}`;
|
|
36
|
+
path += `h${-angularR}v${-angularR}`;
|
|
37
|
+
path += `v${2 * r - h}`;
|
|
38
|
+
roundedR = tl ? r : 0;
|
|
39
|
+
angularR = tl ? 0 : r;
|
|
40
|
+
path += `a${roundedR},${roundedR} 0 0 1 ${roundedR},${-roundedR}`;
|
|
41
|
+
path += `v${-angularR}h${angularR}`;
|
|
42
|
+
path += 'z';
|
|
43
|
+
return path;
|
|
44
|
+
}
|
|
45
|
+
function polygon(size, n = 6, endAngle = 2 * Math.PI, open = false) {
|
|
46
|
+
const r = n === 4 ? Math.sqrt(0.5) * size : size / 3.6 * 2;
|
|
47
|
+
const deltaAngle = n === 4 ? Math.PI / 4 : 0; // rotate to 45 grads if shape is a rectangle
|
|
48
|
+
const shiftedEndAngle = endAngle - deltaAngle;
|
|
49
|
+
const completion = (shiftedEndAngle < 0 ? endAngle : shiftedEndAngle) / (2 * Math.PI);
|
|
50
|
+
const nSegments = Math.ceil(n * completion);
|
|
51
|
+
const centerAngle = 1 / n * Math.PI * 2; // /\
|
|
52
|
+
const baseAngle = (Math.PI - centerAngle) / 2; // /__\
|
|
53
|
+
const data = range(nSegments + (shiftedEndAngle >= 0 ? 1 : 0))
|
|
54
|
+
.map((d, i) => {
|
|
55
|
+
const isLastSegment = i === nSegments || (nSegments === 1 && shiftedEndAngle < 0);
|
|
56
|
+
let mult = isLastSegment ? ((completion * n) % 1 || 1) : 1; // Handle partial shape
|
|
57
|
+
if (shiftedEndAngle < 0) {
|
|
58
|
+
mult += 0.5;
|
|
59
|
+
}
|
|
60
|
+
const angle = centerAngle * (i - 1 + mult);
|
|
61
|
+
let radius;
|
|
62
|
+
if (isLastSegment) {
|
|
63
|
+
const thirdAngle = Math.PI - baseAngle - centerAngle * mult;
|
|
64
|
+
radius = r * Math.sin(baseAngle) / Math.sin(thirdAngle); // Law of sines
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
radius = r;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
x: Math.sin(angle + deltaAngle) * radius,
|
|
71
|
+
y: -Math.cos(angle + deltaAngle) * radius,
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
if (n === 4) {
|
|
75
|
+
const angle = centerAngle * (-1 + 0.5);
|
|
76
|
+
const thirdAngle = Math.PI * 0.5;
|
|
77
|
+
const radius = r * Math.sin(baseAngle) / Math.sin(thirdAngle); // Law of sines
|
|
78
|
+
data.unshift({
|
|
79
|
+
x: Math.sin(angle + deltaAngle) * radius,
|
|
80
|
+
y: -Math.cos(angle + deltaAngle) * radius,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const path = line()
|
|
84
|
+
/* eslint-disable-next-line dot-notation */
|
|
85
|
+
.x(d => d['x'])
|
|
86
|
+
/* eslint-disable-next-line dot-notation */
|
|
87
|
+
.y(d => d['y'])
|
|
88
|
+
.curve((open ? curveCardinal : curveCardinalClosed).tension(0.95));
|
|
89
|
+
return path(data);
|
|
90
|
+
}
|
|
91
|
+
function circlePath(cx, cy, r) {
|
|
92
|
+
return `
|
|
93
|
+
M ${cx} ${cy}
|
|
94
|
+
m ${-r}, 0
|
|
95
|
+
a ${r},${r} 0 1,1 ${r * 2},0
|
|
96
|
+
a ${r},${r} 0 1,1 ${-r * 2},0`;
|
|
97
|
+
}
|
|
98
|
+
function scoreRectPath({ x, y, w, h, r = 0, score = 1 }) {
|
|
99
|
+
let path;
|
|
100
|
+
const side = 1 / 4;
|
|
101
|
+
const halfSide = side / 2;
|
|
102
|
+
let part = score;
|
|
103
|
+
// 8 1
|
|
104
|
+
// - -
|
|
105
|
+
// 7 | | 2
|
|
106
|
+
// 6 | | 3
|
|
107
|
+
// - -
|
|
108
|
+
// 5 4
|
|
109
|
+
// 1
|
|
110
|
+
const hLength = min([w * 0.5 * (part / halfSide) + r, w * 0.5 - r]);
|
|
111
|
+
path = `M${x + w * 0.5},${y}h${hLength}`;
|
|
112
|
+
// 2, 3
|
|
113
|
+
part = score - 1 / 8;
|
|
114
|
+
if (part > 0) {
|
|
115
|
+
path += `a${r},${r} 0 0 1 ${r},${r}`;
|
|
116
|
+
const vLength = clamp(h * (part / side) - r, 0, h - 2 * r);
|
|
117
|
+
path += `v${vLength}`;
|
|
118
|
+
}
|
|
119
|
+
// 4, 5
|
|
120
|
+
part = score - 3 / 8;
|
|
121
|
+
if (part > 0) {
|
|
122
|
+
path += `a${r},${r} 0 0 1 ${-r},${r}`;
|
|
123
|
+
const hLength = clamp(r - w * (part / side), 2 * r - w, 0);
|
|
124
|
+
path += `h${hLength}`;
|
|
125
|
+
}
|
|
126
|
+
// 6, 7
|
|
127
|
+
part = score - 5 / 8;
|
|
128
|
+
if (part > 0) {
|
|
129
|
+
path += `a${r},${r} 0 0 1 ${-r},${-r}`;
|
|
130
|
+
const vLength = clamp(r - h * (part / side), 2 * r - h, 0);
|
|
131
|
+
path += `v${vLength}`;
|
|
132
|
+
}
|
|
133
|
+
// 8
|
|
134
|
+
part = score - 7 / 8;
|
|
135
|
+
if (part > 0) {
|
|
136
|
+
path += `a${r},${r} 0 0 1 ${r},${-r}`;
|
|
137
|
+
const hLength = max([w * 0.5 * (part / halfSide) - r, 0]);
|
|
138
|
+
path += `h${hLength}`;
|
|
139
|
+
}
|
|
140
|
+
return path;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export { circlePath, polygon, roundedRectPath, scoreRectPath };
|
|
144
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.js","sources":["../../src/utils/path.ts"],"sourcesContent":["import { range, min, max } from 'd3-array'\nimport { line, curveCardinal, curveCardinalClosed } from 'd3-shape'\n\n// Utils\nimport { clamp } from 'utils/data'\n/*\n * Generate SVG path for rectangle with rounded corners\n *\n * @param {Object} props - Configuration object\n * @param {Number} props.x - Rect top left X coordinate\n * @param {Number} props.y - Rect top left Y coordinate\n * @param {Number} props.w - Rect width\n * @param {Number} props.h - Rect height\n * @param {Bool} [props.tl=false] - Round top left corner\n * @param {Bool} [props.tr=false] - Round top right corner\n * @param {Bool} [props.bl=false] - Round bottom left corner\n * @param {Bool} [props.br=false] - Round bottom right corner\n * @param {Number} [props.r=0] - Corner Radius\n * @return {String} Path string for the `d` attribute\n */\nexport function roundedRectPath ({ x, y, w, h, tl = false, tr = false, bl = false, br = false, r = 0 }): string {\n let path\n path = `M${x + r},${y}h${w - 2 * r}`\n\n let roundedR = tr ? r : 0\n let angularR = tr ? 0 : r\n path += `a${roundedR},${roundedR} 0 0 1 ${roundedR},${roundedR}`\n path += `h${angularR}v${angularR}`\n path += `v${h - 2 * r}`\n\n roundedR = br ? r : 0\n angularR = br ? 0 : r\n path += `a${roundedR},${roundedR} 0 0 1 ${-roundedR},${roundedR}`\n path += `v${angularR}h${-angularR}`\n path += `h${2 * r - w}`\n\n roundedR = bl ? r : 0\n angularR = bl ? 0 : r\n path += `a${roundedR},${roundedR} 0 0 1 ${-roundedR},${-roundedR}`\n path += `h${-angularR}v${-angularR}`\n path += `v${2 * r - h}`\n\n roundedR = tl ? r : 0\n angularR = tl ? 0 : r\n path += `a${roundedR},${roundedR} 0 0 1 ${roundedR},${-roundedR}`\n path += `v${-angularR}h${angularR}`\n\n path += 'z'\n return path\n}\n\nexport function polygon (size: number, n = 6, endAngle = 2 * Math.PI, open = false): string {\n const r = n === 4 ? Math.sqrt(0.5) * size : size / 3.6 * 2\n const deltaAngle = n === 4 ? Math.PI / 4 : 0 // rotate to 45 grads if shape is a rectangle\n const shiftedEndAngle = endAngle - deltaAngle\n\n const completion = (shiftedEndAngle < 0 ? endAngle : shiftedEndAngle) / (2 * Math.PI)\n const nSegments = Math.ceil(n * completion)\n\n const centerAngle = 1 / n * Math.PI * 2 // /\\\n const baseAngle = (Math.PI - centerAngle) / 2 // /__\\\n\n const data = range(nSegments + (shiftedEndAngle >= 0 ? 1 : 0))\n .map((d, i) => {\n const isLastSegment = i === nSegments || (nSegments === 1 && shiftedEndAngle < 0)\n let mult = isLastSegment ? ((completion * n) % 1 || 1) : 1 // Handle partial shape\n if (shiftedEndAngle < 0) {\n mult += 0.5\n }\n const angle = centerAngle * (i - 1 + mult)\n\n let radius\n if (isLastSegment) {\n const thirdAngle = Math.PI - baseAngle - centerAngle * mult\n radius = r * Math.sin(baseAngle) / Math.sin(thirdAngle) // Law of sines\n } else {\n radius = r\n }\n\n return {\n x: Math.sin(angle + deltaAngle) * radius,\n y: -Math.cos(angle + deltaAngle) * radius,\n }\n })\n\n if (n === 4) {\n const angle = centerAngle * (-1 + 0.5)\n const thirdAngle = Math.PI * 0.5\n const radius = r * Math.sin(baseAngle) / Math.sin(thirdAngle) // Law of sines\n data.unshift({\n x: Math.sin(angle + deltaAngle) * radius,\n y: -Math.cos(angle + deltaAngle) * radius,\n })\n }\n\n const path = line<any>()\n /* eslint-disable-next-line dot-notation */\n .x(d => d['x'])\n /* eslint-disable-next-line dot-notation */\n .y(d => d['y'])\n .curve((open ? curveCardinal : curveCardinalClosed).tension(0.95))\n\n return path(data)\n}\n\nexport function circlePath (cx: number, cy: number, r: number): string {\n return `\n M ${cx} ${cy}\n m ${-r}, 0\n a ${r},${r} 0 1,1 ${r * 2},0\n a ${r},${r} 0 1,1 ${-r * 2},0`\n}\n\nexport function scoreRectPath ({ x, y, w, h, r = 0, score = 1 }): string {\n let path\n const side = 1 / 4\n const halfSide = side / 2\n let part = score\n\n // 8 1\n // - -\n // 7 | | 2\n // 6 | | 3\n // - -\n // 5 4\n\n // 1\n const hLength = min([w * 0.5 * (part / halfSide) + r, w * 0.5 - r])\n path = `M${x + w * 0.5},${y}h${hLength}`\n\n // 2, 3\n part = score - 1 / 8\n if (part > 0) {\n path += `a${r},${r} 0 0 1 ${r},${r}`\n const vLength = clamp(h * (part / side) - r, 0, h - 2 * r)\n path += `v${vLength}`\n }\n\n // 4, 5\n part = score - 3 / 8\n if (part > 0) {\n path += `a${r},${r} 0 0 1 ${-r},${r}`\n const hLength = clamp(r - w * (part / side), 2 * r - w, 0)\n path += `h${hLength}`\n }\n\n // 6, 7\n part = score - 5 / 8\n if (part > 0) {\n path += `a${r},${r} 0 0 1 ${-r},${-r}`\n const vLength = clamp(r - h * (part / side), 2 * r - h, 0)\n path += `v${vLength}`\n }\n\n // 8\n part = score - 7 / 8\n if (part > 0) {\n path += `a${r},${r} 0 0 1 ${r},${-r}`\n const hLength = max([w * 0.5 * (part / halfSide) - r, 0])\n path += `h${hLength}`\n }\n\n return path\n}\n"],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;AAcG;AACa,SAAA,eAAe,CAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,EAAA;AACpG,IAAA,IAAI,IAAI,CAAA;AACR,IAAA,IAAI,GAAG,CAAA,CAAA,EAAI,CAAC,GAAG,CAAC,CAAI,CAAA,EAAA,CAAC,CAAI,CAAA,EAAA,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAA;IAEpC,IAAI,QAAQ,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;IACzB,IAAI,QAAQ,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;IACzB,IAAI,IAAI,CAAI,CAAA,EAAA,QAAQ,CAAI,CAAA,EAAA,QAAQ,UAAU,QAAQ,CAAA,CAAA,EAAI,QAAQ,CAAA,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,CAAI,CAAA,EAAA,CAAC,CAAC,CAAA,CAAE,CAAA;QACtC,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;AAC1D,QAAA,IAAI,IAAI,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE,CAAA;AACtB,KAAA;;AAGD,IAAA,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAA;IACpB,IAAI,IAAI,GAAG,CAAC,EAAE;QACZ,IAAI,IAAI,CAAI,CAAA,EAAA,CAAC,CAAI,CAAA,EAAA,CAAC,CAAU,OAAA,EAAA,CAAC,CAAI,CAAA,EAAA,CAAC,CAAC,CAAA,CAAE,CAAA;QACrC,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACzD,QAAA,IAAI,IAAI,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE,CAAA;AACtB,KAAA;AAED,IAAA,OAAO,IAAI,CAAA;AACb;;;;"}
|
package/utils/scale.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DefaultRange: number[];
|
package/utils/text.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Selection } from 'd3-selection';
|
|
2
|
+
import { TrimMode, WrapTextOptions } from "../types/text";
|
|
3
|
+
export declare function trimTextStart(str?: string, maxLength?: number): string;
|
|
4
|
+
export declare function trimTextMiddle(str?: string, maxLength?: number): string;
|
|
5
|
+
export declare function trimTextEnd(str?: string, maxLength?: number): string;
|
|
6
|
+
export declare function trimText(str?: string, length?: number, type?: TrimMode): string;
|
|
7
|
+
export declare function trimSVGTextToPixel(svgTextSelection: Selection<SVGTextElement, any, SVGElement, any>, minWidth?: number, trimType?: TrimMode): void;
|
|
8
|
+
export declare function breakTspan(tspan: Selection<SVGTSpanElement, any, SVGElement, any>, width: number, word?: string): string;
|
|
9
|
+
export declare function splitString(text: string, separators?: string[]): string[];
|
|
10
|
+
export declare function wrapTextElement(element: Selection<SVGTextElement, any, SVGElement, any>, options: WrapTextOptions): void;
|
|
11
|
+
export declare function cutString(str: string, renderedWidth: number, maxWidth: number): [string, string];
|
|
12
|
+
export declare function wrapSVGText(textElement: Selection<SVGTextElement, any, SVGElement, any>, options: WrapTextOptions): void;
|
|
13
|
+
export declare function trimSVGText(svgTextSelection: Selection<SVGTextElement, any, SVGElement, any>, maxWidth?: number, trimType?: TrimMode, fastMode?: boolean, fontSize?: number, widthToHeightRatio?: number): boolean;
|
|
14
|
+
export declare function estimateTextSize(svgTextSelection: Selection<SVGTextElement, any, SVGElement, any>, fontSize: number, dy?: number, fastMode?: boolean, widthToHeightRatio?: number): {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
package/utils/text.js
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { TrimMode, VerticalAlign, WrapMode } from '../types/text.js';
|
|
2
|
+
import { isArray, flatten } from './data.js';
|
|
3
|
+
|
|
4
|
+
// Types
|
|
5
|
+
function trimTextStart(str = '', maxLength = 15) {
|
|
6
|
+
return str.length > maxLength ? `…${str.substr(0, maxLength)}` : str;
|
|
7
|
+
}
|
|
8
|
+
function trimTextMiddle(str = '', maxLength = 15) {
|
|
9
|
+
const dist = Math.floor((maxLength - 3) / 2);
|
|
10
|
+
return str.length > maxLength ? `${str.substr(0, dist)}…${str.substr(-dist, dist)}` : str;
|
|
11
|
+
}
|
|
12
|
+
function trimTextEnd(str = '', maxLength = 15) {
|
|
13
|
+
return str.length > maxLength ? `${str.substr(0, maxLength)}…` : str;
|
|
14
|
+
}
|
|
15
|
+
function trimText(str = '', length = 15, type = TrimMode.Middle) {
|
|
16
|
+
let result = trimTextEnd(str, length);
|
|
17
|
+
if (type === TrimMode.Start)
|
|
18
|
+
result = trimTextStart(str, length);
|
|
19
|
+
else if (type === TrimMode.Middle)
|
|
20
|
+
result = trimTextMiddle(str, length);
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
function trimSVGTextToPixel(svgTextSelection, minWidth = 50, trimType = TrimMode.Middle) {
|
|
24
|
+
let i = 0;
|
|
25
|
+
let textBBox = svgTextSelection.node().getBBox();
|
|
26
|
+
const text = svgTextSelection.text();
|
|
27
|
+
let textLength = text.length;
|
|
28
|
+
while (textBBox.width > minWidth && textLength > 0) {
|
|
29
|
+
textLength -= 1;
|
|
30
|
+
svgTextSelection.text(trimText(text, text.length - i, trimType));
|
|
31
|
+
i = i + 1;
|
|
32
|
+
textBBox = svgTextSelection.node().getBBox();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function breakTspan(tspan, width, word = '') {
|
|
36
|
+
const tspanText = tspan.text();
|
|
37
|
+
const coeff = width / tspan.node().getComputedTextLength();
|
|
38
|
+
if (coeff < 1) {
|
|
39
|
+
const cutIndex = Math.floor(coeff * tspanText.length) || 1;
|
|
40
|
+
const head = tspanText.substr(0, cutIndex);
|
|
41
|
+
const tail = tspanText.substr(cutIndex, tspanText.length);
|
|
42
|
+
tspan.text(head);
|
|
43
|
+
return `${tail}${word}`;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return word;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function splitString(text, separators = [' ']) {
|
|
50
|
+
let result = [text];
|
|
51
|
+
for (let i = 0; i < separators.length; i++) {
|
|
52
|
+
const sep = separators[i];
|
|
53
|
+
result.forEach((d, id) => {
|
|
54
|
+
const separated = d.split(sep);
|
|
55
|
+
const words = separated.map((word, j) => `${word}${j === separated.length - 1 ? '' : sep}`);
|
|
56
|
+
// result.splice(i, 0, ...words)
|
|
57
|
+
result[id] = words;
|
|
58
|
+
});
|
|
59
|
+
result = flatten(result);
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
function wrapTextElement(element, options) {
|
|
64
|
+
let text = element.text();
|
|
65
|
+
if (!text)
|
|
66
|
+
return;
|
|
67
|
+
const { length, width, separator = '', trimType = TrimMode.End, verticalAlign = VerticalAlign.Middle, wordBreak = false, trimOnly = false, dy = 0.32, wrapMode, fontSize, widthToHeightRatio = 0.52, } = options;
|
|
68
|
+
// Trim text first
|
|
69
|
+
if (length)
|
|
70
|
+
text = trimText(text, length, trimType); // By the number of characters
|
|
71
|
+
if (!length && trimOnly && width) { // By provided width if `trimOnly` is set
|
|
72
|
+
trimSVGTextToPixel(element, width, trimType);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// Wrap
|
|
76
|
+
const separators = (isArray(separator) ? separator : [separator]);
|
|
77
|
+
const words = splitString(text, separators);
|
|
78
|
+
const x = parseFloat(element.attr('x')) || 0;
|
|
79
|
+
element.text('');
|
|
80
|
+
let tspan = element.append('tspan').attr('x', x);
|
|
81
|
+
let tspanText = `${words[0]}`;
|
|
82
|
+
tspan.text(tspanText);
|
|
83
|
+
let tspanCount = 1;
|
|
84
|
+
words.forEach((word, i) => {
|
|
85
|
+
if (i === 0)
|
|
86
|
+
return;
|
|
87
|
+
const _text = `${tspanText}${word}`;
|
|
88
|
+
tspan.text(_text);
|
|
89
|
+
const _wrapText = wrapMode === WrapMode.FontSize ? fontSize * _text.length * widthToHeightRatio > width
|
|
90
|
+
: tspan.node().getComputedTextLength() > width;
|
|
91
|
+
if (_wrapText) {
|
|
92
|
+
tspan.text(tspanText.trim());
|
|
93
|
+
if (wordBreak)
|
|
94
|
+
word = breakTspan(tspan, width, word);
|
|
95
|
+
tspan = element.append('tspan')
|
|
96
|
+
.attr('x', x)
|
|
97
|
+
.attr('dy', '1.2em')
|
|
98
|
+
.text(word);
|
|
99
|
+
tspanCount += 1;
|
|
100
|
+
tspanText = word;
|
|
101
|
+
}
|
|
102
|
+
else
|
|
103
|
+
tspanText += word;
|
|
104
|
+
});
|
|
105
|
+
if (wordBreak) {
|
|
106
|
+
let numTspan;
|
|
107
|
+
if (wrapMode === WrapMode.FontSize) {
|
|
108
|
+
numTspan = Math.ceil(tspan.text().length * fontSize * widthToHeightRatio / (width || 1));
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
numTspan = Math.ceil(tspan.node().getComputedTextLength() / (width || 1));
|
|
112
|
+
}
|
|
113
|
+
for (let i = 0; i < numTspan; i++) {
|
|
114
|
+
const word = breakTspan(tspan, width || 1);
|
|
115
|
+
if (word) {
|
|
116
|
+
tspan = element.append('tspan')
|
|
117
|
+
.attr('x', x)
|
|
118
|
+
.attr('dy', '1.2em')
|
|
119
|
+
.text(word);
|
|
120
|
+
tspanCount += 1;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Vertical Align
|
|
125
|
+
let addY = -(tspanCount - 1) * 0.5 + dy;
|
|
126
|
+
if (verticalAlign === VerticalAlign.Bottom)
|
|
127
|
+
addY = dy;
|
|
128
|
+
else if (verticalAlign === VerticalAlign.Top)
|
|
129
|
+
addY = -(tspanCount - 1) - (1 - dy);
|
|
130
|
+
element.attr('dy', `${addY}em`);
|
|
131
|
+
}
|
|
132
|
+
function wrapSVGText(textElement, options) {
|
|
133
|
+
const text = textElement.text();
|
|
134
|
+
if (!text)
|
|
135
|
+
return;
|
|
136
|
+
const { width, separator = [' ', '-', '.', ','], } = options;
|
|
137
|
+
// Wrap
|
|
138
|
+
const separators = (isArray(separator) ? separator : [separator]);
|
|
139
|
+
const words = splitString(text, separators);
|
|
140
|
+
const x = parseFloat(textElement.attr('x')) || 0;
|
|
141
|
+
textElement.text('');
|
|
142
|
+
let tspan = textElement.append('tspan').attr('x', x);
|
|
143
|
+
let tspanContent = `${words[0]}`;
|
|
144
|
+
tspan.text(tspanContent);
|
|
145
|
+
words.forEach((word, i) => {
|
|
146
|
+
if (i === 0)
|
|
147
|
+
return;
|
|
148
|
+
const tspanText = `${tspanContent}${word}`;
|
|
149
|
+
tspan.text(tspanText);
|
|
150
|
+
const tspanWidth = tspan.node().getComputedTextLength();
|
|
151
|
+
if (tspanWidth > width) {
|
|
152
|
+
tspan.text(tspanContent.trim());
|
|
153
|
+
tspan = textElement.append('tspan')
|
|
154
|
+
.attr('x', x)
|
|
155
|
+
.attr('dy', '1.2em')
|
|
156
|
+
.text(word);
|
|
157
|
+
tspanContent = word;
|
|
158
|
+
}
|
|
159
|
+
else
|
|
160
|
+
tspanContent += word;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function trimSVGText(svgTextSelection, maxWidth = 50, trimType = TrimMode.Middle, fastMode, fontSize, widthToHeightRatio) {
|
|
164
|
+
const text = svgTextSelection.text();
|
|
165
|
+
const textLength = text.length;
|
|
166
|
+
const textWidth = fastMode ? fontSize * textLength * widthToHeightRatio : svgTextSelection.node().getComputedTextLength();
|
|
167
|
+
const tolerance = 1.1;
|
|
168
|
+
const maxCharacters = Math.ceil(textLength * maxWidth / (tolerance * textWidth));
|
|
169
|
+
if (maxCharacters < textLength) {
|
|
170
|
+
svgTextSelection.text(trimText(text, maxCharacters, trimType));
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
function estimateTextSize(svgTextSelection, fontSize, dy = 0.32, fastMode = true, widthToHeightRatio = 0.52) {
|
|
176
|
+
const tspanSelection = svgTextSelection.selectAll('tspan');
|
|
177
|
+
const lines = tspanSelection.size() || 1;
|
|
178
|
+
const height = svgTextSelection.text() ? 0.85 * fontSize * lines * (1 + dy) - dy : 0;
|
|
179
|
+
let width = 0;
|
|
180
|
+
if (tspanSelection.empty()) {
|
|
181
|
+
const textLength = svgTextSelection.text().length;
|
|
182
|
+
width = fastMode ? fontSize * textLength * widthToHeightRatio : svgTextSelection.node().getComputedTextLength();
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
for (const tspan of tspanSelection.nodes()) {
|
|
186
|
+
const tspanTextLength = tspan.textContent.length;
|
|
187
|
+
const w = fastMode ? fontSize * tspanTextLength * widthToHeightRatio : tspan.getComputedTextLength();
|
|
188
|
+
if (w > width)
|
|
189
|
+
width = w;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return { width, height };
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export { breakTspan, estimateTextSize, splitString, trimSVGText, trimSVGTextToPixel, trimText, trimTextEnd, trimTextMiddle, trimTextStart, wrapSVGText, wrapTextElement };
|
|
196
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sources":["../../src/utils/text.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\n\n// Types\nimport { TrimMode, VerticalAlign, WrapMode, WrapTextOptions } from 'types/text'\n\n// Utils\nimport { isArray, flatten } from 'utils/data'\n\nexport function trimTextStart (str = '', maxLength = 15): string {\n return str.length > maxLength ? `…${str.substr(0, maxLength)}` : str\n}\n\nexport function trimTextMiddle (str = '', maxLength = 15): string {\n const dist = Math.floor((maxLength - 3) / 2)\n return str.length > maxLength ? `${str.substr(0, dist)}…${str.substr(-dist, dist)}` : str\n}\n\nexport function trimTextEnd (str = '', maxLength = 15): string {\n return str.length > maxLength ? `${str.substr(0, maxLength)}…` : str\n}\n\nexport function trimText (str = '', length = 15, type = TrimMode.Middle): string {\n let result = trimTextEnd(str, length)\n if (type === TrimMode.Start) result = trimTextStart(str, length)\n else if (type === TrimMode.Middle) result = trimTextMiddle(str, length)\n return result\n}\n\nexport function trimSVGTextToPixel (svgTextSelection: Selection<SVGTextElement, any, SVGElement, any>, minWidth = 50, trimType = TrimMode.Middle): void {\n let i = 0\n let textBBox = svgTextSelection.node().getBBox()\n const text = svgTextSelection.text()\n let textLength = text.length\n\n while (textBBox.width > minWidth && textLength > 0) {\n textLength -= 1\n svgTextSelection.text(trimText(text, text.length - i, trimType))\n i = i + 1\n textBBox = svgTextSelection.node().getBBox()\n }\n}\n\nexport function breakTspan (tspan: Selection<SVGTSpanElement, any, SVGElement, any>, width: number, word = ''): string {\n const tspanText = tspan.text()\n const coeff = width / tspan.node().getComputedTextLength()\n\n if (coeff < 1) {\n const cutIndex = Math.floor(coeff * tspanText.length) || 1\n const head = tspanText.substr(0, cutIndex)\n const tail = tspanText.substr(cutIndex, tspanText.length)\n tspan.text(head)\n return `${tail}${word}`\n } else {\n return word\n }\n}\n\nexport function splitString (text: string, separators = [' ']): string[] {\n let result = [text] as any[]\n for (let i = 0; i < separators.length; i++) {\n const sep = separators[i]\n result.forEach((d, id) => {\n const separated = d.split(sep)\n const words = separated.map((word, j) => `${word}${j === separated.length - 1 ? '' : sep}`)\n // result.splice(i, 0, ...words)\n result[id] = words\n })\n result = flatten(result)\n }\n\n return result\n}\n\nexport function wrapTextElement (element: Selection<SVGTextElement, any, SVGElement, any>, options: WrapTextOptions): void {\n let text = element.text()\n if (!text) return\n\n const {\n length,\n width,\n separator = '',\n trimType = TrimMode.End,\n verticalAlign = VerticalAlign.Middle,\n wordBreak = false,\n trimOnly = false,\n dy = 0.32,\n wrapMode,\n fontSize,\n widthToHeightRatio = 0.52,\n } = options\n\n // Trim text first\n if (length) text = trimText(text, length, trimType) // By the number of characters\n if (!length && trimOnly && width) { // By provided width if `trimOnly` is set\n trimSVGTextToPixel(element, width, trimType)\n return\n }\n\n // Wrap\n const separators = (isArray(separator) ? separator : [separator]) as string[]\n const words = splitString(text, separators)\n const x = parseFloat(element.attr('x')) || 0\n\n element.text('')\n let tspan = element.append('tspan').attr('x', x)\n let tspanText = `${words[0]}`\n tspan.text(tspanText)\n let tspanCount = 1\n\n words.forEach((word, i) => {\n if (i === 0) return\n const _text = `${tspanText}${word}`\n tspan.text(_text)\n const _wrapText = wrapMode === WrapMode.FontSize ? fontSize * _text.length * widthToHeightRatio > width\n : tspan.node().getComputedTextLength() > width\n if (_wrapText) {\n tspan.text(tspanText.trim())\n if (wordBreak) word = breakTspan(tspan, width, word)\n tspan = element.append('tspan')\n .attr('x', x)\n .attr('dy', '1.2em')\n .text(word)\n tspanCount += 1\n tspanText = word\n } else tspanText += word\n })\n\n if (wordBreak) {\n let numTspan\n if (wrapMode === WrapMode.FontSize) {\n numTspan = Math.ceil(tspan.text().length * fontSize * widthToHeightRatio / (width || 1))\n } else {\n numTspan = Math.ceil(tspan.node().getComputedTextLength() / (width || 1))\n }\n for (let i = 0; i < numTspan; i++) {\n const word = breakTspan(tspan, width || 1)\n if (word) {\n tspan = element.append('tspan')\n .attr('x', x)\n .attr('dy', '1.2em')\n .text(word)\n tspanCount += 1\n }\n }\n }\n\n // Vertical Align\n let addY = -(tspanCount - 1) * 0.5 + dy\n if (verticalAlign === VerticalAlign.Bottom) addY = dy\n else if (verticalAlign === VerticalAlign.Top) addY = -(tspanCount - 1) - (1 - dy)\n element.attr('dy', `${addY}em`)\n}\n\nexport function cutString (str: string, renderedWidth: number, maxWidth: number): [string, string] {\n const coeff = maxWidth / renderedWidth\n if (coeff >= 1) return [str, '']\n\n const cutIndex = Math.floor(coeff * str.length) || 1\n const head = str.substr(0, cutIndex)\n const tail = str.substr(cutIndex, str.length)\n\n return [head, tail]\n}\n\nexport function wrapSVGText (textElement: Selection<SVGTextElement, any, SVGElement, any>, options: WrapTextOptions): void {\n const text = textElement.text()\n if (!text) return\n\n const {\n width,\n separator = [' ', '-', '.', ','],\n } = options\n\n // Wrap\n const separators = (isArray(separator) ? separator : [separator]) as string[]\n const words = splitString(text, separators)\n const x = parseFloat(textElement.attr('x')) || 0\n\n textElement.text('')\n let tspan = textElement.append('tspan').attr('x', x)\n let tspanContent = `${words[0]}`\n tspan.text(tspanContent)\n\n words.forEach((word, i) => {\n if (i === 0) return\n\n const tspanText = `${tspanContent}${word}`\n tspan.text(tspanText)\n const tspanWidth = tspan.node().getComputedTextLength()\n if (tspanWidth > width) {\n tspan.text(tspanContent.trim())\n\n tspan = textElement.append('tspan')\n .attr('x', x)\n .attr('dy', '1.2em')\n .text(word)\n\n tspanContent = word\n } else tspanContent += word\n })\n}\n\nexport function trimSVGText (svgTextSelection: Selection<SVGTextElement, any, SVGElement, any>, maxWidth = 50, trimType = TrimMode.Middle, fastMode?: boolean, fontSize?: number, widthToHeightRatio?: number): boolean {\n const text = svgTextSelection.text()\n const textLength = text.length\n\n const textWidth = fastMode ? fontSize * textLength * widthToHeightRatio : svgTextSelection.node().getComputedTextLength()\n const tolerance = 1.1\n const maxCharacters = Math.ceil(textLength * maxWidth / (tolerance * textWidth))\n if (maxCharacters < textLength) {\n svgTextSelection.text(trimText(text, maxCharacters, trimType))\n return true\n }\n\n return false\n}\n\nexport function estimateTextSize (svgTextSelection: Selection<SVGTextElement, any, SVGElement, any>, fontSize: number, dy = 0.32, fastMode = true, widthToHeightRatio = 0.52): { width: number; height: number } {\n const tspanSelection = svgTextSelection.selectAll('tspan')\n\n const lines = tspanSelection.size() || 1\n const height = svgTextSelection.text() ? 0.85 * fontSize * lines * (1 + dy) - dy : 0\n\n let width = 0\n if (tspanSelection.empty()) {\n const textLength = svgTextSelection.text().length\n width = fastMode ? fontSize * textLength * widthToHeightRatio : svgTextSelection.node().getComputedTextLength()\n } else {\n for (const tspan of tspanSelection.nodes()) {\n const tspanTextLength = (tspan as SVGTSpanElement).textContent.length\n const w = fastMode ? fontSize * tspanTextLength * widthToHeightRatio : (tspan as SVGTSpanElement).getComputedTextLength()\n if (w > width) width = w\n }\n }\n\n return { width, height }\n}\n"],"names":[],"mappings":";;;AAEA;AAMM,SAAU,aAAa,CAAE,GAAG,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAA;IACrD,OAAO,GAAG,CAAC,MAAM,GAAG,SAAS,GAAG,CAAA,CAAA,EAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,CAAA;AACtE,CAAC;AAEK,SAAU,cAAc,CAAE,GAAG,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAA;AACtD,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC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