Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve arg syntax for gplot and cleanup repo #180

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,22 @@ locs_x, locs_y = shell_layout(g, nlist)
gplot(g, locs_x, locs_y, nodelabel=nodelabel)
```

### stress majorize layout
```julia
gplot(g, layout=stressmajorize_layout)
```

### community layout
```julia
community_id = rand(1:3, nv(g)) #membership for each node
node_c = [colorant"red",colorant"yellow",colorant"blue"] #colors for each community
locs_x, locs_y = community_layout(g,community_id)
gplot(g, locs_x, locs_y, nodefillc = node_c[community_id])
```

## Curve edge
```julia
gplot(g, linetype="curve")
gplot(g, linetype=:curve)
```

## Show plot
Expand Down Expand Up @@ -159,29 +172,29 @@ gplot(h)
+ `locs_x, locs_y` Locations of the nodes (will be normalized and centered). If not specified, will be obtained from `layout` kwarg.

# Keyword Arguments
+ `layout` Layout algorithm: `random_layout`, `circular_layout`, `spring_layout`, `shell_layout`, `stressmajorize_layout`, `spectral_layout`. Default: `spring_layout`
+ `NODESIZE` Max size for the nodes. Default: `3.0/sqrt(N)`
+ `layout` Layout algorithm: `random_layout`, `circular_layout`, `spring_layout`, `shell_layout`, `stressmajorize_layout`, `spectral_layout`, `community_layout`. Default: `spring_layout`
+ `max_nodesize` Max size for the nodes. Default: `3.0/sqrt(N)`
+ `nodesize` Relative size for the nodes, can be a Vector. Default: `1.0`
+ `nodelabel` Labels for the vertices, a Vector or nothing. Default: `nothing`
+ `nodelabelc` Color for the node labels, can be a Vector. Default: `colorant"black"`
+ `nodelabeldist` Distances for the node labels from center of nodes. Default: `0.0`
+ `nodelabelangleoffset` Angle offset for the node labels. Default: `π/4.0`
+ `NODELABELSIZE` Largest fontsize for the vertice labels. Default: `4.0`
+ `nodelabelangleoffset` Angle offset for the node labels (only used when `nodelabeldist` is not zero). Default: `π/4.0`
+ `max_nodelabelsize` Largest fontsize for the vertice labels. Default: `4.0`
+ `nodelabelsize` Relative fontsize for the vertice labels, can be a Vector. Default: `1.0`
+ `nodefillc` Color to fill the nodes with, can be a Vector. Default: `colorant"turquoise"`
+ `nodestrokec` Color for the nodes stroke, can be a Vector. Default: `nothing`
+ `nodestrokelw` Line width for the nodes stroke, can be a Vector. Default: `0.0`
+ `edgelabel` Labels for the edges, a Vector or nothing. Default: `[]`
+ `edgelabel` Labels for the edges, a Vector or nothing. Default: `nothing`
+ `edgelabelc` Color for the edge labels, can be a Vector. Default: `colorant"black"`
+ `edgelabeldistx, edgelabeldisty` Distance for the edge label from center of edge. Default: `0.0`
+ `EDGELABELSIZE` Largest fontsize for the edge labels. Default: `4.0`
+ `max_edgelabelsize` Largest fontsize for the edge labels. Default: `4.0`
+ `edgelabelsize` Relative fontsize for the edge labels, can be a Vector. Default: `1.0`
+ `EDGELINEWIDTH` Max line width for the edges. Default: `0.25/sqrt(N)`
+ `max_edgelinewidth` Max line width for the edges. Default: `0.25/sqrt(N)`
+ `edgelinewidth` Relative line width for the edges, can be a Vector. Default: `1.0`
+ `edgestrokec` Color for the edge strokes, can be a Vector. Default: `colorant"lightgray"`
+ `arrowlengthfrac` Fraction of line length to use for arrows. Equal to 0 for undirected graphs. Default: `0.1` for the directed graphs
+ `arrowangleoffset` Angular width in radians for the arrows. Default: `π/9 (20 degrees)`
+ `linetype` Type of line used for edges ("straight", "curve"). Default: "straight"
+ `linetype` Type of line used for edges (:straight, :curve). Default: :straight
+ `outangle` Angular width in radians for the edges (only used if `linetype = "curve`). Default: `π/5 (36 degrees)`

# Reporting Bugs
Expand Down
5 changes: 0 additions & 5 deletions src/GraphPlot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ export
shell_layout,
stressmajorize_layout

include("deprecations.jl")

# layout algorithms
include("layout.jl")
include("stress.jl")

# ploting utilities
include("shape.jl")
include("lines.jl")
include("plot.jl")
include("collapse_plot.jl")

end # module
96 changes: 0 additions & 96 deletions src/collapse_plot.jl

This file was deleted.

106 changes: 0 additions & 106 deletions src/deprecations.jl

This file was deleted.

Loading