Title: | Circle Plot with Bundled Edges |
Version: | 0.1.4 |
Date: | 2016-03-18 |
Description: | Generates interactive circle plots with the nodes around the circumference and linkages between the connected nodes using hierarchical edge bundling via the D3 JavaScript library. See http://d3js.org/ for more information on D3. |
License: | GPL (≥ 3) |
LazyData: | true |
Depends: | R (≥ 3.1.2) |
Imports: | htmlwidgets (≥ 0.3.2), rjson, igraph, shiny |
Suggests: | knitr, huge |
URL: | https://github.com/garthtarr/edgebundleR |
RoxygenNote: | 5.0.1 |
NeedsCompilation: | no |
Packaged: | 2016-03-19 05:32:51 UTC; garthtarr |
Author: | Mike Bostock [aut, cph] (d3.js library and much of edgebundle code in htmlwidgets/lib, http://d3js.org), Ellis Patrick [aut], Kent Russell [ctb], Garth Tarr [aut, cre] |
Maintainer: | Garth Tarr <garth.tarr@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2016-03-19 10:14:37 |
Helper function to convert adjacency matrix to edges
Description
Helper function to convert adjacency matrix to edges
Usage
adjToEdge(adj)
Arguments
adj |
an adjacency matrix |
Helper function to convert an igraph to JSON
Description
Helper function to convert an igraph to JSON
Usage
edgeToJSON_igraph(graph)
Arguments
graph |
an igraph |
Helper function to convert edges to JSON
Description
Helper function to convert edges to JSON
Usage
edgeToJSON_matrix(edges)
Arguments
edges |
a matrix of edge relationships |
Circle plot with bundled edges
Description
Takes an appropriately structured JSON file or a square symmetric matrix (e.g. a correlation matrix or precision matrix) and outputs a circle plot with the nodes around the circumfrence and linkages between the connected nodes. Adapted from the Mike Bostock's D3 Hierarchical Edge Bundling example using the htmlwidgets framework.
Usage
edgebundle(x, tension = 0.5, cutoff = 0.1, width = NULL, fontsize = 14,
padding = 100, nodesize = c(5, 20), directed = FALSE)
Arguments
x |
an appropriately structured JSON file (see vignette for details) or a square symmetric matrix (e.g. correlation matrix) or an igraph object. |
tension |
numeric between 0 and 1 giving the tension of the links |
cutoff |
numeric giving the threshold dependence for linkages to be plotted |
width |
the width of the plot when viewed externally |
fontsize |
font size of the node labels |
padding |
the padding (in px) between the inner radius of links and the edge of the plot. Increase this when the labels run outside the edges of the plot. Default: 100. |
nodesize |
two element vector of the min and max node size to scale the node circle size. If a size is not provided for each node, then the node size will be the max node size provided in this argument. Default: c(5,20). |
directed |
whether or not the graph is directed. Does not work yet. Need to think about how to implement this cleanly. |
Examples
## Not run:
require(igraph)
ws_graph = watts.strogatz.game(1, 50, 4, 0.05)
edgebundle(ws_graph,tension = 0.1,fontsize = 20)
## End(Not run)
Widget output function for use in Shiny
Description
Widget output function for use in Shiny
Usage
edgebundleOutput(outputId, width = "100%", height = "400px")
Arguments
outputId |
Shiny output ID |
width |
width default '100%' |
height |
height default '400px' |
Flare software class hierarchy
Description
A JSON file enumerating the dependencies between classes in a software class hierarchy. Dependencies are bundled according to the parent packages.
Format
A JSON data file (with txt extension for R)
Details
Sourced from Mike Bostock's examples, see here: http://bl.ocks.org/mbostock/raw/7607999/
Examples
## Not run:
filepath = system.file("sampleData", "flare-imports.json", package = "edgebundleR")
edgebundle(filepath,width=800,height=800,fontsize=8,tension=0.95)
## End(Not run)
Widget render function for use in Shiny
Description
Widget render function for use in Shiny
Usage
renderEdgebundle(expr, env = parent.frame(), quoted = FALSE)
Arguments
expr |
edgebundle expression |
env |
environment |
quoted |
logical, default = FALSE |
Save a edge bundle to an HTML file
Description
Save a edge buyndle graph to an HTML file for sharing with others. The HTML can include it's dependencies in an adjacent directory or can bundle all dependencies into the HTML file (via base64 encoding).
Usage
saveEdgebundle(x, file, selfcontained = TRUE)
Arguments
x |
plot to save (e.g. result of calling the function
|
file |
File to save HTML into |
selfcontained |
Whether to save the HTML as a single self-contained file (with external resources base64 encoded) or a file with external resources placed in an adjacent directory. |
Shiny interface to the edgebundle function
Description
Opens a shiny GUI to facilitate interaction with the edgebundle function
Usage
shinyedge(x)
Arguments
x |
an appropriately structured JSON file (see vignette for details) or a square symmetric matrix (e.g. correlation matrix) or an igraph object. |