Skip to content

Commit

Permalink
tidy examples dir, fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
cormullion committed Apr 21, 2022
1 parent 5cb6651 commit 1912a98
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 231 deletions.
120 changes: 60 additions & 60 deletions docs/src/basics.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ scientific rigor and mathematical elegance.
!!! warning

For mathematical and scientific visualizations, use one of the following Julia
packages to display your graphs, rather than this one.
packages to display your graphs, rather than Karnak.

- [TikzGraphs.jl](https://github.com/sisl/TikzGraphs.jl): backend: Tikz/LaTeX

Expand Down
16 changes: 10 additions & 6 deletions docs/src/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ using Karnak, Luxor, Graphs, NetworkLayout, Colors, SimpleWeightedGraphs
## Overview

Karnak's function for drawing graphs is `drawgraph()`. This
takes a single argument, a `Graph`, and tries to place it on
the current Luxor drawing. It uses the current color, scale,
and rotation, marking the vertices of the graph with circles.
takes a single argument, a `Graph`, and tries to place
representative graphics on the current Luxor drawing. It
uses the current color, scale, and rotation, marking the
vertices of the graph with circles.

The default display for graphs is:

Expand Down Expand Up @@ -76,6 +77,9 @@ Usually, if a vector runs out before the vertices and edges
have been drawn, some `mod1` magic means the values repeat
from the beginning again.

You can use `drawgraph()` more than once, to build up the
graph in layers. Remember to use the same layout algorithm.

## The BoundingBox

The graphics for the graph are placed to fit inside the
Expand Down Expand Up @@ -205,7 +209,7 @@ You can use a function with `vertexlabels` to display a vertex; it should accept
@drawsvg begin
background("grey10")
g = smallgraph(:octahedral)
sethue("purple")
sethue("skyblue")
drawgraph(g, layout=stress,
vertexlabels = (v) -> v ∈ (1, 4, 6) && string(v, "/6"),
vertexshapesizes = 15,
Expand Down Expand Up @@ -264,7 +268,7 @@ To show every other vertex, you could use something like this:
@drawsvg begin
background("grey10")
g = smallgraph(:truncatedcube)
sethue("slateblue")
sethue("darkturquoise")
drawgraph(g, layout=stress,
vertexlabels = ["1", ""],
vertexshapesizes = [10, 0])
Expand All @@ -277,7 +281,7 @@ When circles and squares don't cut it, supply a function to `vertexshapes`. The
@drawsvg begin
background("grey10")
g = smallgraph(:moebiuskantor)
sethue("cyan")
sethue("hotpink")
drawgraph(g, layout=shell,
vertexshapes = (v) -> star(O, 15, v+2, 0.5, 0, :fill))
end 600 300
Expand Down
40 changes: 0 additions & 40 deletions examples/Untitled2.jl

This file was deleted.

34 changes: 0 additions & 34 deletions examples/Untitled4.jl

This file was deleted.

38 changes: 0 additions & 38 deletions examples/Untitled7.jl

This file was deleted.

4 changes: 3 additions & 1 deletion examples/Untitled5.jl → examples/digraph16.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ using NetworkLayout
g = complete_digraph(16)

setline(0.3)
drawgraph(g, margin=70, edgestrokecolors = (n, from, to, s, d) -> HSB(rescale(n, 1, ne(g), 0, 360), 0.6, 0.7), edgecurvature = 23)
drawgraph(g, margin=70,
edgestrokecolors = (n, from, to, s, d) -> HSB(rescale(n, 1, ne(g), 0, 360), 0.6, 0.7),
edgecurvature = 23)
end
50 changes: 0 additions & 50 deletions examples/example2.jl

This file was deleted.

File renamed without changes.
5 changes: 4 additions & 1 deletion examples/Untitled9.jl → examples/trees.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Graphs
using Karnak, Graphs, NetworkLayout, Colors

# I started adapting David Sanders https://github.com/JuliaTeX/TreeView.jl
# but didn't finish

add_numbered_vertex!(g) = (add_vertex!(g); top = nv(g))

Expand Down

0 comments on commit 1912a98

Please sign in to comment.