@unovis/ts 1.1.1-beta.6 → 1.1.1-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declaration.d.ts +1 -0
- package/index.ts +1 -0
- package/licences.txt +43 -0
- package/maps.ts +1 -0
- package/package.json +1 -1
- package/rollup.config.js +71 -0
- package/rules/ts-getter-setter.js +35 -0
- package/src/components/area/config.ts +29 -0
- package/src/components/area/index.ts +133 -0
- package/{components/area/style.js → src/components/area/style.ts} +9 -10
- package/src/components/area/types.ts +2 -0
- package/src/components/axis/config.ts +76 -0
- package/src/components/axis/index.ts +363 -0
- package/{components/axis/style.js → src/components/axis/style.ts} +27 -22
- package/src/components/axis/types.ts +4 -0
- package/src/components/brush/config.ts +51 -0
- package/src/components/brush/index.ts +233 -0
- package/{components/brush/style.js → src/components/brush/style.ts} +15 -14
- package/src/components/brush/types.ts +8 -0
- package/src/components/bullet-legend/config.ts +38 -0
- package/src/components/bullet-legend/index.ts +104 -0
- package/{components/bullet-legend/style.js → src/components/bullet-legend/style.ts} +18 -16
- package/src/components/bullet-legend/types.ts +7 -0
- package/src/components/chord-diagram/config.ts +53 -0
- package/src/components/chord-diagram/index.ts +401 -0
- package/src/components/chord-diagram/modules/label.ts +155 -0
- package/src/components/chord-diagram/modules/link.ts +91 -0
- package/src/components/chord-diagram/modules/node.ts +80 -0
- package/{components/chord-diagram/style.js → src/components/chord-diagram/style.ts} +39 -30
- package/src/components/chord-diagram/types.ts +68 -0
- package/src/components/crosshair/config.ts +48 -0
- package/src/components/crosshair/index.ts +220 -0
- package/{components/crosshair/style.js → src/components/crosshair/style.ts} +12 -12
- package/src/components/crosshair/types.ts +15 -0
- package/src/components/donut/config.ts +65 -0
- package/src/components/donut/index.ts +148 -0
- package/src/components/donut/modules/arc.ts +86 -0
- package/{components/donut/style.js → src/components/donut/style.ts} +20 -18
- package/src/components/donut/types.ts +17 -0
- package/src/components/flow-legend/config.ts +31 -0
- package/src/components/flow-legend/index.ts +103 -0
- package/{components/flow-legend/style.js → src/components/flow-legend/style.ts} +25 -21
- package/src/components/flow-legend/types.ts +10 -0
- package/src/components/free-brush/config.ts +54 -0
- package/src/components/free-brush/index.ts +207 -0
- package/{components/free-brush/style.js → src/components/free-brush/style.ts} +12 -12
- package/src/components/free-brush/types.ts +8 -0
- package/src/components/graph/config.ts +280 -0
- package/src/components/graph/index.ts +809 -0
- package/src/components/graph/modules/layout-helpers.ts +96 -0
- package/src/components/graph/modules/layout.ts +502 -0
- package/src/components/graph/modules/link/helper.ts +105 -0
- package/src/components/graph/modules/link/index.ts +302 -0
- package/{components/graph/modules/link/style.js → src/components/graph/modules/link/style.ts} +45 -34
- package/src/components/graph/modules/node/helper.ts +162 -0
- package/src/components/graph/modules/node/index.ts +343 -0
- package/{components/graph/modules/node/style.js → src/components/graph/modules/node/style.ts} +72 -52
- package/src/components/graph/modules/panel/helper.ts +160 -0
- package/src/components/graph/modules/panel/index.ts +137 -0
- package/{components/graph/modules/panel/style.js → src/components/graph/modules/panel/style.ts} +42 -32
- package/src/components/graph/modules/shape.ts +108 -0
- package/src/components/graph/modules/zoom-levels.ts +6 -0
- package/src/components/graph/style.ts +72 -0
- package/src/components/graph/types.ts +152 -0
- package/src/components/grouped-bar/config.ts +40 -0
- package/src/components/grouped-bar/index.ts +325 -0
- package/{components/grouped-bar/style.js → src/components/grouped-bar/style.ts} +15 -14
- package/src/components/leaflet-flow-map/config.ts +60 -0
- package/src/components/leaflet-flow-map/index.ts +279 -0
- package/src/components/leaflet-flow-map/renderer-utils.ts +14 -0
- package/src/components/leaflet-flow-map/renderer.ts +146 -0
- package/{components/leaflet-flow-map/shaders.js → src/components/leaflet-flow-map/shaders.ts} +4 -7
- package/src/components/leaflet-flow-map/types.ts +18 -0
- package/src/components/leaflet-map/config.ts +234 -0
- package/src/components/leaflet-map/index.ts +808 -0
- package/src/components/leaflet-map/leaflet.css +625 -0
- package/src/components/leaflet-map/modules/clusterBackground.ts +34 -0
- package/src/components/leaflet-map/modules/donut.ts +37 -0
- package/src/components/leaflet-map/modules/map.ts +178 -0
- package/src/components/leaflet-map/modules/node.ts +208 -0
- package/src/components/leaflet-map/modules/selectionRing.ts +63 -0
- package/src/components/leaflet-map/modules/utils.ts +290 -0
- package/{components → src/components}/leaflet-map/renderer/leaflet-maplibre-gl.js +76 -78
- package/src/components/leaflet-map/renderer/map-style.ts +24 -0
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json +35 -0
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json +35 -0
- package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json +2185 -0
- package/src/components/leaflet-map/renderer/mapboxgl-layer.ts +43 -0
- package/src/components/leaflet-map/renderer/mapboxgl-utils.ts +40 -0
- package/{components → src/components}/leaflet-map/renderer/maplibre-gl.css.js +2 -4
- package/src/components/leaflet-map/style.ts +217 -0
- package/src/components/leaflet-map/types.ts +75 -0
- package/src/components/line/config.ts +34 -0
- package/src/components/line/index.ts +188 -0
- package/{components/line/style.js → src/components/line/style.ts} +18 -16
- package/src/components/line/types.ts +3 -0
- package/src/components/nested-donut/config.ts +75 -0
- package/src/components/nested-donut/index.ts +176 -0
- package/src/components/nested-donut/modules/arc.ts +78 -0
- package/src/components/nested-donut/modules/label.ts +63 -0
- package/src/components/nested-donut/style.ts +82 -0
- package/src/components/nested-donut/types.ts +29 -0
- package/src/components/sankey/config.ts +195 -0
- package/src/components/sankey/index.ts +387 -0
- package/src/components/sankey/modules/label.ts +228 -0
- package/src/components/sankey/modules/link.ts +141 -0
- package/src/components/sankey/modules/node.ts +221 -0
- package/{components/sankey/style.js → src/components/sankey/style.ts} +60 -44
- package/src/components/sankey/types.ts +95 -0
- package/src/components/scatter/config.ts +49 -0
- package/src/components/scatter/index.ts +220 -0
- package/src/components/scatter/modules/point.ts +123 -0
- package/src/components/scatter/modules/utils.ts +150 -0
- package/{components/scatter/style.js → src/components/scatter/style.ts} +15 -14
- package/src/components/scatter/types.ts +21 -0
- package/src/components/stacked-bar/config.ts +42 -0
- package/src/components/stacked-bar/index.ts +267 -0
- package/{components/stacked-bar/style.js → src/components/stacked-bar/style.ts} +15 -14
- package/src/components/stacked-bar/types.ts +5 -0
- package/src/components/timeline/config.ts +49 -0
- package/src/components/timeline/index.ts +302 -0
- package/{components/timeline/style.js → src/components/timeline/style.ts} +39 -30
- package/src/components/tooltip/config.ts +69 -0
- package/src/components/tooltip/index.ts +220 -0
- package/{components → src/components}/tooltip/style.js +11 -14
- package/src/components/topojson-map/config.ts +124 -0
- package/src/components/topojson-map/index.ts +436 -0
- package/{components/topojson-map/style.js → src/components/topojson-map/style.ts} +33 -26
- package/src/components/topojson-map/types.ts +123 -0
- package/src/components/topojson-map/utils.ts +29 -0
- package/src/components/vis-controls/config.ts +16 -0
- package/src/components/vis-controls/index.ts +68 -0
- package/{components/vis-controls/style.js → src/components/vis-controls/style.ts} +34 -27
- package/src/components/vis-controls/types.ts +14 -0
- package/src/components/xy-labels/config.ts +56 -0
- package/src/components/xy-labels/index.ts +109 -0
- package/src/components/xy-labels/modules/label.ts +140 -0
- package/{components/xy-labels/style.js → src/components/xy-labels/style.ts} +15 -14
- package/src/components/xy-labels/types.ts +26 -0
- package/src/components.ts +56 -0
- package/src/containers/single-container/config.ts +15 -0
- package/src/containers/single-container/index.ts +150 -0
- package/src/containers/xy-container/config.ts +112 -0
- package/src/containers/xy-container/index.ts +407 -0
- package/src/containers.ts +6 -0
- package/src/core/component/config.ts +61 -0
- package/src/core/component/index.ts +154 -0
- package/src/core/component/types.ts +9 -0
- package/src/core/config/index.ts +12 -0
- package/src/core/container/config.ts +56 -0
- package/src/core/container/index.ts +136 -0
- package/src/core/xy-component/config.ts +46 -0
- package/src/core/xy-component/index.ts +90 -0
- package/src/data-models/core.ts +15 -0
- package/src/data-models/graph.ts +138 -0
- package/src/data-models/map-graph.ts +72 -0
- package/src/data-models/map.ts +18 -0
- package/src/data-models/series.ts +16 -0
- package/src/index.ts +7 -0
- package/src/maps/china-provinces.json +1 -0
- package/src/maps/fr-regions.json +1 -0
- package/src/maps/germany-regions.json +1 -0
- package/src/maps/ind-regions.json +1 -0
- package/src/maps/uk-regions.json +1 -0
- package/src/maps/us-counties.json +1 -0
- package/src/maps/us-states.json +1 -0
- package/src/maps/world-110m-alpha.json +1 -0
- package/src/maps/world-simple.json +1 -0
- package/src/maps/world-simplest.json +1 -0
- package/src/maps.ts +34 -0
- package/src/styles/colors.ts +28 -0
- package/src/styles/index.ts +38 -0
- package/{styles/sizes.js → src/styles/sizes.ts} +6 -8
- package/src/types/accessor.ts +5 -0
- package/src/types/component.ts +15 -0
- package/src/types/curve.ts +62 -0
- package/src/types/data.ts +5 -0
- package/src/types/direction.ts +6 -0
- package/src/types/graph.ts +40 -0
- package/src/types/map.ts +5 -0
- package/src/types/misc.ts +10 -0
- package/src/types/position.ts +23 -0
- package/src/types/scale.ts +47 -0
- package/src/types/shape.ts +7 -0
- package/src/types/spacing.ts +6 -0
- package/src/types/svg.ts +32 -0
- package/src/types/symbol.ts +21 -0
- package/src/types/text.ts +71 -0
- package/src/types.ts +31 -0
- package/src/utils/color.ts +41 -0
- package/src/utils/d3.ts +15 -0
- package/src/utils/data.ts +328 -0
- package/src/utils/html.ts +13 -0
- package/src/utils/map.ts +29 -0
- package/src/utils/misc.ts +54 -0
- package/src/utils/path.ts +196 -0
- package/src/utils/scale.ts +1 -0
- package/src/utils/style.ts +37 -0
- package/src/utils/svg.ts +49 -0
- package/src/utils/text.ts +529 -0
- package/src/utils/type.ts +9 -0
- package/tsconfig.json +29 -0
- package/components/area/config.d.ts +0 -25
- package/components/area/config.js +0 -16
- package/components/area/config.js.map +0 -1
- package/components/area/index.d.ts +0 -19
- package/components/area/index.js +0 -102
- package/components/area/index.js.map +0 -1
- package/components/area/style.d.ts +0 -3
- package/components/area/style.js.map +0 -1
- package/components/area/types.d.ts +0 -6
- package/components/axis/config.d.ts +0 -71
- package/components/axis/config.js +0 -32
- package/components/axis/config.js.map +0 -1
- package/components/axis/index.d.ts +0 -44
- package/components/axis/index.js +0 -305
- package/components/axis/index.js.map +0 -1
- package/components/axis/style.d.ts +0 -9
- package/components/axis/style.js.map +0 -1
- package/components/axis/types.d.ts +0 -4
- package/components/axis/types.js +0 -8
- package/components/axis/types.js.map +0 -1
- package/components/brush/config.d.ts +0 -42
- package/components/brush/config.js +0 -24
- package/components/brush/config.js.map +0 -1
- package/components/brush/index.d.ts +0 -28
- package/components/brush/index.js +0 -199
- package/components/brush/index.js.map +0 -1
- package/components/brush/style.d.ts +0 -5
- package/components/brush/style.js.map +0 -1
- package/components/brush/types.d.ts +0 -7
- package/components/brush/types.js +0 -8
- package/components/brush/types.js.map +0 -1
- package/components/bullet-legend/config.d.ts +0 -34
- package/components/bullet-legend/config.js +0 -16
- package/components/bullet-legend/config.js.map +0 -1
- package/components/bullet-legend/index.d.ts +0 -19
- package/components/bullet-legend/index.js +0 -79
- package/components/bullet-legend/index.js.map +0 -1
- package/components/bullet-legend/style.d.ts +0 -6
- package/components/bullet-legend/style.js.map +0 -1
- package/components/bullet-legend/types.d.ts +0 -7
- package/components/bullet-legend/types.js +0 -2
- package/components/bullet-legend/types.js.map +0 -1
- package/components/chord-diagram/config.d.ts +0 -44
- package/components/chord-diagram/config.js +0 -25
- package/components/chord-diagram/config.js.map +0 -1
- package/components/chord-diagram/index.d.ts +0 -42
- package/components/chord-diagram/index.js +0 -305
- package/components/chord-diagram/index.js.map +0 -1
- package/components/chord-diagram/modules/label.d.ts +0 -8
- package/components/chord-diagram/modules/label.js +0 -115
- package/components/chord-diagram/modules/label.js.map +0 -1
- package/components/chord-diagram/modules/link.d.ts +0 -21
- package/components/chord-diagram/modules/link.js +0 -63
- package/components/chord-diagram/modules/link.js.map +0 -1
- package/components/chord-diagram/modules/node.d.ts +0 -17
- package/components/chord-diagram/modules/node.js +0 -52
- package/components/chord-diagram/modules/node.js.map +0 -1
- package/components/chord-diagram/style.d.ts +0 -13
- package/components/chord-diagram/style.js.map +0 -1
- package/components/chord-diagram/types.d.ts +0 -58
- package/components/chord-diagram/types.js +0 -8
- package/components/chord-diagram/types.js.map +0 -1
- package/components/crosshair/config.d.ts +0 -43
- package/components/crosshair/config.js +0 -19
- package/components/crosshair/config.js.map +0 -1
- package/components/crosshair/index.d.ts +0 -35
- package/components/crosshair/index.js +0 -183
- package/components/crosshair/index.js.map +0 -1
- package/components/crosshair/style.d.ts +0 -4
- package/components/crosshair/style.js.map +0 -1
- package/components/crosshair/types.d.ts +0 -13
- package/components/crosshair/types.js +0 -2
- package/components/crosshair/types.js.map +0 -1
- package/components/donut/config.d.ts +0 -59
- package/components/donut/config.js +0 -28
- package/components/donut/config.js.map +0 -1
- package/components/donut/index.d.ts +0 -21
- package/components/donut/index.js +0 -107
- package/components/donut/index.js.map +0 -1
- package/components/donut/modules/arc.d.ts +0 -10
- package/components/donut/modules/arc.js +0 -59
- package/components/donut/modules/arc.js.map +0 -1
- package/components/donut/style.d.ts +0 -7
- package/components/donut/style.js.map +0 -1
- package/components/donut/types.d.ts +0 -20
- package/components/flow-legend/config.d.ts +0 -29
- package/components/flow-legend/config.js +0 -18
- package/components/flow-legend/config.js.map +0 -1
- package/components/flow-legend/index.d.ts +0 -16
- package/components/flow-legend/index.js +0 -75
- package/components/flow-legend/index.js.map +0 -1
- package/components/flow-legend/style.d.ts +0 -8
- package/components/flow-legend/style.js.map +0 -1
- package/components/flow-legend/types.d.ts +0 -9
- package/components/flow-legend/types.js +0 -8
- package/components/flow-legend/types.js.map +0 -1
- package/components/free-brush/config.d.ts +0 -45
- package/components/free-brush/config.js +0 -24
- package/components/free-brush/config.js.map +0 -1
- package/components/free-brush/index.d.ts +0 -20
- package/components/free-brush/index.js +0 -192
- package/components/free-brush/index.js.map +0 -1
- package/components/free-brush/style.d.ts +0 -4
- package/components/free-brush/style.js.map +0 -1
- package/components/free-brush/types.d.ts +0 -7
- package/components/free-brush/types.js +0 -9
- package/components/free-brush/types.js.map +0 -1
- package/components/graph/config.d.ts +0 -238
- package/components/graph/config.js +0 -84
- package/components/graph/config.js.map +0 -1
- package/components/graph/index.d.ts +0 -126
- package/components/graph/index.js +0 -656
- package/components/graph/index.js.map +0 -1
- package/components/graph/modules/layout-helpers.d.ts +0 -21
- package/components/graph/modules/layout-helpers.js +0 -69
- package/components/graph/modules/layout-helpers.js.map +0 -1
- package/components/graph/modules/layout.d.ts +0 -10
- package/components/graph/modules/layout.js +0 -399
- package/components/graph/modules/layout.js.map +0 -1
- package/components/graph/modules/link/helper.d.ts +0 -25
- package/components/graph/modules/link/helper.js +0 -74
- package/components/graph/modules/link/helper.js.map +0 -1
- package/components/graph/modules/link/index.d.ts +0 -11
- package/components/graph/modules/link/index.js +0 -212
- package/components/graph/modules/link/index.js.map +0 -1
- package/components/graph/modules/link/style.d.ts +0 -15
- package/components/graph/modules/link/style.js.map +0 -1
- package/components/graph/modules/node/helper.d.ts +0 -21
- package/components/graph/modules/node/helper.js +0 -126
- package/components/graph/modules/node/helper.js.map +0 -1
- package/components/graph/modules/node/index.d.ts +0 -11
- package/components/graph/modules/node/index.js +0 -252
- package/components/graph/modules/node/index.js.map +0 -1
- package/components/graph/modules/node/style.d.ts +0 -24
- package/components/graph/modules/node/style.js.map +0 -1
- package/components/graph/modules/panel/helper.d.ts +0 -18
- package/components/graph/modules/panel/helper.js +0 -111
- package/components/graph/modules/panel/helper.js.map +0 -1
- package/components/graph/modules/panel/index.d.ts +0 -7
- package/components/graph/modules/panel/index.js +0 -98
- package/components/graph/modules/panel/index.js.map +0 -1
- package/components/graph/modules/panel/style.d.ts +0 -14
- package/components/graph/modules/panel/style.js.map +0 -1
- package/components/graph/modules/shape.d.ts +0 -6
- package/components/graph/modules/shape.js +0 -80
- package/components/graph/modules/shape.js.map +0 -1
- package/components/graph/modules/zoom-levels.d.ts +0 -6
- package/components/graph/modules/zoom-levels.js +0 -10
- package/components/graph/modules/zoom-levels.js.map +0 -1
- package/components/graph/style.d.ts +0 -6
- package/components/graph/style.js +0 -66
- package/components/graph/style.js.map +0 -1
- package/components/graph/types.d.ts +0 -125
- package/components/graph/types.js +0 -30
- package/components/graph/types.js.map +0 -1
- package/components/grouped-bar/config.d.ts +0 -36
- package/components/grouped-bar/config.js +0 -20
- package/components/grouped-bar/config.js.map +0 -1
- package/components/grouped-bar/index.d.ts +0 -32
- package/components/grouped-bar/index.js +0 -249
- package/components/grouped-bar/index.js.map +0 -1
- package/components/grouped-bar/style.d.ts +0 -5
- package/components/grouped-bar/style.js.map +0 -1
- package/components/leaflet-flow-map/config.d.ts +0 -46
- package/components/leaflet-flow-map/config.js +0 -25
- package/components/leaflet-flow-map/config.js.map +0 -1
- package/components/leaflet-flow-map/index.d.ts +0 -52
- package/components/leaflet-flow-map/index.js +0 -220
- package/components/leaflet-flow-map/index.js.map +0 -1
- package/components/leaflet-flow-map/renderer-utils.d.ts +0 -5
- package/components/leaflet-flow-map/renderer-utils.js +0 -15
- package/components/leaflet-flow-map/renderer-utils.js.map +0 -1
- package/components/leaflet-flow-map/renderer.d.ts +0 -26
- package/components/leaflet-flow-map/renderer.js +0 -117
- package/components/leaflet-flow-map/renderer.js.map +0 -1
- package/components/leaflet-flow-map/shaders.d.ts +0 -2
- package/components/leaflet-flow-map/shaders.js.map +0 -1
- package/components/leaflet-flow-map/types.d.ts +0 -23
- package/components/leaflet-map/config.d.ts +0 -193
- package/components/leaflet-map/config.js +0 -71
- package/components/leaflet-map/config.js.map +0 -1
- package/components/leaflet-map/index.d.ts +0 -130
- package/components/leaflet-map/index.js +0 -690
- package/components/leaflet-map/index.js.map +0 -1
- package/components/leaflet-map/leaflet.css.js +0 -5
- package/components/leaflet-map/leaflet.css.js.map +0 -1
- package/components/leaflet-map/modules/clusterBackground.d.ts +0 -5
- package/components/leaflet-map/modules/clusterBackground.js +0 -27
- package/components/leaflet-map/modules/clusterBackground.js.map +0 -1
- package/components/leaflet-map/modules/donut.d.ts +0 -3
- package/components/leaflet-map/modules/donut.js +0 -25
- package/components/leaflet-map/modules/donut.js.map +0 -1
- package/components/leaflet-map/modules/map.d.ts +0 -14
- package/components/leaflet-map/modules/map.js +0 -154
- package/components/leaflet-map/modules/map.js.map +0 -1
- package/components/leaflet-map/modules/node.d.ts +0 -9
- package/components/leaflet-map/modules/node.js +0 -162
- package/components/leaflet-map/modules/node.js.map +0 -1
- package/components/leaflet-map/modules/selectionRing.d.ts +0 -7
- package/components/leaflet-map/modules/selectionRing.js +0 -41
- package/components/leaflet-map/modules/selectionRing.js.map +0 -1
- package/components/leaflet-map/modules/utils.d.ts +0 -50
- package/components/leaflet-map/modules/utils.js +0 -210
- package/components/leaflet-map/modules/utils.js.map +0 -1
- package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +0 -1
- package/components/leaflet-map/renderer/map-style.d.ts +0 -4
- package/components/leaflet-map/renderer/map-style.js +0 -15
- package/components/leaflet-map/renderer/map-style.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js +0 -40
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js +0 -40
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js +0 -4981
- package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +0 -8
- package/components/leaflet-map/renderer/mapboxgl-layer.js +0 -27
- package/components/leaflet-map/renderer/mapboxgl-layer.js.map +0 -1
- package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +0 -4
- package/components/leaflet-map/renderer/mapboxgl-utils.js +0 -39
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +0 -1
- package/components/leaflet-map/renderer/maplibre-gl.css.js.map +0 -1
- package/components/leaflet-map/style.d.ts +0 -52
- package/components/leaflet-map/style.js +0 -183
- package/components/leaflet-map/style.js.map +0 -1
- package/components/leaflet-map/types.d.ts +0 -75
- package/components/leaflet-map/types.js +0 -15
- package/components/leaflet-map/types.js.map +0 -1
- package/components/line/config.d.ts +0 -30
- package/components/line/config.js +0 -17
- package/components/line/config.js.map +0 -1
- package/components/line/index.d.ts +0 -27
- package/components/line/index.js +0 -152
- package/components/line/index.js.map +0 -1
- package/components/line/style.d.ts +0 -6
- package/components/line/style.js.map +0 -1
- package/components/line/types.d.ts +0 -12
- package/components/nested-donut/config.d.ts +0 -59
- package/components/nested-donut/config.js +0 -19
- package/components/nested-donut/config.js.map +0 -1
- package/components/nested-donut/index.d.ts +0 -38
- package/components/nested-donut/index.js +0 -133
- package/components/nested-donut/index.js.map +0 -1
- package/components/nested-donut/modules/arc.d.ts +0 -17
- package/components/nested-donut/modules/arc.js +0 -50
- package/components/nested-donut/modules/arc.js.map +0 -1
- package/components/nested-donut/modules/label.d.ts +0 -7
- package/components/nested-donut/modules/label.js +0 -34
- package/components/nested-donut/modules/label.js.map +0 -1
- package/components/nested-donut/style.d.ts +0 -26
- package/components/nested-donut/style.js +0 -70
- package/components/nested-donut/style.js.map +0 -1
- package/components/nested-donut/types.d.ts +0 -24
- package/components/nested-donut/types.js +0 -11
- package/components/nested-donut/types.js.map +0 -1
- package/components/sankey/config.d.ts +0 -162
- package/components/sankey/config.js +0 -65
- package/components/sankey/config.js.map +0 -1
- package/components/sankey/index.d.ts +0 -59
- package/components/sankey/index.js +0 -306
- package/components/sankey/index.js.map +0 -1
- package/components/sankey/modules/label.d.ts +0 -23
- package/components/sankey/modules/label.js +0 -168
- package/components/sankey/modules/label.js.map +0 -1
- package/components/sankey/modules/link.d.ts +0 -14
- package/components/sankey/modules/link.js +0 -108
- package/components/sankey/modules/link.js.map +0 -1
- package/components/sankey/modules/node.d.ts +0 -10
- package/components/sankey/modules/node.js +0 -156
- package/components/sankey/modules/node.js.map +0 -1
- package/components/sankey/style.d.ts +0 -20
- package/components/sankey/style.js.map +0 -1
- package/components/sankey/types.d.ts +0 -84
- package/components/sankey/types.js +0 -34
- package/components/sankey/types.js.map +0 -1
- package/components/scatter/config.d.ts +0 -44
- package/components/scatter/config.js +0 -23
- package/components/scatter/config.js.map +0 -1
- package/components/scatter/index.d.ts +0 -28
- package/components/scatter/index.js +0 -167
- package/components/scatter/index.js.map +0 -1
- package/components/scatter/modules/point.d.ts +0 -7
- package/components/scatter/modules/point.js +0 -86
- package/components/scatter/modules/point.js.map +0 -1
- package/components/scatter/modules/utils.d.ts +0 -11
- package/components/scatter/modules/utils.js +0 -112
- package/components/scatter/modules/utils.js.map +0 -1
- package/components/scatter/style.d.ts +0 -5
- package/components/scatter/style.js.map +0 -1
- package/components/scatter/types.d.ts +0 -19
- package/components/stacked-bar/config.d.ts +0 -38
- package/components/stacked-bar/config.js +0 -20
- package/components/stacked-bar/config.js.map +0 -1
- package/components/stacked-bar/index.d.ts +0 -28
- package/components/stacked-bar/index.js +0 -208
- package/components/stacked-bar/index.js.map +0 -1
- package/components/stacked-bar/style.d.ts +0 -5
- package/components/stacked-bar/style.js.map +0 -1
- package/components/stacked-bar/types.d.ts +0 -5
- package/components/timeline/config.d.ts +0 -43
- package/components/timeline/config.js +0 -24
- package/components/timeline/config.js.map +0 -1
- package/components/timeline/index.d.ts +0 -41
- package/components/timeline/index.js +0 -244
- package/components/timeline/index.js.map +0 -1
- package/components/timeline/style.d.ts +0 -13
- package/components/timeline/style.js.map +0 -1
- package/components/tooltip/config.d.ts +0 -68
- package/components/tooltip/config.js +0 -20
- package/components/tooltip/config.js.map +0 -1
- package/components/tooltip/index.d.ts +0 -36
- package/components/tooltip/index.js +0 -184
- package/components/tooltip/index.js.map +0 -1
- package/components/tooltip/style.js.map +0 -1
- package/components/topojson-map/config.d.ts +0 -99
- package/components/topojson-map/config.js +0 -42
- package/components/topojson-map/config.js.map +0 -1
- package/components/topojson-map/index.d.ts +0 -52
- package/components/topojson-map/index.js +0 -355
- package/components/topojson-map/index.js.map +0 -1
- package/components/topojson-map/style.d.ts +0 -11
- package/components/topojson-map/style.js.map +0 -1
- package/components/topojson-map/types.d.ts +0 -78
- package/components/topojson-map/types.js +0 -80
- package/components/topojson-map/types.js.map +0 -1
- package/components/topojson-map/utils.d.ts +0 -3
- package/components/topojson-map/utils.js +0 -30
- package/components/topojson-map/utils.js.map +0 -1
- package/components/vis-controls/config.d.ts +0 -12
- package/components/vis-controls/config.js +0 -13
- package/components/vis-controls/config.js.map +0 -1
- package/components/vis-controls/index.d.ts +0 -14
- package/components/vis-controls/index.js +0 -52
- package/components/vis-controls/index.js.map +0 -1
- package/components/vis-controls/style.d.ts +0 -11
- package/components/vis-controls/style.js.map +0 -1
- package/components/vis-controls/types.d.ts +0 -13
- package/components/vis-controls/types.js +0 -8
- package/components/vis-controls/types.js.map +0 -1
- package/components/xy-labels/config.d.ts +0 -48
- package/components/xy-labels/config.js +0 -25
- package/components/xy-labels/config.js.map +0 -1
- package/components/xy-labels/index.d.ts +0 -15
- package/components/xy-labels/index.js +0 -87
- package/components/xy-labels/index.js.map +0 -1
- package/components/xy-labels/modules/label.d.ts +0 -9
- package/components/xy-labels/modules/label.js +0 -107
- package/components/xy-labels/modules/label.js.map +0 -1
- package/components/xy-labels/style.d.ts +0 -5
- package/components/xy-labels/style.js.map +0 -1
- package/components/xy-labels/types.d.ts +0 -23
- package/components/xy-labels/types.js +0 -9
- package/components/xy-labels/types.js.map +0 -1
- package/components.d.ts +0 -51
- package/components.js +0 -29
- package/components.js.map +0 -1
- package/containers/single-container/config.d.ts +0 -12
- package/containers/single-container/config.js +0 -12
- package/containers/single-container/config.js.map +0 -1
- package/containers/single-container/index.d.ts +0 -19
- package/containers/single-container/index.js +0 -128
- package/containers/single-container/index.js.map +0 -1
- package/containers/xy-container/config.d.ts +0 -99
- package/containers/xy-container/config.js +0 -30
- package/containers/xy-container/config.js.map +0 -1
- package/containers/xy-container/index.d.ts +0 -34
- package/containers/xy-container/index.js +0 -330
- package/containers/xy-container/index.js.map +0 -1
- package/containers.d.ts +0 -6
- package/containers.js +0 -4
- package/containers.js.map +0 -1
- package/core/component/config.d.ts +0 -58
- package/core/component/config.js +0 -14
- package/core/component/config.js.map +0 -1
- package/core/component/index.d.ts +0 -43
- package/core/component/index.js +0 -118
- package/core/component/index.js.map +0 -1
- package/core/component/types.d.ts +0 -2
- package/core/component/types.js +0 -2
- package/core/component/types.js.map +0 -1
- package/core/config/index.d.ts +0 -3
- package/core/config/index.js +0 -16
- package/core/config/index.js.map +0 -1
- package/core/container/config.d.ts +0 -48
- package/core/container/config.js +0 -29
- package/core/container/config.js.map +0 -1
- package/core/container/index.d.ts +0 -26
- package/core/container/index.js +0 -105
- package/core/container/index.js.map +0 -1
- package/core/xy-component/config.d.ts +0 -38
- package/core/xy-component/config.js +0 -20
- package/core/xy-component/config.js.map +0 -1
- package/core/xy-component/index.d.ts +0 -27
- package/core/xy-component/index.js +0 -74
- package/core/xy-component/index.js.map +0 -1
- package/data-models/core.d.ts +0 -6
- package/data-models/core.js +0 -14
- package/data-models/core.js.map +0 -1
- package/data-models/graph.d.ts +0 -24
- package/data-models/graph.js +0 -107
- package/data-models/graph.js.map +0 -1
- package/data-models/map-graph.d.ts +0 -21
- package/data-models/map-graph.js +0 -62
- package/data-models/map-graph.js.map +0 -1
- package/data-models/map.d.ts +0 -5
- package/data-models/map.js +0 -12
- package/data-models/map.js.map +0 -1
- package/data-models/series.d.ts +0 -6
- package/data-models/series.js +0 -19
- package/data-models/series.js.map +0 -1
- package/index.d.ts +0 -7
- package/index.js +0 -55
- package/index.js.map +0 -1
- package/maps/china-provinces.json.js +0 -140373
- package/maps/fr-regions.json.js +0 -14162
- package/maps/germany-regions.json.js +0 -35760
- package/maps/ind-regions.json.js +0 -290584
- package/maps/uk-regions.json.js +0 -96233
- package/maps/us-counties.json.js +0 -206318
- package/maps/us-states.json.js +0 -16345
- package/maps/world-110m-alpha.json.js +0 -251366
- package/maps/world-simple.json.js +0 -89428
- package/maps/world-simplest.json.js +0 -28175
- package/maps.d.ts +0 -60
- package/maps.js +0 -23
- package/styles/colors.d.ts +0 -7
- package/styles/colors.js +0 -24
- package/styles/colors.js.map +0 -1
- package/styles/index.d.ts +0 -7
- package/styles/index.js +0 -38
- package/styles/index.js.map +0 -1
- package/styles/sizes.d.ts +0 -2
- package/styles/sizes.js.map +0 -1
- package/types/accessor.d.ts +0 -5
- package/types/accessor.js +0 -2
- package/types/accessor.js.map +0 -1
- package/types/component.d.ts +0 -13
- package/types/component.js +0 -14
- package/types/component.js.map +0 -1
- package/types/curve.d.ts +0 -40
- package/types/curve.js +0 -46
- package/types/curve.js.map +0 -1
- package/types/data.d.ts +0 -7
- package/types/data.js +0 -2
- package/types/data.js.map +0 -1
- package/types/direction.d.ts +0 -6
- package/types/direction.js +0 -10
- package/types/direction.js.map +0 -1
- package/types/graph.d.ts +0 -35
- package/types/graph.js +0 -2
- package/types/graph.js.map +0 -1
- package/types/map.d.ts +0 -4
- package/types/map.js +0 -2
- package/types/map.js.map +0 -1
- package/types/misc.d.ts +0 -8
- package/types/position.d.ts +0 -20
- package/types/position.js +0 -27
- package/types/position.js.map +0 -1
- package/types/scale.d.ts +0 -23
- package/types/scale.js +0 -27
- package/types/scale.js.map +0 -1
- package/types/shape.d.ts +0 -7
- package/types/shape.js +0 -11
- package/types/shape.js.map +0 -1
- package/types/spacing.d.ts +0 -6
- package/types/spacing.js +0 -2
- package/types/spacing.js.map +0 -1
- package/types/svg.d.ts +0 -18
- package/types/svg.js +0 -22
- package/types/svg.js.map +0 -1
- package/types/symbol.d.ts +0 -18
- package/types/symbol.js +0 -24
- package/types/symbol.js.map +0 -1
- package/types/text.d.ts +0 -47
- package/types/text.js +0 -26
- package/types/text.js.map +0 -1
- package/types.d.ts +0 -27
- package/types.js +0 -30
- package/types.js.map +0 -1
- package/utils/color.d.ts +0 -10
- package/utils/color.js +0 -32
- package/utils/color.js.map +0 -1
- package/utils/d3.d.ts +0 -3
- package/utils/d3.js +0 -16
- package/utils/d3.js.map +0 -1
- package/utils/data.d.ts +0 -45
- package/utils/data.js +0 -274
- package/utils/data.js.map +0 -1
- package/utils/html.d.ts +0 -1
- package/utils/html.js +0 -16
- package/utils/html.js.map +0 -1
- package/utils/map.d.ts +0 -2
- package/utils/map.js +0 -20
- package/utils/map.js.map +0 -1
- package/utils/misc.d.ts +0 -9
- package/utils/misc.js +0 -47
- package/utils/misc.js.map +0 -1
- package/utils/path.d.ts +0 -23
- package/utils/path.js +0 -144
- package/utils/path.js.map +0 -1
- package/utils/scale.d.ts +0 -1
- package/utils/style.d.ts +0 -6
- package/utils/style.js +0 -24
- package/utils/style.js.map +0 -1
- package/utils/svg.d.ts +0 -3
- package/utils/text.d.ts +0 -139
- package/utils/text.js +0 -443
- package/utils/text.js.map +0 -1
- package/utils/type.d.ts +0 -5
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Selection } from 'd3-selection'
|
|
2
|
+
|
|
3
|
+
// Types
|
|
4
|
+
import { NumericAccessor, BooleanAccessor } from 'types/accessor'
|
|
5
|
+
import { Position } from 'types/position'
|
|
6
|
+
import { GraphInputLink, GraphInputNode } from 'types/graph'
|
|
7
|
+
import { Spacing } from 'types/spacing'
|
|
8
|
+
|
|
9
|
+
// Utils
|
|
10
|
+
import { getBoolean, isPlainObject } from 'utils/data'
|
|
11
|
+
|
|
12
|
+
// Local Types
|
|
13
|
+
import { GraphNode, GraphPanel, GraphPanelConfig } from '../../types'
|
|
14
|
+
|
|
15
|
+
// Config
|
|
16
|
+
import { GraphConfig } from '../../config'
|
|
17
|
+
|
|
18
|
+
// Helpers
|
|
19
|
+
import { getX, getY, getNodeSize } from '../node/helper'
|
|
20
|
+
|
|
21
|
+
// Styles
|
|
22
|
+
import * as nodeSelectors from '../node/style'
|
|
23
|
+
|
|
24
|
+
export const DEFAULT_PADDING = 15
|
|
25
|
+
export const DEFAULT_LABEL_MARGIN = 16
|
|
26
|
+
export const OUTLINE_SELECTION_PADDING = 5
|
|
27
|
+
export const DEFAULT_SIDE_LABEL_SIZE = 25
|
|
28
|
+
|
|
29
|
+
export function getPanelPadding (padding: number | Spacing | undefined): Spacing {
|
|
30
|
+
const isPaddingAnObject = isPlainObject(padding)
|
|
31
|
+
return {
|
|
32
|
+
left: (isPaddingAnObject ? (padding as Spacing).left : (padding as number)) ?? DEFAULT_PADDING,
|
|
33
|
+
right: (isPaddingAnObject ? (padding as Spacing).right : (padding as number)) ?? DEFAULT_PADDING,
|
|
34
|
+
top: (isPaddingAnObject ? (padding as Spacing).top : (padding as number)) ?? DEFAULT_PADDING,
|
|
35
|
+
bottom: (isPaddingAnObject ? (padding as Spacing).bottom : (padding as number)) ?? DEFAULT_PADDING,
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function initPanels (panelsConfig: GraphPanelConfig[] | undefined): GraphPanel[] {
|
|
40
|
+
const panels = (panelsConfig ?? []).map(p => ({
|
|
41
|
+
...p,
|
|
42
|
+
_padding: getPanelPadding(p.padding),
|
|
43
|
+
})) as GraphPanel[]
|
|
44
|
+
|
|
45
|
+
return panels
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function setPanelForNodes<N extends GraphInputNode, L extends GraphInputLink> (
|
|
49
|
+
panels: GraphPanel[],
|
|
50
|
+
nodes: GraphNode<N, L>[],
|
|
51
|
+
config: GraphConfig<N, L>
|
|
52
|
+
): void {
|
|
53
|
+
if (!panels) return
|
|
54
|
+
|
|
55
|
+
// For each node store its related panels
|
|
56
|
+
nodes.forEach(node => {
|
|
57
|
+
// Find all panels to which node belong
|
|
58
|
+
const nodePanels = panels.filter(panel => panel.nodes && panel.nodes.includes(node._id))
|
|
59
|
+
node._panels = nodePanels
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function setPanelBBox<N extends GraphInputNode, L extends GraphInputLink> (
|
|
64
|
+
panelConfig: GraphPanel,
|
|
65
|
+
panelNodes: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,
|
|
66
|
+
nodeSizeAccessor: NumericAccessor<N>,
|
|
67
|
+
nodeDisabledAccessor: BooleanAccessor<N>
|
|
68
|
+
): void {
|
|
69
|
+
const selection = panelNodes.select(`.${nodeSelectors.node}`)
|
|
70
|
+
if (selection.empty()) return
|
|
71
|
+
|
|
72
|
+
const labelApprxHeight = 40
|
|
73
|
+
const labelApprxWidth = 110
|
|
74
|
+
const labelMargin = 10
|
|
75
|
+
let box: { x1: number; x2: number; y1: number; y2: number }
|
|
76
|
+
|
|
77
|
+
selection.each((d, i) => {
|
|
78
|
+
const nodeSize = getNodeSize(d, nodeSizeAccessor, i)
|
|
79
|
+
const w = Math.max(nodeSize, labelApprxWidth)
|
|
80
|
+
const h = nodeSize + labelMargin + labelApprxHeight
|
|
81
|
+
// const nodeBBox = node.getBBox()
|
|
82
|
+
const yShift = 10 // This is hard to calculate, so we just use an approximation
|
|
83
|
+
|
|
84
|
+
const coords = {
|
|
85
|
+
x1: getX(d) - w / 2, // We use d.x and d.y instead of bBox values here because `gBBox` contains initial ...
|
|
86
|
+
y1: getY(d) - h / 2 + yShift, // ... coordinates (before transition starts), not target coordinates
|
|
87
|
+
x2: getX(d) + w / 2,
|
|
88
|
+
y2: getY(d) + h / 2 + yShift,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (!box) {
|
|
92
|
+
box = {
|
|
93
|
+
...coords,
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
if (box.x1 > coords.x1) box.x1 = coords.x1
|
|
97
|
+
if (box.y1 > coords.y1) box.y1 = coords.y1
|
|
98
|
+
if (box.x2 < coords.x2) box.x2 = coords.x2
|
|
99
|
+
if (box.y2 < coords.y2) box.y2 = coords.y2
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
panelConfig._x = box.x1 - panelConfig._padding.left
|
|
104
|
+
panelConfig._y = box.y1 - panelConfig._padding.top
|
|
105
|
+
panelConfig._width = box.x2 - box.x1 + panelConfig._padding.left + panelConfig._padding.right
|
|
106
|
+
panelConfig._height = box.y2 - box.y1 + panelConfig._padding.top + panelConfig._padding.bottom
|
|
107
|
+
panelConfig._disabled = selection.data()
|
|
108
|
+
.map((node, i) => getBoolean(node, nodeDisabledAccessor, node._index) || node._state.greyout)
|
|
109
|
+
.every(d => d)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function setPanelNumNodes<N extends GraphInputNode, L extends GraphInputLink> (
|
|
113
|
+
panelConfig: GraphPanel,
|
|
114
|
+
panelNodes: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>
|
|
115
|
+
): void {
|
|
116
|
+
panelConfig._numNodes = panelNodes.size()
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function updatePanelBBoxSize<N extends GraphInputNode, L extends GraphInputLink> (
|
|
120
|
+
nodesSelection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,
|
|
121
|
+
panels: GraphPanel[],
|
|
122
|
+
config: GraphConfig<N, L>
|
|
123
|
+
): void {
|
|
124
|
+
const { layoutNonConnectedAside } = config
|
|
125
|
+
if (!panels) return
|
|
126
|
+
|
|
127
|
+
panels.forEach(panelConfig => {
|
|
128
|
+
const panelNodes = nodesSelection.filter(node => {
|
|
129
|
+
return (!layoutNonConnectedAside || node._isConnected) && panelConfig.nodes.includes(node._id)
|
|
130
|
+
})
|
|
131
|
+
setPanelBBox(panelConfig, panelNodes, config.nodeSize, config.nodeDisabled)
|
|
132
|
+
})
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function updatePanelNumNodes<N extends GraphInputNode, L extends GraphInputLink> (
|
|
136
|
+
nodesSelection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,
|
|
137
|
+
panels: GraphPanel[],
|
|
138
|
+
config: GraphConfig<N, L>
|
|
139
|
+
): void {
|
|
140
|
+
const { layoutNonConnectedAside } = config
|
|
141
|
+
if (!panels) return
|
|
142
|
+
|
|
143
|
+
panels.forEach(panelConfig => {
|
|
144
|
+
const panelNodes = nodesSelection.filter(node => {
|
|
145
|
+
return (!layoutNonConnectedAside || node._isConnected) && panelConfig.nodes.includes(node._id)
|
|
146
|
+
})
|
|
147
|
+
setPanelNumNodes(panelConfig, panelNodes)
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function getLabelTranslateTransform<N extends GraphInputNode, L extends GraphInputLink> (panel: GraphPanel): string {
|
|
152
|
+
const x = panel._width / 2
|
|
153
|
+
const dy = DEFAULT_LABEL_MARGIN + (panel.dashedOutline ? OUTLINE_SELECTION_PADDING : 0)
|
|
154
|
+
const y = panel.labelPosition === Position.Bottom
|
|
155
|
+
? panel._height + dy
|
|
156
|
+
: -dy
|
|
157
|
+
|
|
158
|
+
return `translate(${x}, ${y})`
|
|
159
|
+
}
|
|
160
|
+
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { select, Selection } from 'd3-selection'
|
|
2
|
+
|
|
3
|
+
// Utils
|
|
4
|
+
import { trimString } from 'utils/text'
|
|
5
|
+
import { smartTransition } from 'utils/d3'
|
|
6
|
+
|
|
7
|
+
// Types
|
|
8
|
+
import { GraphInputLink, GraphInputNode } from 'types/graph'
|
|
9
|
+
|
|
10
|
+
// Local Types
|
|
11
|
+
import { GraphNode, GraphLink, GraphPanel } from '../../types'
|
|
12
|
+
|
|
13
|
+
// Config
|
|
14
|
+
import { GraphConfig } from '../../config'
|
|
15
|
+
|
|
16
|
+
// Helpers
|
|
17
|
+
import { setLabelRect } from '../node/helper'
|
|
18
|
+
import { getLabelTranslateTransform, OUTLINE_SELECTION_PADDING, DEFAULT_SIDE_LABEL_SIZE } from './helper'
|
|
19
|
+
|
|
20
|
+
// Styles
|
|
21
|
+
import * as panelSelectors from './style'
|
|
22
|
+
import { appendShape, updateShape } from '../shape'
|
|
23
|
+
|
|
24
|
+
export function createPanels<N extends GraphNode, L extends GraphLink> (
|
|
25
|
+
selection: Selection<SVGGElement, GraphPanel, SVGGElement, unknown>
|
|
26
|
+
): void {
|
|
27
|
+
selection
|
|
28
|
+
.attr('transform', d => `translate(${d._x}, ${d._y})`)
|
|
29
|
+
.style('opacity', 0)
|
|
30
|
+
|
|
31
|
+
selection.append('rect').attr('class', panelSelectors.panelSelection)
|
|
32
|
+
.attr('rx', 9)
|
|
33
|
+
.attr('ry', 9)
|
|
34
|
+
.attr('width', d => d._width)
|
|
35
|
+
.attr('height', d => d._height)
|
|
36
|
+
|
|
37
|
+
selection.append('rect').attr('class', panelSelectors.panel)
|
|
38
|
+
.attr('rx', 7)
|
|
39
|
+
.attr('ry', 7)
|
|
40
|
+
.attr('width', d => d._width)
|
|
41
|
+
.attr('height', d => d._height)
|
|
42
|
+
|
|
43
|
+
const panelLabel = selection.append('g').attr('class', panelSelectors.label)
|
|
44
|
+
.attr('transform', getLabelTranslateTransform)
|
|
45
|
+
panelLabel.append('rect').attr('class', panelSelectors.background)
|
|
46
|
+
panelLabel.append('text').attr('class', panelSelectors.labelText)
|
|
47
|
+
.attr('dy', '0.32em')
|
|
48
|
+
|
|
49
|
+
const sideIcon = selection.append('g')
|
|
50
|
+
.attr('class', panelSelectors.sideIconGroup)
|
|
51
|
+
.attr('transform', (d, i, elements) => {
|
|
52
|
+
const dx = -OUTLINE_SELECTION_PADDING
|
|
53
|
+
const dy = -OUTLINE_SELECTION_PADDING
|
|
54
|
+
return `translate(${d._width + dx}, ${-dy})`
|
|
55
|
+
})
|
|
56
|
+
appendShape(sideIcon, (d: GraphPanel) => d.sideIconShape, panelSelectors.sideIconShape, panelSelectors.customSideIcon)
|
|
57
|
+
sideIcon.append('text').attr('class', panelSelectors.sideIconSymbol)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function updatePanels<N extends GraphNode, L extends GraphLink> (
|
|
61
|
+
selection: Selection<SVGGElement, GraphPanel, SVGGElement, unknown>,
|
|
62
|
+
config: GraphConfig<GraphInputNode, GraphInputLink>,
|
|
63
|
+
duration: number
|
|
64
|
+
): void {
|
|
65
|
+
smartTransition(selection, duration)
|
|
66
|
+
.attr('transform', d => `translate(${d._x}, ${d._y})`)
|
|
67
|
+
.style('opacity', d => d._disabled ? 0.4 : 1)
|
|
68
|
+
|
|
69
|
+
const panels = selection.selectAll<SVGRectElement, GraphPanel>(`.${panelSelectors.panel}`).data(d => [d])
|
|
70
|
+
smartTransition(panels, duration)
|
|
71
|
+
.attr('width', d => d._width)
|
|
72
|
+
.attr('height', d => d._height)
|
|
73
|
+
.style('stroke', d => d.borderColor)
|
|
74
|
+
.style('stroke-width', d => d.borderWidth)
|
|
75
|
+
|
|
76
|
+
const panelSelection = selection.select<SVGRectElement>(`.${panelSelectors.panelSelection}`)
|
|
77
|
+
.classed(panelSelectors.panelSelectionActive, d => d.dashedOutline)
|
|
78
|
+
|
|
79
|
+
smartTransition(panelSelection, duration)
|
|
80
|
+
.attr('x', d => -OUTLINE_SELECTION_PADDING)
|
|
81
|
+
.attr('y', d => -OUTLINE_SELECTION_PADDING)
|
|
82
|
+
.attr('width', d => d._width + OUTLINE_SELECTION_PADDING * 2)
|
|
83
|
+
.attr('height', d => d._height + OUTLINE_SELECTION_PADDING * 2)
|
|
84
|
+
|
|
85
|
+
const sideIcon = selection.select<SVGGElement>(`.${panelSelectors.sideIconGroup}`)
|
|
86
|
+
|
|
87
|
+
sideIcon.select<SVGGElement>(`.${panelSelectors.sideIconShape}`)
|
|
88
|
+
.call(updateShape, (d: GraphPanel) => d.sideIconShape, (d: GraphPanel) => d.sideIconShapeSize ?? DEFAULT_SIDE_LABEL_SIZE)
|
|
89
|
+
.style('stroke', d => d.sideIconShapeStroke)
|
|
90
|
+
.style('cursor', d => d.sideIconCursor ?? null)
|
|
91
|
+
.style('opacity', d => d.sideIconShape ? 1 : 0)
|
|
92
|
+
|
|
93
|
+
sideIcon.select(`.${panelSelectors.sideIconSymbol}`)
|
|
94
|
+
.html(d => d.sideIconSymbol)
|
|
95
|
+
.attr('dy', 1)
|
|
96
|
+
.style('fill', d => d.sideIconSymbolColor)
|
|
97
|
+
.style('font-size', d => d.sideIconFontSize ?? ((d.sideIconShapeSize ?? DEFAULT_SIDE_LABEL_SIZE) / 2.5))
|
|
98
|
+
|
|
99
|
+
smartTransition(sideIcon, duration)
|
|
100
|
+
.attr('transform', d => {
|
|
101
|
+
const dx = -OUTLINE_SELECTION_PADDING
|
|
102
|
+
const dy = -OUTLINE_SELECTION_PADDING
|
|
103
|
+
return `translate(${d._width + dx}, ${-dy})`
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
const panelLabel = selection.select<SVGGElement>(`.${panelSelectors.label}`)
|
|
107
|
+
|
|
108
|
+
panelLabel.select<SVGTextElement>(`.${panelSelectors.labelText}`)
|
|
109
|
+
.text(d => trimString(d.label))
|
|
110
|
+
|
|
111
|
+
smartTransition(panelLabel, duration)
|
|
112
|
+
.attr('transform', getLabelTranslateTransform)
|
|
113
|
+
|
|
114
|
+
panelLabel
|
|
115
|
+
.on('mouseover', (event: MouseEvent, d) => {
|
|
116
|
+
const label = select<SVGGElement, GraphPanel<N, L>>(event.currentTarget as SVGGElement)
|
|
117
|
+
const labelContent = d.label
|
|
118
|
+
label.select('text').text(labelContent)
|
|
119
|
+
setLabelRect(label, labelContent, panelSelectors.labelText)
|
|
120
|
+
})
|
|
121
|
+
.on('mouseleave', (event: MouseEvent, d) => {
|
|
122
|
+
const label = select<SVGGElement, GraphPanel<N, L>>(event.currentTarget as SVGGElement)
|
|
123
|
+
const labelContent = trimString(d.label)
|
|
124
|
+
label.select('text').text(labelContent)
|
|
125
|
+
setLabelRect(label, labelContent, panelSelectors.labelText)
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function removePanels<N extends GraphNode, L extends GraphLink> (
|
|
130
|
+
selection: Selection<SVGGElement, GraphPanel, SVGGElement, unknown>,
|
|
131
|
+
config: GraphConfig<GraphInputNode, GraphInputLink>,
|
|
132
|
+
duration: number
|
|
133
|
+
): void {
|
|
134
|
+
smartTransition(selection, duration / 2)
|
|
135
|
+
.style('opacity', 0)
|
|
136
|
+
.remove()
|
|
137
|
+
}
|
package/{components/graph/modules/panel/style.js → src/components/graph/modules/panel/style.ts}
RENAMED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { css, injectGlobal } from '@emotion/css'
|
|
1
|
+
import { css, injectGlobal } from '@emotion/css'
|
|
2
2
|
|
|
3
|
-
const panels = css
|
|
3
|
+
export const panels = css`
|
|
4
4
|
label: panels;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
`
|
|
6
|
+
|
|
7
|
+
export const variables = injectGlobal`
|
|
7
8
|
:root {
|
|
8
9
|
--vis-graph-panel-border-color: #E6E9F3;
|
|
9
10
|
--vis-graph-panel-border-opacity: 0.9;
|
|
@@ -40,23 +41,27 @@ const variables = injectGlobal `
|
|
|
40
41
|
--vis-graph-panel-side-icon-shape-fill-color: var(--vis-dark-graph-panel-side-icon-shape-fill-color);
|
|
41
42
|
--vis-graph-panel-border-color: var(--vis-dark-graph-panel-border-color);
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
`
|
|
45
|
+
|
|
46
|
+
export const gPanel = css`
|
|
45
47
|
label: g-panel;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
`
|
|
49
|
+
|
|
50
|
+
export const panel = css`
|
|
48
51
|
label: panel;
|
|
49
52
|
|
|
50
53
|
stroke: var(--vis-graph-panel-border-color);
|
|
51
54
|
stroke-opacity: var(--vis-graph-panel-border-opacity);
|
|
52
55
|
fill: var(--vis-graph-panel-fill-color);
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
`
|
|
57
|
+
|
|
58
|
+
export const label = css`
|
|
55
59
|
label: label;
|
|
56
60
|
|
|
57
61
|
fill: var(--vis-graph-panel-label-color);
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
`
|
|
63
|
+
|
|
64
|
+
export const background = css`
|
|
60
65
|
label: background;
|
|
61
66
|
|
|
62
67
|
opacity: 0.9;
|
|
@@ -64,8 +69,9 @@ const background = css `
|
|
|
64
69
|
backdrop-filter: blur(2px);
|
|
65
70
|
fill: var(--vis-graph-panel-label-background);
|
|
66
71
|
stroke: none;
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
`
|
|
73
|
+
|
|
74
|
+
export const labelText = css`
|
|
69
75
|
label: label-text;
|
|
70
76
|
|
|
71
77
|
text-anchor: middle;
|
|
@@ -74,11 +80,13 @@ const labelText = css `
|
|
|
74
80
|
cursor: default;
|
|
75
81
|
stroke: none;
|
|
76
82
|
font-family: var(--vis-graph-panel-label-font-family, var(--vis-font-family));
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
`
|
|
84
|
+
|
|
85
|
+
export const panelSelectionActive = css`
|
|
79
86
|
label: active;
|
|
80
|
-
|
|
81
|
-
|
|
87
|
+
`
|
|
88
|
+
|
|
89
|
+
export const panelSelection = css`
|
|
82
90
|
label: panel-selection-outline;
|
|
83
91
|
|
|
84
92
|
opacity: 0;
|
|
@@ -93,24 +101,29 @@ const panelSelection = css `
|
|
|
93
101
|
opacity: 1;
|
|
94
102
|
stroke-opacity: 0.75;
|
|
95
103
|
}
|
|
96
|
-
|
|
97
|
-
|
|
104
|
+
`
|
|
105
|
+
|
|
106
|
+
export const greyout = css`
|
|
98
107
|
label: greyout;
|
|
99
108
|
opacity: 0.4;
|
|
100
|
-
|
|
101
|
-
|
|
109
|
+
`
|
|
110
|
+
|
|
111
|
+
export const sideIconGroup = css`
|
|
102
112
|
label: side-icon-group;
|
|
103
|
-
|
|
104
|
-
|
|
113
|
+
`
|
|
114
|
+
|
|
115
|
+
export const sideIconShape = css`
|
|
105
116
|
label: side-icon-shape;
|
|
106
117
|
|
|
107
118
|
fill: var(--vis-graph-panel-side-icon-shape-fill-color);
|
|
108
119
|
stroke-width: 2px;
|
|
109
|
-
|
|
110
|
-
|
|
120
|
+
`
|
|
121
|
+
|
|
122
|
+
export const customSideIcon = css`
|
|
111
123
|
label: side-icon-custom;
|
|
112
|
-
|
|
113
|
-
|
|
124
|
+
`
|
|
125
|
+
|
|
126
|
+
export const sideIconSymbol = css`
|
|
114
127
|
label: side-label-icon-text;
|
|
115
128
|
font-family: var(--vis-graph-icon-font-family), var(--vis-font-family);
|
|
116
129
|
fill: var(--vis-graph-panel-side-icon-symbol-color);
|
|
@@ -119,7 +132,4 @@ const sideIconSymbol = css `
|
|
|
119
132
|
text-anchor: middle;
|
|
120
133
|
pointer-events: none;
|
|
121
134
|
cursor: default;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
export { background, customSideIcon, gPanel, greyout, label, labelText, panel, panelSelection, panelSelectionActive, panels, sideIconGroup, sideIconShape, sideIconSymbol, variables };
|
|
125
|
-
//# sourceMappingURL=style.js.map
|
|
135
|
+
`
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Selection, select } from 'd3-selection'
|
|
2
|
+
|
|
3
|
+
// Types
|
|
4
|
+
import { NumericAccessor, StringAccessor } from 'types/accessor'
|
|
5
|
+
|
|
6
|
+
// Utils
|
|
7
|
+
import { polygon } from 'utils/path'
|
|
8
|
+
import { getString } from 'utils/data'
|
|
9
|
+
|
|
10
|
+
// Types
|
|
11
|
+
|
|
12
|
+
// Local Types
|
|
13
|
+
import { GraphNodeShape } from '../types'
|
|
14
|
+
|
|
15
|
+
// Helpers
|
|
16
|
+
import { getNodeSize } from './node/helper'
|
|
17
|
+
|
|
18
|
+
export function isCustomXml (shape: GraphNodeShape): boolean {
|
|
19
|
+
return /<[a-z][\s\S]*>/i.test(shape)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function appendShape<T> (
|
|
23
|
+
selection: Selection<SVGGElement, T, SVGGElement, unknown>,
|
|
24
|
+
shapeAccessor: StringAccessor<T>,
|
|
25
|
+
shapeSelector: string,
|
|
26
|
+
customShapeSelector: string,
|
|
27
|
+
index?: number,
|
|
28
|
+
insertSelector = ':last-child'
|
|
29
|
+
): void {
|
|
30
|
+
selection.each((d, i, elements) => {
|
|
31
|
+
const element = select(elements[i])
|
|
32
|
+
const shape = getString(d, shapeAccessor, index) as GraphNodeShape
|
|
33
|
+
|
|
34
|
+
let shapeElement
|
|
35
|
+
const isCustomXmlShape = isCustomXml(shape)
|
|
36
|
+
if (isCustomXmlShape) {
|
|
37
|
+
shapeElement = element.insert('g', insertSelector)
|
|
38
|
+
.html(shape)
|
|
39
|
+
} else {
|
|
40
|
+
switch (shape) {
|
|
41
|
+
case GraphNodeShape.Square:
|
|
42
|
+
shapeElement = element.insert('rect', insertSelector)
|
|
43
|
+
.attr('rx', 5)
|
|
44
|
+
.attr('ry', 5)
|
|
45
|
+
break
|
|
46
|
+
case GraphNodeShape.Hexagon:
|
|
47
|
+
case GraphNodeShape.Triangle:
|
|
48
|
+
shapeElement = element.insert('path', insertSelector)
|
|
49
|
+
break
|
|
50
|
+
case GraphNodeShape.Circle:
|
|
51
|
+
default:
|
|
52
|
+
shapeElement = element.insert('circle', insertSelector)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return shapeElement.attr('class', shapeSelector)
|
|
57
|
+
.classed(customShapeSelector, isCustomXmlShape)
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function updateShape<T> (
|
|
62
|
+
selection: Selection<SVGGElement, T, SVGGElement, unknown>,
|
|
63
|
+
shape: StringAccessor<T>,
|
|
64
|
+
size: NumericAccessor<T>,
|
|
65
|
+
index: number
|
|
66
|
+
): void {
|
|
67
|
+
if (selection.size() === 0) return
|
|
68
|
+
|
|
69
|
+
const d: T = selection.datum()
|
|
70
|
+
const nodeSize = getNodeSize(d, size, index)
|
|
71
|
+
selection.filter('circle')
|
|
72
|
+
.attr('r', nodeSize / 2)
|
|
73
|
+
|
|
74
|
+
selection.filter('rect')
|
|
75
|
+
.attr('width', nodeSize)
|
|
76
|
+
.attr('height', nodeSize)
|
|
77
|
+
.attr('x', -nodeSize / 2)
|
|
78
|
+
.attr('y', -nodeSize / 2)
|
|
79
|
+
|
|
80
|
+
selection.filter('path')
|
|
81
|
+
.attr('d', () => {
|
|
82
|
+
let n: number
|
|
83
|
+
switch (getString(d, shape, index)) {
|
|
84
|
+
case GraphNodeShape.Square:
|
|
85
|
+
n = 4
|
|
86
|
+
break
|
|
87
|
+
case GraphNodeShape.Triangle:
|
|
88
|
+
n = 3
|
|
89
|
+
break
|
|
90
|
+
case GraphNodeShape.Hexagon:
|
|
91
|
+
default:
|
|
92
|
+
n = 6
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return polygon(nodeSize, n)
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
selection.filter('g')
|
|
99
|
+
.filter(() => !isCustomXml(getString(d, shape, index) as GraphNodeShape))
|
|
100
|
+
.html(getString(d, shape, index))
|
|
101
|
+
|
|
102
|
+
selection.filter('g')
|
|
103
|
+
.each((d, i, elements) => {
|
|
104
|
+
const el = select(elements[i])
|
|
105
|
+
const bBox = el.node().getBBox()
|
|
106
|
+
el.attr('transform', `translate(${-bBox.width / 2},${-bBox.height / 2})`)
|
|
107
|
+
})
|
|
108
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { css, injectGlobal } from '@emotion/css'
|
|
2
|
+
import { UNOVIS_ICON_FONT_FAMILY_DEFAULT } from 'styles/index'
|
|
3
|
+
|
|
4
|
+
// Nodes
|
|
5
|
+
import * as nodeSelectors from './modules/node/style'
|
|
6
|
+
|
|
7
|
+
// Links
|
|
8
|
+
import * as linkSelectors from './modules/link/style'
|
|
9
|
+
|
|
10
|
+
export const variables = injectGlobal`
|
|
11
|
+
:root {
|
|
12
|
+
--vis-graph-icon-font-family: ${UNOVIS_ICON_FONT_FAMILY_DEFAULT};
|
|
13
|
+
}
|
|
14
|
+
`
|
|
15
|
+
|
|
16
|
+
// General
|
|
17
|
+
export const root = css`
|
|
18
|
+
label: graph-component;
|
|
19
|
+
`
|
|
20
|
+
|
|
21
|
+
export const background = css`
|
|
22
|
+
label: background;
|
|
23
|
+
`
|
|
24
|
+
|
|
25
|
+
export const graphGroup = css`
|
|
26
|
+
label: graph-group;
|
|
27
|
+
`
|
|
28
|
+
|
|
29
|
+
export const zoomOutLevel1 = css`
|
|
30
|
+
label: zoom-out-level-1;
|
|
31
|
+
|
|
32
|
+
${`.${nodeSelectors.label}`} {
|
|
33
|
+
rect {
|
|
34
|
+
stroke: none;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`
|
|
38
|
+
|
|
39
|
+
export const zoomOutLevel2 = css`
|
|
40
|
+
label: zoom-out-level-2;
|
|
41
|
+
|
|
42
|
+
${`.${nodeSelectors.label}`} {
|
|
43
|
+
visibility: visible;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
${`.${nodeSelectors.nodeGauge}`} {
|
|
47
|
+
visibility: visible;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
${`.${nodeSelectors.node}`} {
|
|
51
|
+
stroke-width: 4px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
rect${`.${nodeSelectors.node}`} {
|
|
55
|
+
stroke-width: 2px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
${`.${linkSelectors.gLink}`} {
|
|
59
|
+
animation: none;
|
|
60
|
+
stroke-dasharray: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
${`.${linkSelectors.flowCircle}`} {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
${`.${nodeSelectors.nodeSelection}`} {
|
|
68
|
+
&${`.${nodeSelectors.nodeSelectionActive}`} {
|
|
69
|
+
transform: scale(1.15);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`
|