You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/index.md
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -19,14 +19,15 @@ nothing #hide
19
19
20
20
# Basic Usage & Algorithms
21
21
All of the algorithms follow the [Layout Interface](@ref). Each layout algorithm
22
-
is represented by a type `Algorithm <: AbstractLayout`. The parameters of each
23
-
algorithm can be set with keyword arguments. The `Algorithm` object itself is
22
+
is represented by a type `LayoutAlgorithm <: AbstractLayout`. The parameters of each
23
+
layout can be set with keyword arguments. The `LayoutAlgorithm` object itself is
24
24
callable and transforms the adjacency matrix and returns a list of `Point{N,T}` from [`GeometryBasics.jl`](https://github.com/JuliaGeometry/GeometryBasics.jl).
25
25
26
26
```
27
-
alg = Algorithm(; p1="foo", p2=:bar)
27
+
alg = LayoutAlgorithm(; p1="foo", p2=:bar)
28
28
positions = alg(adj_matrix)
29
29
```
30
+
Instead of using the adjacency matrix you can use `AbstractGraph` types from [`LightGraphs.jl`](https://github.com/JuliaGraphs/LightGraphs.jl) directly.
Copy file name to clipboardExpand all lines: docs/src/interface.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,21 @@ CurrentModule = NetworkLayout
6
6
7
7
At its core, each layout algorithm is a mapping
8
8
```
9
-
adj_matrix ↦ node_positions
9
+
graph ↦ node_positions
10
10
```
11
-
where each algorithm has several parameters. The main goal of the following interface is to keep the separation between parameters and function call.
12
-
Each Algorithm is implemented as subtype of [`AbstractLayout`](@ref).
11
+
where each layout has several parameters. The main goal of the following interface is to keep the separation between parameters and function call.
12
+
Each layout is implemented as subtype of [`AbstractLayout`](@ref).
13
13
14
14
```@docs
15
15
AbstractLayout
16
16
```
17
17
18
-
Therefore, each `Algorithm <: AbstractLayout` is a functor and can be passed around as a function `adj_matrix ↦ node_positions` which encapsulates all the parameters. This is handy for plotting libraries such as [GraphMakie.jl](http://juliaplots.org/GraphMakie.jl/previews/PR9/).
18
+
Therefore, each `Layout <: AbstractLayout` is a functor and can be passed around as a function `graph ↦ node_positions` which encapsulates all the parameters. This is handy for plotting libraries such as [GraphMakie.jl](http://juliaplots.org/GraphMakie.jl/previews/PR9/).
19
19
20
20
There are some additional guidelines:
21
21
- All of the parameters should be keyword arguments, i.e. it should be allways
22
-
possible to call `Algorithm()` without specifying any parameters.
23
-
- Algorithms should allways return `Vector{Point{dim,Ptype}}`. If the type or
22
+
possible to call `Layout()` without specifying any parameters.
23
+
- Algorithms should allways return `Vector{Point{Dim,Ptype}}`. If the type or
24
24
dimensions can be altered use the keywords `dim` and `Ptype` for it.
25
25
- Some parameters may depend on the specific network (i.e. length of start
26
26
positions vector). If possible, there should be a fallback option (i.e.
0 commit comments