Skip to content

Commit

Permalink
Force-Directed Edge Bundling (#267) (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics authored Jan 16, 2024
1 parent 30baf92 commit 74d1057
Show file tree
Hide file tree
Showing 31 changed files with 2,261 additions and 50 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Imports:
withr,
cli,
vctrs,
lifecycle
lifecycle,
memoise
Suggests:
network,
knitr,
Expand Down
22 changes: 22 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ export(StatEdgeArc2)
export(StatEdgeBend)
export(StatEdgeBend0)
export(StatEdgeBend2)
export(StatEdgeBundleForce)
export(StatEdgeBundleForce0)
export(StatEdgeBundleForce2)
export(StatEdgeBundleMinimal)
export(StatEdgeBundleMinimal0)
export(StatEdgeBundleMinimal2)
export(StatEdgeBundlePath)
export(StatEdgeBundlePath0)
export(StatEdgeBundlePath2)
export(StatEdgeDensity)
export(StatEdgeDiagonal)
export(StatEdgeDiagonal0)
Expand Down Expand Up @@ -91,6 +100,15 @@ export(geom_edge_arc2)
export(geom_edge_bend)
export(geom_edge_bend0)
export(geom_edge_bend2)
export(geom_edge_bundle_force)
export(geom_edge_bundle_force0)
export(geom_edge_bundle_force2)
export(geom_edge_bundle_minimal)
export(geom_edge_bundle_minimal0)
export(geom_edge_bundle_minimal2)
export(geom_edge_bundle_path)
export(geom_edge_bundle_path0)
export(geom_edge_bundle_path2)
export(geom_edge_density)
export(geom_edge_diagonal)
export(geom_edge_diagonal0)
Expand Down Expand Up @@ -314,6 +332,7 @@ importFrom(grid,setChildren)
importFrom(grid,textGrob)
importFrom(grid,unit)
importFrom(igraph,"%--%")
importFrom(igraph,"V<-")
importFrom(igraph,"vertex_attr<-")
importFrom(igraph,E)
importFrom(igraph,V)
Expand All @@ -331,13 +350,15 @@ importFrom(igraph,delete_vertex_attr)
importFrom(igraph,distances)
importFrom(igraph,edge_attr)
importFrom(igraph,ends)
importFrom(igraph,get.edge.ids)
importFrom(igraph,gorder)
importFrom(igraph,graph_attr)
importFrom(igraph,gsize)
importFrom(igraph,incident_edges)
importFrom(igraph,induced_subgraph)
importFrom(igraph,is.directed)
importFrom(igraph,is.named)
importFrom(igraph,is_directed)
importFrom(igraph,layout_as_bipartite)
importFrom(igraph,layout_as_star)
importFrom(igraph,layout_as_tree)
Expand All @@ -355,6 +376,7 @@ importFrom(igraph,layout_with_kk)
importFrom(igraph,layout_with_lgl)
importFrom(igraph,layout_with_mds)
importFrom(igraph,layout_with_sugiyama)
importFrom(igraph,mst)
importFrom(igraph,neighbors)
importFrom(igraph,permute)
importFrom(igraph,shortest_paths)
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
* Updated layout functions from the graphlayouts package to support grouped and
constrained versions (centrality, focus, and stress layouts)
* Added H Tree layout for binary trees (#58)
* Added `geom_edge_bundle_force()`, `geom_edge_bundle_path()`, and
`geom_edge_bundle_minimal()` (+ variants) to provide support for edge bundling
(#267)

# ggraph 2.1.0

Expand Down
4 changes: 4 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ dendrogram_spread <- function(graph, starts, y, leaf, repel, pad, ratio) {
.Call('_ggraph_dendrogram_spread', PACKAGE = 'ggraph', graph, starts, y, leaf, repel, pad, ratio)
}

force_bundle_iter <- function(edges_xy, elist, K, C, P, P_rate, S, I, I_rate, compatibility_threshold, eps) {
.Call('_ggraph_force_bundle_iter', PACKAGE = 'ggraph', edges_xy, elist, K, C, P, P_rate, S, I, I_rate, compatibility_threshold, eps)
}

hTree <- function(parent, order) {
.Call('_ggraph_hTree', PACKAGE = 'ggraph', parent, order)
}
Expand Down
2 changes: 1 addition & 1 deletion R/geom_edge.R
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ GeomEdgeBspline <- ggproto('GeomEdgeBspline', GeomBspline0,
na.rm = FALSE) {
names(data) <- sub('edge_', '', names(data))
names(data)[names(data) == 'width'] <- 'linewidth'
GeomBspline0$draw_panel(data, panel_scales, coord, arrow, lineend, linejoin, linemitre, na.rm)
GeomBspline0$draw_panel(data, panel_scales, coord, arrow, type = "clamped", lineend, linejoin, linemitre, na.rm)
},
draw_key = function(data, params, size) {
segmentsGrob(0.1, 0.5, 0.9, 0.5,
Expand Down
Loading

0 comments on commit 74d1057

Please sign in to comment.