Skip to content

Commit 57586a1

Browse files
committed
add LG glue code for LayoutIterator
1 parent 2c784af commit 57586a1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/src/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ hidedecorations!(ax); hidespines!(ax); ax.aspect = DataAspect(); f
5252

5353
### Iterator Example
5454
```@example layouts
55-
iterator = LayoutIterator(layout, adjacency_matrix(g))
55+
iterator = LayoutIterator(layout, g)
5656
record(f, "sfdp_animation.mp4", iterator; framerate = 10) do pos
5757
p[:node_positions][] = pos
5858
autolimits!(ax)
@@ -96,7 +96,7 @@ hidedecorations!(ax); hidespines!(ax); ax.aspect = DataAspect(); f #hide
9696
```
9797
### Iterator Example
9898
```@example layouts
99-
iterator = LayoutIterator(layout, adjacency_matrix(g))
99+
iterator = LayoutIterator(layout, g)
100100
record(f, "spring_animation.mp4", iterator; framerate = 10) do pos
101101
p[:node_positions][] = pos
102102
autolimits!(ax)
@@ -119,7 +119,7 @@ hidedecorations!(ax); hidespines!(ax); ax.aspect = DataAspect(); f #hide
119119

120120
### Iterator Example
121121
```@example layouts
122-
iterator = LayoutIterator(layout, adjacency_matrix(g))
122+
iterator = LayoutIterator(layout, g)
123123
record(f, "stress_animation.mp4", iterator; framerate = 10) do pos
124124
p[:node_positions][] = pos
125125
autolimits!(ax)

src/NetworkLayout.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ function __init__()
9090
function layout(l::AbstractLayout, g::LightGraphs.AbstractGraph)
9191
layout(l, LightGraphs.adjacency_matrix(g))
9292
end
93+
function LayoutIterator(l::IterativeLayout, g::LightGraphs.AbstractGraph)
94+
LayoutIterator(l, LightGraphs.adjacency_matrix(g))
95+
end
9396
end
9497
end
9598

0 commit comments

Comments
 (0)