Implements edge-path bundling.
Usage
edge_bundle_path(
g,
xy,
max_distortion = 2,
weight_fac = 2,
segments = 20,
bundle_strength = 1,
mode = "out"
)
Details
This is a re-implementation of https://github.com/mwallinger-tu/edge-path-bundling
see online for plotting tips
References
Wallinger, M., Archambault, D., Auber, D., Nollenburg, M., & Peltonen, J. (2021). Edge-Path Bundling: A Less Ambiguous Edge Bundling Approach. IEEE Transactions on Visualization and Computer Graphics.
Examples
library(igraph)
g <- graph_from_edgelist(matrix(c(
1, 2, 1, 6,
1, 4, 2, 3, 3, 4, 4, 5, 5, 6
), ncol = 2, byrow = TRUE), FALSE)
xy <- cbind(c(0, 10, 25, 40, 50, 50), c(0, 15, 25, 15, 0, -10))
edge_bundle_path(g, xy)
#> x y index group
#> 1 0.0000000 0.0000000 0.00000000 1
#> 2 0.5263158 0.7894737 0.05263158 1
#> 3 1.0526316 1.5789474 0.10526316 1
#> 4 1.5789474 2.3684211 0.15789474 1
#> 5 2.1052632 3.1578947 0.21052632 1
#> 6 2.6315789 3.9473684 0.26315789 1
#> 7 3.1578947 4.7368421 0.31578947 1
#> 8 3.6842105 5.5263158 0.36842105 1
#> 9 4.2105263 6.3157895 0.42105263 1
#> 10 4.7368421 7.1052632 0.47368421 1
#> 11 5.2631579 7.8947368 0.52631579 1
#> 12 5.7894737 8.6842105 0.57894737 1
#> 13 6.3157895 9.4736842 0.63157895 1
#> 14 6.8421053 10.2631579 0.68421053 1
#> 15 7.3684211 11.0526316 0.73684211 1
#> 16 7.8947368 11.8421053 0.78947368 1
#> 17 8.4210526 12.6315789 0.84210526 1
#> 18 8.9473684 13.4210526 0.89473684 1
#> 19 9.4736842 14.2105263 0.94736842 1
#> 20 10.0000000 15.0000000 1.00000000 1
#> 21 0.0000000 0.0000000 0.00000000 2
#> 22 2.7627934 3.7881321 0.05263158 2
#> 23 5.7588570 7.1837313 0.10526316 2
#> 24 8.9444525 10.0948993 0.15789474 2
#> 25 12.2758420 12.4539689 0.21052632 2
#> 26 15.7092871 14.2158088 0.26315789 2
#> 27 19.2010497 15.3561267 0.31578947 2
#> 28 22.7073917 15.8697734 0.36842105 2
#> 29 26.1845750 15.7690464 0.42105263 2
#> 30 29.5888614 15.0819939 0.47368421 2
#> 31 32.8765126 13.8507184 0.52631579 2
#> 32 36.0037906 12.1296806 0.57894737 2
#> 33 38.9269573 9.9840031 0.63157895 2
#> 34 41.6022744 7.4877741 0.68421053 2
#> 35 43.9860038 4.7223516 0.73684211 2
#> 36 46.0344073 1.7746665 0.78947368 2
#> 37 47.7037469 -1.2644729 0.84210526 2
#> 38 48.9502843 -4.3020776 0.89473684 2
#> 39 49.7302814 -7.2446740 0.94736842 2
#> 40 50.0000000 -10.0000000 1.00000000 2
#> 41 0.0000000 0.0000000 0.00000000 3
#> 42 1.6197696 2.3246829 0.05263158 3
#> 43 3.3182680 4.5531419 0.10526316 3
#> 44 5.0911212 6.6722554 0.15789474 3
#> 45 6.9339554 8.6689022 0.21052632 3
#> 46 8.8423969 10.5299606 0.26315789 3
#> 47 10.8120717 12.2423094 0.31578947 3
#> 48 12.8386062 13.7928269 0.36842105 3
#> 49 14.9176265 15.1683919 0.42105263 3
#> 50 17.0447587 16.3558828 0.47368421 3
#> 51 19.2156291 17.3421782 0.52631579 3
#> 52 21.4258638 18.1141566 0.57894737 3
#> 53 23.6710891 18.6586966 0.63157895 3
#> 54 25.9469310 18.9626768 0.68421053 3
#> 55 28.2490159 19.0129757 0.73684211 3
#> 56 30.5729698 18.7964718 0.78947368 3
#> 57 32.9144190 18.3000437 0.84210526 3
#> 58 35.2689896 17.5105701 0.89473684 3
#> 59 37.6323079 16.4149293 0.94736842 3
#> 60 40.0000000 15.0000000 1.00000000 3
#> 61 10.0000000 15.0000000 0.00000000 4
#> 62 10.7894737 15.5263158 0.05263158 4
#> 63 11.5789474 16.0526316 0.10526316 4
#> 64 12.3684211 16.5789474 0.15789474 4
#> 65 13.1578947 17.1052632 0.21052632 4
#> 66 13.9473684 17.6315789 0.26315789 4
#> 67 14.7368421 18.1578947 0.31578947 4
#> 68 15.5263158 18.6842105 0.36842105 4
#> 69 16.3157895 19.2105263 0.42105263 4
#> 70 17.1052632 19.7368421 0.47368421 4
#> 71 17.8947368 20.2631579 0.52631579 4
#> 72 18.6842105 20.7894737 0.57894737 4
#> 73 19.4736842 21.3157895 0.63157895 4
#> 74 20.2631579 21.8421053 0.68421053 4
#> 75 21.0526316 22.3684211 0.73684211 4
#> 76 21.8421053 22.8947368 0.78947368 4
#> 77 22.6315789 23.4210526 0.84210526 4
#> 78 23.4210526 23.9473684 0.89473684 4
#> 79 24.2105263 24.4736842 0.94736842 4
#> 80 25.0000000 25.0000000 1.00000000 4
#> 81 25.0000000 25.0000000 0.00000000 5
#> 82 25.7894737 24.4736842 0.05263158 5
#> 83 26.5789474 23.9473684 0.10526316 5
#> 84 27.3684211 23.4210526 0.15789474 5
#> 85 28.1578947 22.8947368 0.21052632 5
#> 86 28.9473684 22.3684211 0.26315789 5
#> 87 29.7368421 21.8421053 0.31578947 5
#> 88 30.5263158 21.3157895 0.36842105 5
#> 89 31.3157895 20.7894737 0.42105263 5
#> 90 32.1052632 20.2631579 0.47368421 5
#> 91 32.8947368 19.7368421 0.52631579 5
#> 92 33.6842105 19.2105263 0.57894737 5
#> 93 34.4736842 18.6842105 0.63157895 5
#> 94 35.2631579 18.1578947 0.68421053 5
#> 95 36.0526316 17.6315789 0.73684211 5
#> 96 36.8421053 17.1052632 0.78947368 5
#> 97 37.6315789 16.5789474 0.84210526 5
#> 98 38.4210526 16.0526316 0.89473684 5
#> 99 39.2105263 15.5263158 0.94736842 5
#> 100 40.0000000 15.0000000 1.00000000 5
#> 101 40.0000000 15.0000000 0.00000000 6
#> 102 40.5263158 14.2105263 0.05263158 6
#> 103 41.0526316 13.4210526 0.10526316 6
#> 104 41.5789474 12.6315789 0.15789474 6
#> 105 42.1052632 11.8421053 0.21052632 6
#> 106 42.6315789 11.0526316 0.26315789 6
#> 107 43.1578947 10.2631579 0.31578947 6
#> 108 43.6842105 9.4736842 0.36842105 6
#> 109 44.2105263 8.6842105 0.42105263 6
#> 110 44.7368421 7.8947368 0.47368421 6
#> 111 45.2631579 7.1052632 0.52631579 6
#> 112 45.7894737 6.3157895 0.57894737 6
#> 113 46.3157895 5.5263158 0.63157895 6
#> 114 46.8421053 4.7368421 0.68421053 6
#> 115 47.3684211 3.9473684 0.73684211 6
#> 116 47.8947368 3.1578947 0.78947368 6
#> 117 48.4210526 2.3684211 0.84210526 6
#> 118 48.9473684 1.5789474 0.89473684 6
#> 119 49.4736842 0.7894737 0.94736842 6
#> 120 50.0000000 0.0000000 1.00000000 6
#> 121 50.0000000 0.0000000 0.00000000 7
#> 122 50.0000000 -0.5263158 0.05263158 7
#> 123 50.0000000 -1.0526316 0.10526316 7
#> 124 50.0000000 -1.5789474 0.15789474 7
#> 125 50.0000000 -2.1052632 0.21052632 7
#> 126 50.0000000 -2.6315789 0.26315789 7
#> 127 50.0000000 -3.1578947 0.31578947 7
#> 128 50.0000000 -3.6842105 0.36842105 7
#> 129 50.0000000 -4.2105263 0.42105263 7
#> 130 50.0000000 -4.7368421 0.47368421 7
#> 131 50.0000000 -5.2631579 0.52631579 7
#> 132 50.0000000 -5.7894737 0.57894737 7
#> 133 50.0000000 -6.3157895 0.63157895 7
#> 134 50.0000000 -6.8421053 0.68421053 7
#> 135 50.0000000 -7.3684211 0.73684211 7
#> 136 50.0000000 -7.8947368 0.78947368 7
#> 137 50.0000000 -8.4210526 0.84210526 7
#> 138 50.0000000 -8.9473684 0.89473684 7
#> 139 50.0000000 -9.4736842 0.94736842 7
#> 140 50.0000000 -10.0000000 1.00000000 7