@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,399 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import { max, min, group } from 'd3-array';
|
|
3
|
+
import { unique, getString, sortBy, groupBy, without, clamp, getNumber, merge, getValue } from '../../../utils/data.js';
|
|
4
|
+
import { getMaxNodeSize, configuredNodeSize, getAverageNodeSize, getNodeSize } from './node/helper.js';
|
|
5
|
+
import { positionNonConnectedNodes, toElkHierarchy, DEFAULT_ELK_SETTINGS, adjustElkHierarchyCoordinates } from './layout-helpers.js';
|
|
6
|
+
|
|
7
|
+
function applyLayoutCircular(datamodel, config, width, height) {
|
|
8
|
+
const { nonConnectedNodes, connectedNodes, nodes } = datamodel;
|
|
9
|
+
const { layoutNonConnectedAside, nodeSize } = config;
|
|
10
|
+
const activeWidth = width;
|
|
11
|
+
const activeHeight = height;
|
|
12
|
+
// Handle layout nodes
|
|
13
|
+
const layoutNodes = layoutNonConnectedAside ? connectedNodes : nodes;
|
|
14
|
+
const maxNodeSize = getMaxNodeSize(layoutNodes, nodeSize);
|
|
15
|
+
const yRatio = activeHeight / maxNodeSize;
|
|
16
|
+
const yScaling = yRatio < layoutNodes.length / 2 ? layoutNodes.length / 2 / yRatio : 1;
|
|
17
|
+
const xRatio = activeWidth / maxNodeSize;
|
|
18
|
+
const xScaling = xRatio < layoutNodes.length / 2 ? layoutNodes.length / 2 / xRatio : 1;
|
|
19
|
+
const scaling = Math.max(xScaling, yScaling);
|
|
20
|
+
layoutNodes.forEach((d, i) => {
|
|
21
|
+
const rX = scaling * activeWidth / 2;
|
|
22
|
+
const rY = scaling * activeHeight / 2; // maxNodeSize * layoutNodes.length / 4
|
|
23
|
+
const angle = 2 * i * Math.PI / layoutNodes.length;
|
|
24
|
+
d.x = activeWidth / 2 + rX * Math.cos(angle);
|
|
25
|
+
d.y = activeHeight / 2 + rY * Math.sin(angle);
|
|
26
|
+
});
|
|
27
|
+
// Handle non-connected nodes
|
|
28
|
+
if (layoutNonConnectedAside) {
|
|
29
|
+
const maxSize = getMaxNodeSize(nonConnectedNodes, nodeSize);
|
|
30
|
+
const maxY = max(connectedNodes.map(d => d.y));
|
|
31
|
+
const maxX = max(connectedNodes.map(d => d.x));
|
|
32
|
+
const minX = min(connectedNodes.map(d => d.x));
|
|
33
|
+
const graphWidth = maxX - minX;
|
|
34
|
+
positionNonConnectedNodes(nonConnectedNodes, maxY + maxSize * 3, maxSize * 2.25, Math.max(graphWidth, width), minX);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function applyLayoutParallel(datamodel, config, width, height, orientation) {
|
|
38
|
+
const { nonConnectedNodes, connectedNodes, nodes } = datamodel;
|
|
39
|
+
const { layoutNonConnectedAside, layoutGroupOrder, layoutParallelSortConnectionsByGroup, layoutParallelNodesPerColumn, layoutParallelSubGroupsPerRow, nodeSize, layoutNodeGroup, layoutParallelNodeSubGroup, layoutParallelGroupSpacing, } = config;
|
|
40
|
+
const activeWidth = width - configuredNodeSize(nodeSize);
|
|
41
|
+
const activeHeight = height - configuredNodeSize(nodeSize) - (nonConnectedNodes.length ? configuredNodeSize(nodeSize) * 5 : 0);
|
|
42
|
+
// Handle connected nodes
|
|
43
|
+
const layoutNodes = layoutNonConnectedAside ? connectedNodes : nodes;
|
|
44
|
+
const groupNames = unique(layoutNodes.map(d => getString(d, layoutNodeGroup, d._index)));
|
|
45
|
+
const groupNamesSorted = sortBy(groupNames, d => layoutGroupOrder.indexOf(d));
|
|
46
|
+
const groups = groupNamesSorted.map(groupName => {
|
|
47
|
+
const groupNodes = layoutNodes.filter(d => getString(d, layoutNodeGroup, d._index) === groupName);
|
|
48
|
+
const groupedBySubgroup = groupBy(groupNodes, d => getString(d, layoutParallelNodeSubGroup, d._index));
|
|
49
|
+
const subgroups = Object.keys(groupedBySubgroup).map(name => ({
|
|
50
|
+
nodes: groupedBySubgroup[name],
|
|
51
|
+
name,
|
|
52
|
+
}));
|
|
53
|
+
return {
|
|
54
|
+
name: groupName,
|
|
55
|
+
nodes: groupNodes,
|
|
56
|
+
subgroups,
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
// Sort
|
|
60
|
+
const group = groups.find(g => g.name === layoutParallelSortConnectionsByGroup);
|
|
61
|
+
if (group) {
|
|
62
|
+
const sortMap = {};
|
|
63
|
+
let idx = 0;
|
|
64
|
+
group.subgroups.forEach(subgroup => {
|
|
65
|
+
subgroup.nodes.forEach(node => {
|
|
66
|
+
node.links.forEach(link => {
|
|
67
|
+
const linkTargetId = link === null || link === void 0 ? void 0 : link.target._id;
|
|
68
|
+
sortMap[linkTargetId] = idx;
|
|
69
|
+
idx = idx + 1;
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
without(groups, group).forEach(g => {
|
|
74
|
+
g.subgroups.forEach(subgroup => {
|
|
75
|
+
subgroup.nodes.sort((a, b) => {
|
|
76
|
+
return (sortMap[a._id] || 0) - (sortMap[b._id] || 0);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const maxN = max(groups, d => { var _a; return (_a = d.nodes) === null || _a === void 0 ? void 0 : _a.length; });
|
|
82
|
+
const labelApprxHeight = 40;
|
|
83
|
+
const labelMargin = 10;
|
|
84
|
+
const subgroupMargin = 40;
|
|
85
|
+
const maxNodeSize = getMaxNodeSize(layoutNodes, nodeSize);
|
|
86
|
+
if (orientation === 'horizontal') {
|
|
87
|
+
const minHorizontalStep = 2 * maxNodeSize + labelMargin;
|
|
88
|
+
const maxHorizontalStep = 3.5 * maxNodeSize + labelMargin;
|
|
89
|
+
const horizontalStep = clamp(activeWidth / (maxN - 1), minHorizontalStep, maxHorizontalStep);
|
|
90
|
+
const maxVerticalStep = maxNodeSize * 4 + labelApprxHeight;
|
|
91
|
+
const minVerticalStep = maxNodeSize * 1.5 + labelApprxHeight;
|
|
92
|
+
const verticalStep = (maxNodeSize + layoutParallelGroupSpacing) || clamp(activeHeight / (groups.length - 1), minVerticalStep, maxVerticalStep);
|
|
93
|
+
const subgroupNodeStep = maxNodeSize + labelApprxHeight + labelMargin;
|
|
94
|
+
let y0 = (groups.length < 2) ? height / 2 : 0;
|
|
95
|
+
groups.forEach(group => {
|
|
96
|
+
let x0 = 0;
|
|
97
|
+
let dy = 0;
|
|
98
|
+
let subgroupMaxWidth = 0;
|
|
99
|
+
let groupWidth = 0;
|
|
100
|
+
let groupHeight = 0;
|
|
101
|
+
let k = 0;
|
|
102
|
+
group.subgroups.forEach(subgroup => {
|
|
103
|
+
const subgroupRows = Math.ceil(subgroup.nodes.length / layoutParallelNodesPerColumn);
|
|
104
|
+
let n = 0;
|
|
105
|
+
let x = x0;
|
|
106
|
+
let y = y0 + dy;
|
|
107
|
+
subgroup.nodes.forEach(d => {
|
|
108
|
+
x = x + horizontalStep;
|
|
109
|
+
d.x = x;
|
|
110
|
+
d.y = y;
|
|
111
|
+
groupWidth = Math.max(groupWidth, x);
|
|
112
|
+
n = n + 1;
|
|
113
|
+
if (n >= layoutParallelNodesPerColumn) {
|
|
114
|
+
n = 0;
|
|
115
|
+
y += subgroupNodeStep;
|
|
116
|
+
x = x0;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const subgroupWidth = Math.min(subgroup.nodes.length, layoutParallelNodesPerColumn) * horizontalStep;
|
|
120
|
+
const subgroupHeight = subgroupRows * subgroupNodeStep;
|
|
121
|
+
subgroupMaxWidth = Math.max(subgroupMaxWidth, subgroupWidth);
|
|
122
|
+
dy = dy + subgroupHeight + subgroupMargin;
|
|
123
|
+
k = k + 1;
|
|
124
|
+
if (k >= layoutParallelSubGroupsPerRow) {
|
|
125
|
+
k = 0;
|
|
126
|
+
dy = 0;
|
|
127
|
+
x0 = x0 + subgroupMaxWidth + subgroupMargin;
|
|
128
|
+
subgroupMaxWidth = 0;
|
|
129
|
+
}
|
|
130
|
+
groupHeight = Math.max(groupHeight, y);
|
|
131
|
+
// x0 += Math.min(subgroup.nodes.length, layoutParallelNodesPerColumn) * horizontalStep + subgroupMargin
|
|
132
|
+
});
|
|
133
|
+
// Center group horizontally
|
|
134
|
+
group.subgroups.forEach(subgroup => {
|
|
135
|
+
subgroup.nodes.forEach(d => {
|
|
136
|
+
d.x -= groupWidth / 2;
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
groupWidth = 0;
|
|
140
|
+
// Update y0 for the next group
|
|
141
|
+
y0 = groupHeight + verticalStep;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
const minHorizontalStep = 6 * maxNodeSize + labelMargin;
|
|
146
|
+
const maxHorizontalStep = 10 * maxNodeSize + labelMargin;
|
|
147
|
+
const horizontalStep = (maxNodeSize + layoutParallelGroupSpacing) || clamp(activeWidth / (maxN - 1), minHorizontalStep, maxHorizontalStep);
|
|
148
|
+
const maxVerticalStep = maxNodeSize * 2.0 + labelApprxHeight;
|
|
149
|
+
const minVerticalStep = maxNodeSize * 1.5 + labelApprxHeight;
|
|
150
|
+
const verticalStep = clamp(activeHeight / (groups.length - 1), minVerticalStep, maxVerticalStep);
|
|
151
|
+
const subgroupNodeStep = maxNodeSize * 2.0;
|
|
152
|
+
let x0 = (groups.length < 2) ? width / 2 : 0;
|
|
153
|
+
groups.forEach(group => {
|
|
154
|
+
let y0 = 0;
|
|
155
|
+
let dx = 0; // Horizontal shift inside the group (column)
|
|
156
|
+
let subgroupMaxHeight = 0;
|
|
157
|
+
let groupWidth = 0;
|
|
158
|
+
let groupHeight = 0;
|
|
159
|
+
let k = 0;
|
|
160
|
+
group.subgroups.forEach(subgroup => {
|
|
161
|
+
const subgroupColumns = Math.ceil(subgroup.nodes.length / layoutParallelNodesPerColumn);
|
|
162
|
+
let n = 0;
|
|
163
|
+
let y = y0;
|
|
164
|
+
let x = x0 + dx;
|
|
165
|
+
subgroup.nodes.forEach(d => {
|
|
166
|
+
y = y + verticalStep;
|
|
167
|
+
d.x = x;
|
|
168
|
+
d.y = y;
|
|
169
|
+
groupHeight = Math.max(groupHeight, y);
|
|
170
|
+
n = n + 1;
|
|
171
|
+
if (n >= layoutParallelNodesPerColumn) {
|
|
172
|
+
n = 0;
|
|
173
|
+
x += subgroupNodeStep;
|
|
174
|
+
y = y0;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const subgroupHeight = Math.min(subgroup.nodes.length, layoutParallelNodesPerColumn) * verticalStep;
|
|
178
|
+
const subgroupWidth = subgroupColumns * subgroupNodeStep;
|
|
179
|
+
subgroupMaxHeight = Math.max(subgroupMaxHeight, subgroupHeight);
|
|
180
|
+
dx = dx + subgroupWidth + subgroupMargin;
|
|
181
|
+
k = k + 1;
|
|
182
|
+
if (k >= layoutParallelSubGroupsPerRow) {
|
|
183
|
+
k = 0;
|
|
184
|
+
dx = 0;
|
|
185
|
+
y0 = y0 + subgroupMaxHeight + subgroupMargin;
|
|
186
|
+
subgroupMaxHeight = 0;
|
|
187
|
+
}
|
|
188
|
+
groupWidth = Math.max(groupWidth, x);
|
|
189
|
+
});
|
|
190
|
+
// Center group vertically
|
|
191
|
+
group.subgroups.forEach(subgroup => {
|
|
192
|
+
subgroup.nodes.forEach(d => {
|
|
193
|
+
d.y -= groupHeight / 2;
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
groupHeight = 0;
|
|
197
|
+
// Update x0 for the next group
|
|
198
|
+
x0 = groupWidth + horizontalStep;
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
// Handle non-connected nodes
|
|
202
|
+
if (layoutNonConnectedAside) {
|
|
203
|
+
const maxSize = getMaxNodeSize(nonConnectedNodes, nodeSize);
|
|
204
|
+
const maxY = max(connectedNodes.map(d => d.y)) || 0;
|
|
205
|
+
const maxX = max(connectedNodes.map(d => d.x)) || 0;
|
|
206
|
+
const minX = min(connectedNodes.map(d => d.x)) || 0;
|
|
207
|
+
const graphWidth = (maxX - minX) || width;
|
|
208
|
+
positionNonConnectedNodes(nonConnectedNodes, maxY + maxSize * 3, maxSize * 2.25, Math.max(graphWidth, width));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function applyLayoutDagre(datamodel, config, width) {
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
const { nonConnectedNodes, connectedNodes, nodes, links } = datamodel;
|
|
214
|
+
const { nodeSize, layoutNonConnectedAside, dagreLayoutSettings, nodeStrokeWidth, nodeLabel } = config;
|
|
215
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
216
|
+
const { Graph } = yield import('@unovis/graphlibrary');
|
|
217
|
+
const { layout } = yield import('@unovis/dagre-layout');
|
|
218
|
+
// https://github.com/dagrejs/dagre/wiki
|
|
219
|
+
const dagreGraph = new Graph();
|
|
220
|
+
// Set an object for the graph label
|
|
221
|
+
dagreGraph.setGraph(dagreLayoutSettings);
|
|
222
|
+
// Default to assigning a new object as a label for each new edge.
|
|
223
|
+
dagreGraph.setDefaultEdgeLabel(() => ({}));
|
|
224
|
+
// Add nodes to the graph. The first argument is the node id. The second is
|
|
225
|
+
// metadata about the node. In this case we're going to add labels to each of
|
|
226
|
+
// our nodes.
|
|
227
|
+
const labelApprxHeight = 40;
|
|
228
|
+
const nds = (layoutNonConnectedAside ? connectedNodes : nodes);
|
|
229
|
+
nds.forEach(node => {
|
|
230
|
+
dagreGraph.setNode(node._index, {
|
|
231
|
+
label: getString(node, nodeLabel, node._index),
|
|
232
|
+
width: getNumber(node, nodeSize, node._index) * 1.5 + getNumber(node, nodeStrokeWidth, node._index),
|
|
233
|
+
height: labelApprxHeight + getNumber(node, nodeSize, node._index) * 1.5,
|
|
234
|
+
originalNode: node,
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
// Add edges to the graph.
|
|
238
|
+
links.forEach(link => {
|
|
239
|
+
dagreGraph.setEdge(link.source._index, link.target._index);
|
|
240
|
+
});
|
|
241
|
+
// Calculate the layout
|
|
242
|
+
layout(dagreGraph);
|
|
243
|
+
// Apply coordinates to the graph
|
|
244
|
+
dagreGraph.nodes().forEach(d => {
|
|
245
|
+
const node = dagreGraph.node(d);
|
|
246
|
+
node.originalNode.x = node.x; // width * d.x / dagreGraph._label.width
|
|
247
|
+
node.originalNode.y = node.y; // height * d.y / dagreGraph._label.height
|
|
248
|
+
});
|
|
249
|
+
// Handle non-connected nodes
|
|
250
|
+
if (layoutNonConnectedAside) {
|
|
251
|
+
const maxNodeSize = getMaxNodeSize(nonConnectedNodes, nodeSize);
|
|
252
|
+
const maxY = max(connectedNodes.map(d => d.y));
|
|
253
|
+
const maxX = max(connectedNodes.map(d => d.x));
|
|
254
|
+
const minX = min(connectedNodes.map(d => d.x));
|
|
255
|
+
const graphWidth = maxX - minX;
|
|
256
|
+
positionNonConnectedNodes(nonConnectedNodes, maxY + maxNodeSize * 3, maxNodeSize * 2.25, Math.max(graphWidth, width), 0);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
function applyLayoutConcentric(datamodel, config, width, height) {
|
|
261
|
+
var _a, _b;
|
|
262
|
+
const { nonConnectedNodes, connectedNodes, nodes } = datamodel;
|
|
263
|
+
const { layoutNonConnectedAside, layoutGroupOrder, nodeSize, layoutNodeGroup } = config;
|
|
264
|
+
const layoutNodes = layoutNonConnectedAside ? connectedNodes : nodes;
|
|
265
|
+
const groupNames = unique(layoutNodes.map(d => getString(d, layoutNodeGroup, d._index)));
|
|
266
|
+
const groupNamesSorted = sortBy(groupNames, d => layoutGroupOrder.indexOf(d));
|
|
267
|
+
const groups = groupNamesSorted.map(groupName => ({
|
|
268
|
+
name: groupName,
|
|
269
|
+
nodes: layoutNodes.filter(d => getString(d, layoutNodeGroup, d._index) === groupName),
|
|
270
|
+
}));
|
|
271
|
+
// Handle connected nodes
|
|
272
|
+
let r = 2 * getAverageNodeSize((_b = (_a = groups[0]) === null || _a === void 0 ? void 0 : _a.nodes) !== null && _b !== void 0 ? _b : [], nodeSize);
|
|
273
|
+
const widthToHeightRatio = width / height;
|
|
274
|
+
groups.forEach((group, i) => {
|
|
275
|
+
const avgNodeSize = getAverageNodeSize(group.nodes, nodeSize);
|
|
276
|
+
const requiredRadius = 1.1 * avgNodeSize * group.nodes.length / Math.PI;
|
|
277
|
+
if (r < requiredRadius)
|
|
278
|
+
r = requiredRadius;
|
|
279
|
+
group.nodes.forEach((node, j) => {
|
|
280
|
+
// If the first (central) group has only one node
|
|
281
|
+
if (i === 0 && group.nodes.length === 1) {
|
|
282
|
+
node.x = width / 2;
|
|
283
|
+
node.y = height / 2;
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
let dAngle = 0;
|
|
287
|
+
if (i === 0 && group.nodes.length === 3)
|
|
288
|
+
dAngle = Math.PI / 6;
|
|
289
|
+
if (i === 0 && group.nodes.length === 4)
|
|
290
|
+
dAngle = Math.PI / 4;
|
|
291
|
+
const angle = 2 * j * Math.PI / group.nodes.length + i * Math.PI / 12 + dAngle;
|
|
292
|
+
node.x = width / 2 + r * Math.cos(angle) * widthToHeightRatio;
|
|
293
|
+
node.y = height / 2 + r * Math.sin(angle);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
const groupSpacing = avgNodeSize * 3;
|
|
297
|
+
r += groupSpacing;
|
|
298
|
+
});
|
|
299
|
+
// Handle non-connected nodes
|
|
300
|
+
if (layoutNonConnectedAside) {
|
|
301
|
+
const maxSize = getMaxNodeSize(nonConnectedNodes, nodeSize);
|
|
302
|
+
const maxY = max(connectedNodes.map(d => d.y));
|
|
303
|
+
const maxX = max(connectedNodes.map(d => d.x));
|
|
304
|
+
const minX = min(connectedNodes.map(d => d.x));
|
|
305
|
+
const graphWidth = maxX - minX;
|
|
306
|
+
positionNonConnectedNodes(nonConnectedNodes, maxY + maxSize * 3, maxSize * 2.25, graphWidth, minX);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
function applyLayoutForce(datamodel, config, width) {
|
|
310
|
+
var _a, _b;
|
|
311
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
312
|
+
const { layoutNonConnectedAside, forceLayoutSettings: { linkDistance, linkStrength, charge, forceXStrength, forceYStrength }, nodeSize } = config;
|
|
313
|
+
const { forceSimulation, forceLink, forceManyBody, forceX, forceY, forceCollide } = yield import('d3-force');
|
|
314
|
+
const { nonConnectedNodes, connectedNodes, nodes, links } = datamodel;
|
|
315
|
+
const simulation = forceSimulation(layoutNonConnectedAside ? connectedNodes : nodes)
|
|
316
|
+
.force('link', forceLink(links)
|
|
317
|
+
.id((d) => String(d._id))
|
|
318
|
+
.distance(linkDistance)
|
|
319
|
+
.strength(linkStrength))
|
|
320
|
+
.force('charge', forceManyBody().strength(d => {
|
|
321
|
+
const linkCount = links.reduce((count, l) => count + Number((l.source === d) || (l.target === d)), 0);
|
|
322
|
+
return charge * Math.sqrt(linkCount);
|
|
323
|
+
}))
|
|
324
|
+
.force('x', forceX().strength(forceXStrength))
|
|
325
|
+
.force('y', forceY().strength(forceYStrength))
|
|
326
|
+
.force('collide', forceCollide().radius((d, i) => getNodeSize(d, nodeSize, i)).iterations(1))
|
|
327
|
+
.stop();
|
|
328
|
+
// See https://bl.ocks.org/mbostock/1667139, https://github.com/d3/d3-force/blob/master/README.md#simulation_tick
|
|
329
|
+
for (let i = 0, n = Math.ceil(Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())); i < n; ++i) {
|
|
330
|
+
simulation.tick();
|
|
331
|
+
}
|
|
332
|
+
// Translate coordinates to values > 0 for better animated transition between layout
|
|
333
|
+
const yMin = (_a = min(connectedNodes.map(d => d.y))) !== null && _a !== void 0 ? _a : 0;
|
|
334
|
+
const xMin = (_b = min(connectedNodes.map(d => d.x))) !== null && _b !== void 0 ? _b : 0;
|
|
335
|
+
nodes.forEach(d => {
|
|
336
|
+
d.x -= xMin;
|
|
337
|
+
d.y -= yMin;
|
|
338
|
+
});
|
|
339
|
+
// Handle non-connected nodes
|
|
340
|
+
if (layoutNonConnectedAside) {
|
|
341
|
+
const maxSize = getMaxNodeSize(nonConnectedNodes, nodeSize);
|
|
342
|
+
const maxY = max(connectedNodes.map(d => d.y));
|
|
343
|
+
const maxX = max(connectedNodes.map(d => d.x));
|
|
344
|
+
const minX = min(connectedNodes.map(d => d.x));
|
|
345
|
+
const graphWidth = maxX - minX;
|
|
346
|
+
positionNonConnectedNodes(nonConnectedNodes, maxY + maxSize * 6, maxSize * 2.25, Math.max(graphWidth, width), minX);
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
function applyELKLayout(datamodel, config, width) {
|
|
351
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
+
const ELK = (yield import('elkjs/lib/elk.bundled.js')).default;
|
|
353
|
+
const elk = new ELK();
|
|
354
|
+
const labelApprxHeight = 30;
|
|
355
|
+
const nodes = datamodel.nodes.map(n => (Object.assign(Object.assign({}, n), { id: n._id, width: getNumber(n, config.nodeSize, n._index) + getNumber(n, config.nodeStrokeWidth, n._index), height: getNumber(n, config.nodeSize, n._index) + labelApprxHeight })));
|
|
356
|
+
let elkNodes;
|
|
357
|
+
if (config.layoutElkNodeGroups) {
|
|
358
|
+
const groupingFunctions = config.layoutElkNodeGroups
|
|
359
|
+
.map(accessor => (d) => getString(d, accessor, d._index));
|
|
360
|
+
const grouped = group(nodes, ...groupingFunctions);
|
|
361
|
+
elkNodes = toElkHierarchy(grouped, config.layoutElkSettings);
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
elkNodes = nodes;
|
|
365
|
+
}
|
|
366
|
+
const rootNodeId = 'root';
|
|
367
|
+
const elkGraph = {
|
|
368
|
+
id: rootNodeId,
|
|
369
|
+
layoutOptions: merge(DEFAULT_ELK_SETTINGS, getValue(rootNodeId, config.layoutElkSettings)),
|
|
370
|
+
children: elkNodes,
|
|
371
|
+
edges: datamodel.links.map(l => ({
|
|
372
|
+
id: l._id,
|
|
373
|
+
sources: [l.source._id],
|
|
374
|
+
targets: [l.target._id],
|
|
375
|
+
})),
|
|
376
|
+
};
|
|
377
|
+
const layout = yield elk.layout(elkGraph);
|
|
378
|
+
adjustElkHierarchyCoordinates(layout);
|
|
379
|
+
nodes.forEach((node, i) => {
|
|
380
|
+
const found = datamodel.nodes.find(n => n._id === node.id);
|
|
381
|
+
if (!found)
|
|
382
|
+
return;
|
|
383
|
+
found.x = node.x;
|
|
384
|
+
found.y = node.y;
|
|
385
|
+
});
|
|
386
|
+
// Handle non-connected nodes
|
|
387
|
+
if (config.layoutNonConnectedAside) {
|
|
388
|
+
const maxSize = getMaxNodeSize(datamodel.nonConnectedNodes, config.nodeSize);
|
|
389
|
+
const maxY = max(datamodel.connectedNodes.map(d => d.y)) || 0;
|
|
390
|
+
const maxX = max(datamodel.connectedNodes.map(d => d.x)) || 0;
|
|
391
|
+
const minX = min(datamodel.connectedNodes.map(d => d.x)) || 0;
|
|
392
|
+
const graphWidth = (maxX - minX) || width;
|
|
393
|
+
positionNonConnectedNodes(datamodel.nonConnectedNodes, maxY + maxSize * 3, maxSize * 2.25, Math.max(graphWidth, width));
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export { applyELKLayout, applyLayoutCircular, applyLayoutConcentric, applyLayoutDagre, applyLayoutForce, applyLayoutParallel };
|
|
399
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sources":["../../../../src/components/graph/modules/layout.ts"],"sourcesContent":["import { min, max, group } from 'd3-array'\nimport type { ElkNode } from 'elkjs/lib/elk.bundled.js'\n\n// Core\nimport { GraphDataModel } from 'data-models/graph'\n\n// Utils\nimport { without, clamp, groupBy, unique, sortBy, getString, getNumber, getValue, merge } from 'utils/data'\n\n// Types\nimport { GraphInputLink, GraphInputNode } from 'types/graph'\n\n// Local Types\nimport { GraphNode, GraphLink } from '../types'\n\n// Config\nimport { GraphConfig } from '../config'\n\n// Helpers\nimport { getMaxNodeSize, configuredNodeSize, getNodeSize, getAverageNodeSize } from './node/helper'\nimport {\n DEFAULT_ELK_SETTINGS,\n adjustElkHierarchyCoordinates,\n positionNonConnectedNodes,\n toElkHierarchy,\n GraphElkHierarchyNode,\n} from './layout-helpers'\n\nexport function applyLayoutCircular<N extends GraphInputNode, L extends GraphInputLink> (\n datamodel: GraphDataModel<N, L, GraphNode<N, L>, GraphLink<N, L>>,\n config: GraphConfig<N, L>,\n width: number,\n height: number\n): void {\n const { nonConnectedNodes, connectedNodes, nodes } = datamodel\n const { layoutNonConnectedAside, nodeSize } = config\n\n const activeWidth = width\n const activeHeight = height\n\n // Handle layout nodes\n const layoutNodes = layoutNonConnectedAside ? connectedNodes : nodes\n const maxNodeSize = getMaxNodeSize(layoutNodes, nodeSize)\n const yRatio = activeHeight / maxNodeSize\n const yScaling = yRatio < layoutNodes.length / 2 ? layoutNodes.length / 2 / yRatio : 1\n const xRatio = activeWidth / maxNodeSize\n const xScaling = xRatio < layoutNodes.length / 2 ? layoutNodes.length / 2 / xRatio : 1\n const scaling = Math.max(xScaling, yScaling)\n\n layoutNodes.forEach((d, i) => {\n const rX = scaling * activeWidth / 2\n const rY = scaling * activeHeight / 2 // maxNodeSize * layoutNodes.length / 4\n const angle = 2 * i * Math.PI / layoutNodes.length\n d.x = activeWidth / 2 + rX * Math.cos(angle)\n d.y = activeHeight / 2 + rY * Math.sin(angle)\n })\n\n // Handle non-connected nodes\n if (layoutNonConnectedAside) {\n const maxSize = getMaxNodeSize(nonConnectedNodes, nodeSize)\n const maxY = max<number>(connectedNodes.map(d => d.y))\n const maxX = max<number>(connectedNodes.map(d => d.x))\n const minX = min<number>(connectedNodes.map(d => d.x))\n const graphWidth = maxX - minX\n positionNonConnectedNodes(nonConnectedNodes, maxY + maxSize * 3, maxSize * 2.25, Math.max(graphWidth, width), minX)\n }\n}\n\nexport function applyLayoutParallel<N extends GraphInputNode, L extends GraphInputLink> (\n datamodel: GraphDataModel<N, L, GraphNode<N, L>, GraphLink<N, L>>,\n config: GraphConfig<N, L>,\n width: number,\n height: number,\n orientation?: string\n): void {\n const { nonConnectedNodes, connectedNodes, nodes } = datamodel\n const {\n layoutNonConnectedAside, layoutGroupOrder, layoutParallelSortConnectionsByGroup, layoutParallelNodesPerColumn,\n layoutParallelSubGroupsPerRow, nodeSize, layoutNodeGroup, layoutParallelNodeSubGroup, layoutParallelGroupSpacing,\n } = config\n\n const activeWidth = width - configuredNodeSize(nodeSize)\n const activeHeight = height - configuredNodeSize(nodeSize) - (nonConnectedNodes.length ? configuredNodeSize(nodeSize) * 5 : 0)\n\n // Handle connected nodes\n const layoutNodes = layoutNonConnectedAside ? connectedNodes : nodes\n const groupNames = unique(layoutNodes.map(d => getString(d, layoutNodeGroup, d._index)))\n const groupNamesSorted: string[] = sortBy(groupNames, d => layoutGroupOrder.indexOf(d))\n\n const groups = groupNamesSorted.map(groupName => {\n const groupNodes = layoutNodes.filter(d => getString(d, layoutNodeGroup, d._index) === groupName)\n const groupedBySubgroup = groupBy(groupNodes, d => getString(d, layoutParallelNodeSubGroup, d._index))\n const subgroups = Object.keys(groupedBySubgroup).map(name => ({\n nodes: groupedBySubgroup[name],\n name,\n }))\n\n return {\n name: groupName,\n nodes: groupNodes,\n subgroups,\n }\n })\n\n // Sort\n const group = groups.find(g => g.name === layoutParallelSortConnectionsByGroup)\n if (group) {\n const sortMap = {}\n let idx = 0\n group.subgroups.forEach(subgroup => {\n subgroup.nodes.forEach(node => {\n node.links.forEach(link => {\n const linkTargetId = link?.target._id\n sortMap[linkTargetId] = idx\n idx = idx + 1\n })\n })\n })\n\n without(groups, group).forEach(g => {\n g.subgroups.forEach(subgroup => {\n subgroup.nodes.sort((a, b) => {\n return (sortMap[a._id] || 0) - (sortMap[b._id] || 0)\n })\n })\n })\n }\n\n const maxN = max(groups, d => d.nodes?.length)\n const labelApprxHeight = 40\n const labelMargin = 10\n const subgroupMargin = 40\n const maxNodeSize = getMaxNodeSize(layoutNodes, nodeSize)\n\n if (orientation === 'horizontal') {\n const minHorizontalStep = 2 * maxNodeSize + labelMargin\n const maxHorizontalStep = 3.5 * maxNodeSize + labelMargin\n const horizontalStep = clamp(activeWidth / (maxN - 1), minHorizontalStep, maxHorizontalStep)\n\n const maxVerticalStep = maxNodeSize * 4 + labelApprxHeight\n const minVerticalStep = maxNodeSize * 1.5 + labelApprxHeight\n const verticalStep = (maxNodeSize + layoutParallelGroupSpacing) || clamp(activeHeight / (groups.length - 1), minVerticalStep, maxVerticalStep)\n const subgroupNodeStep = maxNodeSize + labelApprxHeight + labelMargin\n\n let y0 = (groups.length < 2) ? height / 2 : 0\n groups.forEach(group => {\n let x0 = 0\n let dy = 0\n let subgroupMaxWidth = 0\n let groupWidth = 0\n let groupHeight = 0\n let k = 0\n group.subgroups.forEach(subgroup => {\n const subgroupRows = Math.ceil(subgroup.nodes.length / layoutParallelNodesPerColumn)\n let n = 0\n let x = x0\n let y = y0 + dy\n subgroup.nodes.forEach(d => {\n x = x + horizontalStep\n d.x = x\n d.y = y\n groupWidth = Math.max(groupWidth, x)\n\n n = n + 1\n if (n >= layoutParallelNodesPerColumn) {\n n = 0\n y += subgroupNodeStep\n x = x0\n }\n })\n\n const subgroupWidth = Math.min(subgroup.nodes.length, layoutParallelNodesPerColumn) * horizontalStep\n const subgroupHeight = subgroupRows * subgroupNodeStep\n subgroupMaxWidth = Math.max(subgroupMaxWidth, subgroupWidth)\n dy = dy + subgroupHeight + subgroupMargin\n k = k + 1\n if (k >= layoutParallelSubGroupsPerRow) {\n k = 0\n dy = 0\n x0 = x0 + subgroupMaxWidth + subgroupMargin\n subgroupMaxWidth = 0\n }\n\n groupHeight = Math.max(groupHeight, y)\n // x0 += Math.min(subgroup.nodes.length, layoutParallelNodesPerColumn) * horizontalStep + subgroupMargin\n })\n\n // Center group horizontally\n group.subgroups.forEach(subgroup => {\n subgroup.nodes.forEach(d => {\n d.x -= groupWidth / 2\n })\n })\n groupWidth = 0\n\n // Update y0 for the next group\n y0 = groupHeight + verticalStep\n })\n } else {\n const minHorizontalStep = 6 * maxNodeSize + labelMargin\n const maxHorizontalStep = 10 * maxNodeSize + labelMargin\n const horizontalStep = (maxNodeSize + layoutParallelGroupSpacing) || clamp(activeWidth / (maxN - 1), minHorizontalStep, maxHorizontalStep)\n\n const maxVerticalStep = maxNodeSize * 2.0 + labelApprxHeight\n const minVerticalStep = maxNodeSize * 1.5 + labelApprxHeight\n const verticalStep = clamp(activeHeight / (groups.length - 1), minVerticalStep, maxVerticalStep)\n const subgroupNodeStep = maxNodeSize * 2.0\n\n let x0 = (groups.length < 2) ? width / 2 : 0\n groups.forEach(group => {\n let y0 = 0\n let dx = 0 // Horizontal shift inside the group (column)\n let subgroupMaxHeight = 0\n let groupWidth = 0\n let groupHeight = 0\n\n let k = 0\n group.subgroups.forEach(subgroup => {\n const subgroupColumns = Math.ceil(subgroup.nodes.length / layoutParallelNodesPerColumn)\n let n = 0\n let y = y0\n let x = x0 + dx\n subgroup.nodes.forEach(d => {\n y = y + verticalStep\n d.x = x\n d.y = y\n groupHeight = Math.max(groupHeight, y)\n\n n = n + 1\n if (n >= layoutParallelNodesPerColumn) {\n n = 0\n x += subgroupNodeStep\n y = y0\n }\n })\n\n const subgroupHeight = Math.min(subgroup.nodes.length, layoutParallelNodesPerColumn) * verticalStep\n const subgroupWidth = subgroupColumns * subgroupNodeStep\n subgroupMaxHeight = Math.max(subgroupMaxHeight, subgroupHeight)\n dx = dx + subgroupWidth + subgroupMargin\n k = k + 1\n if (k >= layoutParallelSubGroupsPerRow) {\n k = 0\n dx = 0\n y0 = y0 + subgroupMaxHeight + subgroupMargin\n subgroupMaxHeight = 0\n }\n\n groupWidth = Math.max(groupWidth, x)\n })\n\n // Center group vertically\n group.subgroups.forEach(subgroup => {\n subgroup.nodes.forEach(d => {\n d.y -= groupHeight / 2\n })\n })\n groupHeight = 0\n\n // Update x0 for the next group\n x0 = groupWidth + horizontalStep\n })\n }\n\n // Handle non-connected nodes\n if (layoutNonConnectedAside) {\n const maxSize = getMaxNodeSize(nonConnectedNodes, nodeSize)\n const maxY = max<number>(connectedNodes.map(d => d.y)) || 0\n const maxX = max<number>(connectedNodes.map(d => d.x)) || 0\n const minX = min<number>(connectedNodes.map(d => d.x)) || 0\n const graphWidth = (maxX - minX) || width\n positionNonConnectedNodes(nonConnectedNodes, maxY + maxSize * 3, maxSize * 2.25, Math.max(graphWidth, width))\n }\n}\n\nexport async function applyLayoutDagre<N extends GraphInputNode, L extends GraphInputLink> (\n datamodel: GraphDataModel<N, L, GraphNode<N, L>, GraphLink<N, L>>,\n config: GraphConfig<N, L>,\n width: number\n): Promise<void> {\n const { nonConnectedNodes, connectedNodes, nodes, links } = datamodel\n const { nodeSize, layoutNonConnectedAside, dagreLayoutSettings, nodeStrokeWidth, nodeLabel } = config\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { Graph } = await import('@unovis/graphlibrary')\n const { layout } = await import('@unovis/dagre-layout')\n\n // https://github.com/dagrejs/dagre/wiki\n const dagreGraph = new Graph()\n\n // Set an object for the graph label\n dagreGraph.setGraph(dagreLayoutSettings)\n\n // Default to assigning a new object as a label for each new edge.\n dagreGraph.setDefaultEdgeLabel(() => ({}))\n\n // Add nodes to the graph. The first argument is the node id. The second is\n // metadata about the node. In this case we're going to add labels to each of\n // our nodes.\n const labelApprxHeight = 40\n const nds = (layoutNonConnectedAside ? connectedNodes : nodes)\n nds.forEach(node => {\n dagreGraph.setNode(node._index, {\n label: getString(node, nodeLabel, node._index),\n width: getNumber(node, nodeSize, node._index) * 1.5 + getNumber(node, nodeStrokeWidth, node._index),\n height: labelApprxHeight + getNumber(node, nodeSize, node._index) * 1.5,\n originalNode: node,\n })\n })\n\n // Add edges to the graph.\n links.forEach(link => {\n dagreGraph.setEdge((link.source as GraphNode)._index, (link.target as GraphNode)._index)\n })\n\n // Calculate the layout\n layout(dagreGraph)\n\n // Apply coordinates to the graph\n dagreGraph.nodes().forEach(d => {\n const node = dagreGraph.node(d)\n node.originalNode.x = node.x // width * d.x / dagreGraph._label.width\n node.originalNode.y = node.y // height * d.y / dagreGraph._label.height\n })\n\n // Handle non-connected nodes\n if (layoutNonConnectedAside) {\n const maxNodeSize = getMaxNodeSize(nonConnectedNodes, nodeSize)\n const maxY = max<number>(connectedNodes.map(d => d.y))\n const maxX = max<number>(connectedNodes.map(d => d.x))\n const minX = min<number>(connectedNodes.map(d => d.x))\n const graphWidth = maxX - minX\n positionNonConnectedNodes(nonConnectedNodes, maxY + maxNodeSize * 3, maxNodeSize * 2.25, Math.max(graphWidth, width), 0)\n }\n}\n\nexport function applyLayoutConcentric<N extends GraphInputNode, L extends GraphInputLink> (\n datamodel: GraphDataModel<N, L, GraphNode<N, L>, GraphLink<N, L>>,\n config: GraphConfig<N, L>,\n width: number,\n height: number\n): void {\n const { nonConnectedNodes, connectedNodes, nodes } = datamodel\n const { layoutNonConnectedAside, layoutGroupOrder, nodeSize, layoutNodeGroup } = config\n\n const layoutNodes = layoutNonConnectedAside ? connectedNodes : nodes\n\n const groupNames: string[] = unique(layoutNodes.map(d => getString(d, layoutNodeGroup, d._index)))\n const groupNamesSorted: string[] = sortBy(groupNames, d => layoutGroupOrder.indexOf(d))\n\n const groups = groupNamesSorted.map(groupName => ({\n name: groupName,\n nodes: layoutNodes.filter(d => getString(d, layoutNodeGroup, d._index) === groupName),\n }))\n\n // Handle connected nodes\n let r = 2 * getAverageNodeSize(groups[0]?.nodes ?? [], nodeSize)\n const widthToHeightRatio = width / height\n\n groups.forEach((group, i) => {\n const avgNodeSize = getAverageNodeSize(group.nodes, nodeSize)\n const requiredRadius = 1.1 * avgNodeSize * group.nodes.length / Math.PI\n if (r < requiredRadius) r = requiredRadius\n\n group.nodes.forEach((node, j) => {\n // If the first (central) group has only one node\n if (i === 0 && group.nodes.length === 1) {\n node.x = width / 2\n node.y = height / 2\n } else {\n let dAngle = 0\n if (i === 0 && group.nodes.length === 3) dAngle = Math.PI / 6\n if (i === 0 && group.nodes.length === 4) dAngle = Math.PI / 4\n const angle = 2 * j * Math.PI / group.nodes.length + i * Math.PI / 12 + dAngle\n node.x = width / 2 + r * Math.cos(angle) * widthToHeightRatio\n node.y = height / 2 + r * Math.sin(angle)\n }\n })\n\n const groupSpacing = avgNodeSize * 3\n r += groupSpacing\n })\n\n // Handle non-connected nodes\n if (layoutNonConnectedAside) {\n const maxSize = getMaxNodeSize(nonConnectedNodes, nodeSize)\n const maxY = max<number>(connectedNodes.map(d => d.y))\n const maxX = max<number>(connectedNodes.map(d => d.x))\n const minX = min<number>(connectedNodes.map(d => d.x))\n const graphWidth = maxX - minX\n positionNonConnectedNodes(nonConnectedNodes, maxY + maxSize * 3, maxSize * 2.25, graphWidth, minX)\n }\n}\n\nexport async function applyLayoutForce<N extends GraphInputNode, L extends GraphInputLink> (\n datamodel: GraphDataModel<N, L, GraphNode<N, L>, GraphLink<N, L>>,\n config: GraphConfig<N, L>,\n width: number\n): Promise<void> {\n const { layoutNonConnectedAside, forceLayoutSettings: { linkDistance, linkStrength, charge, forceXStrength, forceYStrength }, nodeSize } = config\n\n const { forceSimulation, forceLink, forceManyBody, forceX, forceY, forceCollide } = await import('d3-force')\n\n const { nonConnectedNodes, connectedNodes, nodes, links } = datamodel\n const simulation = forceSimulation(layoutNonConnectedAside ? connectedNodes : nodes)\n .force('link', forceLink(links)\n .id((d) => String((d as GraphNode<N, L>)._id))\n .distance(linkDistance)\n .strength(linkStrength)\n )\n .force('charge', forceManyBody().strength(d => {\n const linkCount = links.reduce((count, l) => count + Number((l.source === d) || (l.target === d)), 0)\n return charge * Math.sqrt(linkCount)\n }))\n .force('x', forceX().strength(forceXStrength))\n .force('y', forceY().strength(forceYStrength))\n .force('collide', forceCollide().radius((d, i) => getNodeSize(d, nodeSize, i)).iterations(1))\n .stop()\n\n // See https://bl.ocks.org/mbostock/1667139, https://github.com/d3/d3-force/blob/master/README.md#simulation_tick\n for (let i = 0, n = Math.ceil(Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())); i < n; ++i) {\n simulation.tick()\n }\n\n // Translate coordinates to values > 0 for better animated transition between layout\n const yMin = min<number>(connectedNodes.map(d => d.y)) ?? 0\n const xMin = min<number>(connectedNodes.map(d => d.x)) ?? 0\n nodes.forEach(d => {\n d.x -= xMin\n d.y -= yMin\n })\n\n // Handle non-connected nodes\n if (layoutNonConnectedAside) {\n const maxSize = getMaxNodeSize(nonConnectedNodes, nodeSize)\n const maxY = max<number>(connectedNodes.map(d => d.y))\n const maxX = max<number>(connectedNodes.map(d => d.x))\n const minX = min<number>(connectedNodes.map(d => d.x))\n const graphWidth = maxX - minX\n positionNonConnectedNodes(nonConnectedNodes, maxY + maxSize * 6, maxSize * 2.25, Math.max(graphWidth, width), minX)\n }\n}\n\nexport async function applyELKLayout<N extends GraphInputNode, L extends GraphInputLink> (\n datamodel: GraphDataModel<N, L, GraphNode<N, L>, GraphLink<N, L>>,\n config: GraphConfig<N, L>,\n width: number\n): Promise<void> {\n const ELK = (await import('elkjs/lib/elk.bundled.js')).default\n const elk = new ELK()\n\n const labelApprxHeight = 30\n const nodes = datamodel.nodes.map(n => ({\n ...n,\n id: n._id,\n width: getNumber(n, config.nodeSize, n._index) + getNumber(n, config.nodeStrokeWidth, n._index),\n height: getNumber(n, config.nodeSize, n._index) + labelApprxHeight,\n }))\n\n let elkNodes: (GraphNode<N, L> | GraphElkHierarchyNode<N, L>)[]\n if (config.layoutElkNodeGroups) {\n const groupingFunctions = config.layoutElkNodeGroups\n .map(accessor => (d: GraphNode<N, L>) => getString(d, accessor, d._index)) as [(d: GraphNode<N, L>) => string]\n const grouped = group(nodes, ...groupingFunctions)\n elkNodes = toElkHierarchy(grouped, config.layoutElkSettings)\n } else {\n elkNodes = nodes\n }\n\n const rootNodeId = 'root'\n const elkGraph: ElkNode = {\n id: rootNodeId,\n layoutOptions: merge(DEFAULT_ELK_SETTINGS, getValue(rootNodeId, config.layoutElkSettings)),\n children: elkNodes as ElkNode[],\n edges: datamodel.links.map(l => ({\n id: l._id,\n sources: [l.source._id],\n targets: [l.target._id],\n })),\n }\n\n const layout = await elk.layout(elkGraph)\n adjustElkHierarchyCoordinates(layout)\n\n nodes.forEach((node, i) => {\n const found = datamodel.nodes.find(n => n._id === node.id)\n if (!found) return\n\n found.x = node.x\n found.y = node.y\n })\n\n // Handle non-connected nodes\n if (config.layoutNonConnectedAside) {\n const maxSize = getMaxNodeSize(datamodel.nonConnectedNodes, config.nodeSize)\n const maxY = max<number>(datamodel.connectedNodes.map(d => d.y)) || 0\n const maxX = max<number>(datamodel.connectedNodes.map(d => d.x)) || 0\n const minX = min<number>(datamodel.connectedNodes.map(d => d.x)) || 0\n const graphWidth = (maxX - minX) || width\n positionNonConnectedNodes(datamodel.nonConnectedNodes, maxY + maxSize * 3, maxSize * 2.25, Math.max(graphWidth, width))\n }\n}\n"],"names":[],"mappings":";;;;;;AA4BM,SAAU,mBAAmB,CACjC,SAAiE,EACjE,MAAyB,EACzB,KAAa,EACb,MAAc,EAAA;IAEd,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,SAAS,CAAA;AAC9D,IAAA,MAAM,EAAE,uBAAuB,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAA;IAEpD,MAAM,WAAW,GAAG,KAAK,CAAA;IACzB,MAAM,YAAY,GAAG,MAAM,CAAA;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CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;AAChB,YAAA,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;AAClB,SAAC,CAAC,CAAA;;QAGF,IAAI,MAAM,CAAC,uBAAuB,EAAE;AAClC,YAAA,MAAM,OAAO,GAAG,cAAc,CAAC,SAAS,CAAC,iBAAiB,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC5E,MAAM,IAAI,GAAG,GAAG,CAAS,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;YACrE,MAAM,IAAI,GAAG,GAAG,CAAS,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;YACrE,MAAM,IAAI,GAAG,GAAG,CAAS,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;YACrE,MAAM,UAAU,GAAG,CAAC,IAAI,GAAG,IAAI,KAAK,KAAK,CAAA;YACzC,yBAAyB,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,GAAG,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAA;AACxH,SAAA;KACF,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GraphInputLink, GraphInputNode } from "../../../../types/graph";
|
|
2
|
+
import { GraphLink, GraphCircleLabel } from '../../types';
|
|
3
|
+
import { GraphConfig } from '../../config';
|
|
4
|
+
export declare const getPolylineData: (d: {
|
|
5
|
+
x1: number;
|
|
6
|
+
x2: number;
|
|
7
|
+
y1: number;
|
|
8
|
+
y2: number;
|
|
9
|
+
}) => string;
|
|
10
|
+
export declare const LINK_LABEL_RADIUS = 8;
|
|
11
|
+
export declare const LINK_MARKER_WIDTH = 12;
|
|
12
|
+
export declare const LINK_MARKER_HEIGHT = 8;
|
|
13
|
+
export declare function getLinkShift(link: GraphLink, spacing: number): {
|
|
14
|
+
dx: number;
|
|
15
|
+
dy: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function getLinkShiftTransform(link: GraphLink, spacing: number): string;
|
|
18
|
+
export declare function getLinkLabelShift(link: GraphLink, linkSpacing: number, shiftFromCenter?: number): string;
|
|
19
|
+
export declare function getLinkStrokeWidth<N extends GraphInputNode, L extends GraphInputLink>(d: GraphLink, scale: number, config: GraphConfig<N, L>): number;
|
|
20
|
+
export declare function getLinkBandWidth<N extends GraphInputNode, L extends GraphInputLink>(d: GraphLink, scale: number, config: GraphConfig<N, L>): number;
|
|
21
|
+
export declare function getLinkColor<N extends GraphInputNode, L extends GraphInputLink>(link: GraphLink, config: GraphConfig<N, L>): string;
|
|
22
|
+
export declare function getLinkArrow<N extends GraphInputNode, L extends GraphInputLink>(d: GraphLink, scale: number, config: GraphConfig<N, L>): string;
|
|
23
|
+
export declare function getArrowPath(): string;
|
|
24
|
+
export declare function getDoubleArrowPath(): string;
|
|
25
|
+
export declare function getLinkLabelTextColor(label: GraphCircleLabel): string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { getNumber, getString, getValue } from '../../../../utils/data.js';
|
|
2
|
+
import { getColor, hexToBrightness } from '../../../../utils/color.js';
|
|
3
|
+
import { color } from 'd3-color';
|
|
4
|
+
import { getY, getX } from '../node/helper.js';
|
|
5
|
+
import { ZoomLevel } from '../zoom-levels.js';
|
|
6
|
+
|
|
7
|
+
// Utils
|
|
8
|
+
const getPolylineData = (d) => `${d.x1},${d.y1} ${(d.x1 + d.x2) / 2},${(d.y1 + d.y2) / 2} ${d.x2},${d.y2}`;
|
|
9
|
+
const LINK_LABEL_RADIUS = 8;
|
|
10
|
+
const LINK_MARKER_WIDTH = 12;
|
|
11
|
+
const LINK_MARKER_HEIGHT = 8;
|
|
12
|
+
function getLinkShift(link, spacing) {
|
|
13
|
+
const sourceNode = link.source;
|
|
14
|
+
const targetNode = link.target;
|
|
15
|
+
const angle = Math.atan2(getY(targetNode) - getY(sourceNode), getX(targetNode) - getX(sourceNode)) - Math.PI / 2;
|
|
16
|
+
const dx = Math.cos(angle) * spacing * link._direction * (link._index - (link._neighbours - 1) / 2);
|
|
17
|
+
const dy = Math.sin(angle) * spacing * link._direction * (link._index - (link._neighbours - 1) / 2);
|
|
18
|
+
return { dx, dy };
|
|
19
|
+
}
|
|
20
|
+
function getLinkShiftTransform(link, spacing) {
|
|
21
|
+
const { dx, dy } = getLinkShift(link, spacing);
|
|
22
|
+
return `translate(${dx}, ${dy})`;
|
|
23
|
+
}
|
|
24
|
+
function getLinkLabelShift(link, linkSpacing, shiftFromCenter = 0) {
|
|
25
|
+
const x1 = getX(link.source);
|
|
26
|
+
const y1 = getY(link.source);
|
|
27
|
+
const x2 = getX(link.target);
|
|
28
|
+
const y2 = getY(link.target);
|
|
29
|
+
const angle = Math.atan2(y2 - y1, x2 - x1);
|
|
30
|
+
const perpendicularShift = getLinkShift(link, linkSpacing);
|
|
31
|
+
const x = x1 + 0.5 * (x2 - x1) + shiftFromCenter * Math.cos(angle) + perpendicularShift.dx;
|
|
32
|
+
const y = y1 + 0.5 * (y2 - y1) + shiftFromCenter * Math.sin(angle) + perpendicularShift.dy;
|
|
33
|
+
return `translate(${x}, ${y})`;
|
|
34
|
+
}
|
|
35
|
+
function getLinkStrokeWidth(d, scale, config) {
|
|
36
|
+
const m = getNumber(d, config.linkWidth, d._indexGlobal);
|
|
37
|
+
return m / Math.pow(scale, 0.5);
|
|
38
|
+
}
|
|
39
|
+
function getLinkBandWidth(d, scale, config) {
|
|
40
|
+
const { nodeSize, linkBandWidth } = config;
|
|
41
|
+
const sourceNodeSize = getNumber(d.source, nodeSize, d.source._index);
|
|
42
|
+
const targetNodeSize = getNumber(d.target, nodeSize, d.target._index);
|
|
43
|
+
const minNodeSize = Math.min(sourceNodeSize, targetNodeSize);
|
|
44
|
+
return Math.min(minNodeSize, getNumber(d, linkBandWidth, d._indexGlobal) / Math.pow(scale || 1, 0.5)) || 0;
|
|
45
|
+
}
|
|
46
|
+
function getLinkColor(link, config) {
|
|
47
|
+
var _a;
|
|
48
|
+
const { linkStroke } = config;
|
|
49
|
+
const c = (_a = getColor(link, linkStroke, link._indexGlobal, true)) !== null && _a !== void 0 ? _a : 'var(--vis-graph-link-stroke-color)';
|
|
50
|
+
return c || null;
|
|
51
|
+
}
|
|
52
|
+
function getLinkArrow(d, scale, config) {
|
|
53
|
+
const { linkArrow } = config;
|
|
54
|
+
if (scale > ZoomLevel.Level2 && getString(d, linkArrow, d._indexGlobal)) {
|
|
55
|
+
return getValue(d, linkArrow, d._indexGlobal);
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function getArrowPath() {
|
|
60
|
+
return `M0,0 V${LINK_MARKER_HEIGHT} L${LINK_MARKER_WIDTH},${LINK_MARKER_HEIGHT / 2} Z`;
|
|
61
|
+
}
|
|
62
|
+
function getDoubleArrowPath() {
|
|
63
|
+
return `M0,${LINK_MARKER_HEIGHT / 2} L${LINK_MARKER_WIDTH},0 L${LINK_MARKER_WIDTH * 2},${LINK_MARKER_HEIGHT / 2} L${LINK_MARKER_WIDTH},${LINK_MARKER_HEIGHT} Z`;
|
|
64
|
+
}
|
|
65
|
+
function getLinkLabelTextColor(label) {
|
|
66
|
+
if (!label.color)
|
|
67
|
+
return null;
|
|
68
|
+
const hex = color(label.color).hex();
|
|
69
|
+
const brightness = hexToBrightness(hex);
|
|
70
|
+
return brightness > 0.65 ? 'var(--vis-graph-link-label-text-color-dark)' : 'var(--vis-graph-link-label-text-color-bright)';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { LINK_LABEL_RADIUS, LINK_MARKER_HEIGHT, LINK_MARKER_WIDTH, getArrowPath, getDoubleArrowPath, getLinkArrow, getLinkBandWidth, getLinkColor, getLinkLabelShift, getLinkLabelTextColor, getLinkShift, getLinkShiftTransform, getLinkStrokeWidth, getPolylineData };
|
|
74
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sources":["../../../../../src/components/graph/modules/link/helper.ts"],"sourcesContent":["// Utils\nimport { getNumber, getString, getValue } from 'utils/data'\nimport { getColor, hexToBrightness } from 'utils/color'\nimport { color } from 'd3-color'\n\n// Types\nimport { GraphInputLink, GraphInputNode } from 'types/graph'\n\n// Local Types\nimport { GraphLink, GraphLinkArrowStyle, GraphCircleLabel } from '../../types'\n\n// Config\nimport { GraphConfig } from '../../config'\n\n// Helpers\nimport { getX, getY } from '../node/helper'\nimport { ZoomLevel } from '../zoom-levels'\n\nexport const getPolylineData = (d: { x1: number; x2: number; y1: number; y2: number}): string => `${d.x1},${d.y1} ${(d.x1 + d.x2) / 2},${(d.y1 + d.y2) / 2} ${d.x2},${d.y2}`\n\nexport const LINK_LABEL_RADIUS = 8\nexport const LINK_MARKER_WIDTH = 12\nexport const LINK_MARKER_HEIGHT = 8\n\nexport function getLinkShift (link: GraphLink, spacing: number): { dx: number; dy: number } {\n const sourceNode = link.source\n const targetNode = link.target\n const angle = Math.atan2(getY(targetNode) - getY(sourceNode), getX(targetNode) - getX(sourceNode)) - Math.PI / 2\n const dx = Math.cos(angle) * spacing * link._direction * (link._index - (link._neighbours - 1) / 2)\n const dy = Math.sin(angle) * spacing * link._direction * (link._index - (link._neighbours - 1) / 2)\n return { dx, dy }\n}\n\nexport function getLinkShiftTransform (link: GraphLink, spacing: number): string {\n const { dx, dy } = getLinkShift(link, spacing)\n return `translate(${dx}, ${dy})`\n}\n\nexport function getLinkLabelShift (link: GraphLink, linkSpacing: number, shiftFromCenter = 0): string {\n const x1 = getX(link.source)\n const y1 = getY(link.source)\n const x2 = getX(link.target)\n const y2 = getY(link.target)\n const angle = Math.atan2(y2 - y1, x2 - x1)\n const perpendicularShift = getLinkShift(link, linkSpacing)\n\n const x = x1 + 0.5 * (x2 - x1) + shiftFromCenter * Math.cos(angle) + perpendicularShift.dx\n const y = y1 + 0.5 * (y2 - y1) + shiftFromCenter * Math.sin(angle) + perpendicularShift.dy\n return `translate(${x}, ${y})`\n}\n\nexport function getLinkStrokeWidth<N extends GraphInputNode, L extends GraphInputLink> (\n d: GraphLink,\n scale: number,\n config: GraphConfig<N, L>\n): number {\n const m = getNumber(d, config.linkWidth, d._indexGlobal)\n return m / Math.pow(scale, 0.5)\n}\n\nexport function getLinkBandWidth<N extends GraphInputNode, L extends GraphInputLink> (\n d: GraphLink,\n scale: number,\n config: GraphConfig<N, L>\n): number {\n const { nodeSize, linkBandWidth } = config\n const sourceNodeSize = getNumber(d.source, nodeSize, d.source._index)\n const targetNodeSize = getNumber(d.target, nodeSize, d.target._index)\n const minNodeSize = Math.min(sourceNodeSize, targetNodeSize)\n return Math.min(minNodeSize, getNumber(d, linkBandWidth, d._indexGlobal) / Math.pow(scale || 1, 0.5)) || 0\n}\n\nexport function getLinkColor<N extends GraphInputNode, L extends GraphInputLink> (link: GraphLink, config: GraphConfig<N, L>): string {\n const { linkStroke } = config\n const c = getColor(link, linkStroke, link._indexGlobal, true) ?? 'var(--vis-graph-link-stroke-color)'\n return c || null\n}\n\nexport function getLinkArrow<N extends GraphInputNode, L extends GraphInputLink> (\n d: GraphLink,\n scale: number,\n config: GraphConfig<N, L>\n): string {\n const { linkArrow } = config\n if (scale > ZoomLevel.Level2 && getString(d, linkArrow, d._indexGlobal)) {\n return getValue<GraphLink, GraphLinkArrowStyle>(d, linkArrow, d._indexGlobal)\n }\n return null\n}\n\nexport function getArrowPath (): string {\n return `M0,0 V${LINK_MARKER_HEIGHT} L${LINK_MARKER_WIDTH},${LINK_MARKER_HEIGHT / 2} Z`\n}\n\nexport function getDoubleArrowPath (): string {\n return `M0,${LINK_MARKER_HEIGHT / 2} L${LINK_MARKER_WIDTH},0 L${LINK_MARKER_WIDTH * 2},${LINK_MARKER_HEIGHT / 2} L${LINK_MARKER_WIDTH},${LINK_MARKER_HEIGHT} Z`\n}\n\nexport function getLinkLabelTextColor (label: GraphCircleLabel): string {\n if (!label.color) return null\n\n const hex = color(label.color).hex()\n const brightness = hexToBrightness(hex)\n return brightness > 0.65 ? 'var(--vis-graph-link-label-text-color-dark)' : 'var(--vis-graph-link-label-text-color-bright)'\n}\n"],"names":[],"mappings":";;;;;;AAAA;MAkBa,eAAe,GAAG,CAAC,CAAoD,KAAa,CAAG,EAAA,CAAC,CAAC,EAAE,CAAA,CAAA,EAAI,CAAC,CAAC,EAAE,CAAA,CAAA,EAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAI,CAAA,EAAA,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAI,CAAA,EAAA,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAA,EAAE;AAErK,MAAM,iBAAiB,GAAG,EAAC;AAC3B,MAAM,iBAAiB,GAAG,GAAE;AAC5B,MAAM,kBAAkB,GAAG,EAAC;AAEnB,SAAA,YAAY,CAAE,IAAe,EAAE,OAAe,EAAA;AAC5D,IAAA,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAA;AAC9B,IAAA,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAA;AAC9B,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAA;AAChH,IAAA,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,GAAG,CAA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E,CAAA;AACpC,IAAA,MAAM,UAAU,GAAG,eAAe,CAAC,GAAG,CAAC,CAAA;IACvC,OAAO,UAAU,GAAG,IAAI,GAAG,6CAA6C,GAAG,+CAA+C,CAAA;AAC5H;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Selection } from 'd3-selection';
|
|
2
|
+
import { GraphInputLink, GraphInputNode } from "../../../../types/graph";
|
|
3
|
+
import { GraphLink } from '../../types';
|
|
4
|
+
import { GraphConfig } from '../../config';
|
|
5
|
+
export declare function createLinks<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>): void;
|
|
6
|
+
export declare function updateSelectedLinks<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>, config: GraphConfig<N, L>, scale: number): void;
|
|
7
|
+
export declare function updateLinks<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>, config: GraphConfig<N, L>, duration: number, scale: number, getMarkerId: (d: GraphLink) => string): void;
|
|
8
|
+
export declare function removeLinks<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>, config: GraphConfig<N, L>, duration: number): void;
|
|
9
|
+
export declare function animateLinkFlow<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>, config: GraphConfig<N, L>, scale: number): void;
|
|
10
|
+
export declare function zoomLinks<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>, config: GraphConfig<N, L>, scale: number, getMarkerId: (d: GraphLink) => string): void;
|
|
11
|
+
export declare const zoomLinksThrottled: import("throttle-debounce").throttle<typeof zoomLinks>;
|