tnss_tree | R Documentation |
creates an approximated Steiner tree for a flow map visualization
tnss_tree(
g,
xy,
xydummy,
root,
gamma = 0.9,
epsilon = 0.3,
elen = Inf,
order = "random"
)
g |
original flow network (must be a one-to-many flow network, i.e star graph). Must have a weight attribute indicating the flow |
xy |
coordinates of "real" nodes |
xydummy |
coordinates of "dummy" nodes |
root |
root node id of the flow |
gamma |
edge length decay parameter |
epsilon |
percentage of points keept on a line after straightening with Visvalingam Algorithm |
elen |
maximal length of edges in triangulation |
order |
in which order shortest paths are calculated ("random","weight","near","far") |
Use tnss_smooth to smooth the edges of the tree
approximated Steiner tree from dummy and real nodes as igraph object
David Schoch
Sun, Shipeng. "An automated spatial flow layout algorithm using triangulation, approximate Steiner tree, and path smoothing." AutoCarto, 2016.
xy <- cbind(state.center$x, state.center$y)[!state.name %in% c("Alaska", "Hawaii"), ]
xy_dummy <- tnss_dummies(xy, root = 4)
gtree <- tnss_tree(cali2010, xy, xy_dummy, root = 4, gamma = 0.9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.