Skip to content

Commit 2f4e1a1

Browse files
authored
Merge pull request #491 from JuliaRobotics/docs/20Q2/cleanupv08
Refactor docs structure for maintainability and v0.8
2 parents c1f73c7 + cbd5dc7 commit 2f4e1a1

18 files changed

+566
-501
lines changed

docs/extra/CoreAPI.fods

Lines changed: 304 additions & 310 deletions
Large diffs are not rendered by default.

docs/make.jl

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Documenter
22
using GraphPlot
3+
push!(ENV,"DFG_USE_CGDFG"=>"true")
34
using DistributedFactorGraphs
45

56
makedocs(
@@ -8,27 +9,24 @@ makedocs(
89
sitename = "DistributedFactorGraphs.jl",
910
pages = Any[
1011
"Home" => "index.md",
11-
"Data Structure" => "DataStructure.md",
1212
"Getting Started" => [
13-
"Introduction" => "getting_started.md",
13+
"DFG Data Structures" => "DataStructure.md",
1414
"Building Graphs" => "BuildingGraphs.md",
15-
"Using Graph Data" => "GraphData.md",
15+
"Using Graph Elements" => "GraphData.md",
1616
"Drawing Graphs" => "DrawingGraphs.md",
17-
"Traversing and Querying" => "TraversingAndQuerying.md",
18-
"Common API Interface" => "ref_api.md"
17+
"Quick API Reference" => "ref_api.md"
1918
],
20-
"DistributedFactorGraph API's" => [
21-
"Graphs.jl" => "apis/graphs.md",
22-
"LightGraphs.jl" => "apis/graphs.md",
23-
"CloudGraphs.jl" => "apis/graphs.md",
24-
],
25-
"Reference" => "func_ref.md"
19+
# "DistributedFactorGraph API's" => [
20+
# "LightDFGs" => "apis/LightGraphs.md",
21+
# "CloudGraphsDFGs" => "apis/CloudGraphs.md",
22+
# ],
23+
"Function Reference" => "func_ref.md"
2624
]
2725
# html_prettyurls = !("local" in ARGS),
2826
)
2927

3028
deploydocs(
3129
repo = "github.com/JuliaRobotics/DistributedFactorGraphs.jl.git",
3230
target = "build",
33-
deps = Deps.pip("mkdocs", "python-markdown-math")
31+
# deps = Deps.pip("mkdocs", "python-markdown-math")
3432
)

docs/src/BuildingGraphs.md

Lines changed: 22 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Creating Graphs
1+
# Building Graphs
22

33
In this section constructing DFG graphs will be discussed. To start, bring DistributedFactorGraphs into your workspace:
44

@@ -18,22 +18,14 @@ using IncrementalInference
1818

1919
## Initializing a Graph
2020

21-
DFG graphs can be built using various drivers (different representations of the underlying graph). At the moment DFG supports 3 drivers:
22-
- GraphsDFG: An in-memory graph that uses Graphs.jl for representing the graph.
21+
DFG graphs can be built using various drivers (different representations of the underlying graph). At the moment DFG supports 2 drivers:
2322
- LightDFG: An in-memory graph that uses LightGraphs.jl for representing the graph.
2423
- CloudGraphs: A database-driven graph that uses Neo4j.jl for interacting with the graph.
2524

26-
In general the first two are used for building and solving graphs, and CloudGraphs is used for persisting in-memory graphs into a database. In the long term we recommend using the LightDFG driver for in-memory operation because Graphs.jl is not actively supported and over time that driver may be deprecated.
25+
In general the in-memory drivers are used for building and solving graphs, and CloudGraphs is used for persisting in-memory graphs into a database.
2726

2827
To continue the example, run one of the following to create a DFG driver:
2928

30-
### Creating a GraphsDFG Graph
31-
32-
```julia
33-
# Create a DFG with default solver parameters using the Graphs.jl driver.
34-
dfg = GraphsDFG{SolverParams}(params=SolverParams())
35-
```
36-
3729
### Creating a LightDFG Graph
3830

3931
```julia
@@ -46,11 +38,7 @@ dfg = LightDFG{SolverParams}(params=SolverParams())
4638
```julia
4739
# Create a DFG with no solver parameters (just to demonstrate the difference) using the CloudGraphs driver, and connect it to a local Neo4j instance.
4840
dfg = CloudGraphsDFG{NoSolverParams}("localhost", 7474, "neo4j", "test",
49-
"testUser", "testRobot", "testSession",
50-
nothing,
51-
nothing,
52-
IncrementalInference.decodePackedType,
53-
IncrementalInference.rebuildFactorMetadata!)
41+
"testUser", "testRobot", "testSession")
5442
```
5543

5644
## Creating Variables and Factors
@@ -64,7 +52,7 @@ Variables are added using IncrementalInference's `addVariable!` function. To cre
6452
- The variable's label (e.g. :x1 or :a)
6553
- The variable inference type (aka soft type), which is a subtype of InferenceVariable
6654

67-
**NOTE**: Once variables are initialized to a specific soft type, variable node data (solver data) is templated to that type.
55+
**NOTE**: Once variables are initialized to a specific soft type, variable node data (solver data) is templated to that type.
6856

6957
In addition, the following optional parameters are provided:
7058
- Additional labels for the variable (in DFG these are referred to as tags)
@@ -114,40 +102,29 @@ Each variable and factor is uniquely identified by its label. The list of
114102
variable and factor labels can be retrieved with the `ls`/`listVariables` and
115103
`lsf`/`listFactors` functions:
116104

117-
```@docs
118-
listVariables
119-
ls
120-
```
121-
122-
```@docs
123-
listFactors
124-
lsf
125-
```
105+
- [`listVariables`](@ref)
106+
- [`ls`](@ref)
107+
- [`listFactors`](@ref)
108+
- [`lsf`](@ref)
126109

127110
To list all variables or factors (instead of just their labels), use the
128111
`getVariables` and `getFactors` functions:
129112

130-
```@docs
131-
getVariables
132-
getFactors
133-
```
113+
- [`getVariables`](@ref)
114+
- [`getFactors`](@ref)
115+
116+
Traversing and Querying functions for finding the relationships and building subtraphs include:
134117

135-
**NOTE**: `getNeighbors` is also worth mentioning at this point as it is a simple way to
136-
find the bigraph relationships. More information on this and other ways to
137-
retrieve filtered lists of variables/factors (an area that's currently WIP in
138-
DFG) can be found in [Traversing and Querying](TraversingAndQuerying.md).
118+
- [`getNeighbors`](@ref)
119+
- [`buildSubgraph`](@ref)
120+
- [`getBiadjacencyMatrix`](@ref)
139121

140122
## Getting (Reading) Variables and Factors
141123

142124
Individual variables and factors can be retrieved from their labels using the following functions:
143125

144-
```@docs
145-
getVariable
146-
```
147-
148-
```@docs
149-
getFactor
150-
```
126+
- [`getVariable`](@ref)
127+
- [`getFactor`](@ref)
151128

152129
It is worth noting that `getVariable` allows a user to retrieve only a single
153130
solver entry, so that subsets of the solver data can be retrieved individually
@@ -158,13 +135,9 @@ independently using the functions as discussed in the update section below.
158135

159136
Full variables and factors can be updated using the following functions:
160137

161-
```@docs
162-
updateVariable!
163-
```
138+
- [`updateVariable!`](@ref)
139+
- [`updateFactor!`](@ref)
164140

165-
```@docs
166-
updateFactor!
167-
```
168141

169142
**NOTE**: Skeleton and summary variables are read-only. To perform updates you
170143
should use the full factors and variables.
@@ -178,10 +151,5 @@ more detail in [Data Structure](DataStructure.md).
178151

179152
Variables and factors can be deleted using the following functions:
180153

181-
```@docs
182-
deleteVariable!
183-
```
184-
185-
```@docs
186-
deleteFactor!
187-
```
154+
- [`deleteVariable!`](@ref)
155+
- [`deleteFactor!`](@ref)

docs/src/DataStructure.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Data Structure
1+
# DFG Data Structures
22

33
Variables and factors can potentially contain a lot of data, so DFG has
44
different structures that are specialized for each use-case and level of detail.
55
For example, if you want to retrieve just a simple summary of the structure,
66
you can use the summary or skeleton structures to identify variables and factors
77
of interest and then retrieve more detail on the subset.
88

9-
Note that drivers support all of the structures.
9+
Note that not all drivers support all of the structures.
1010

1111
The following section discusses the datastructures for each level. A quick
1212
summary of the types and the available properties (some of which are derived) is provided below.
@@ -29,24 +29,18 @@ Accessible properties for each of the factor structures:
2929

3030
## DFG Skeleton
3131

32-
```@docs
33-
SkeletonDFGVariable
34-
SkeletonDFGFactor
35-
```
32+
- [`SkeletonDFGVariable`](@ref)
33+
- [`SkeletonDFGFactor`](@ref)
3634

3735
## DFG Summary
3836

39-
```@docs
40-
DFGVariableSummary
41-
DFGFactorSummary
42-
```
37+
- [`DFGVariableSummary`](@ref)
38+
- [`DFGFactorSummary`](@ref)
4339

4440
## Full DFG Node
4541

46-
```@docs
47-
DFGVariable
48-
DFGFactor
49-
```
42+
- [`DFGVariable`](@ref)
43+
- [`DFGFactor`](@ref)
5044

5145
## Additional Offloaded Data
5246

docs/src/DrawingGraphs.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Graphs can be visualized by using either `GraphPlot` or rendering to .dot files
88

99
```julia
1010
using Pkg
11-
Pkg.install("GraphPlot")
11+
Pkg.add("GraphPlot")
1212
```
1313

1414
Then bring `GraphPlot` in before DFG:
@@ -18,13 +18,13 @@ using GraphPlot
1818
using DistributedFactorGraphs
1919
```
2020

21-
Any factor graph can then be drawn by calling `dfgPlot`:
21+
Any factor graph can then be drawn by calling `dfgplot`:
2222

2323
```julia
2424
# Construct graph using IIF
2525
using IncrementalInference
2626
# Create graph
27-
dfg = GraphsDFG{SolverParams}(params=SolverParams())
27+
dfg = LightDFG{SolverParams}(params=SolverParams())
2828
v1 = addVariable!(dfg, :x0, ContinuousScalar, labels = [:POSE], solvable=1)
2929
v2 = addVariable!(dfg, :x1, ContinuousScalar, labels = [:POSE], solvable=1)
3030
v3 = addVariable!(dfg, :l0, ContinuousScalar, labels = [:LANDMARK], solvable=1)
@@ -39,9 +39,7 @@ dfgplot(dfg)
3939

4040
![imgs/initialgraph.jpg](imgs/initialgraph.jpg)
4141

42-
```@docs
43-
dfgplot
44-
```
42+
- [`dfgplot`](@ref)
4543

4644
### Rendering GraphPlot to PDF
4745

@@ -62,8 +60,8 @@ More information at [GraphPlot.jl](https://github.com/JuliaGraphs/GraphPlot.jl)
6260
Dot files are a standard format for visualizing graphs and applications such as
6361
xdot are available to view the files. Dot plotting does not require `GraphPlot`
6462
and can be drawn by either:
65-
- Calling `toDot` on any graph to produce a string of the graph
66-
- Calling `toDotFile` on any graph to save it directly to a dotfile
63+
- Calling [`toDot`](@ref) on any graph to produce a string of the graph
64+
- Calling [`toDotFile`](@ref) on any graph to save it directly to a dotfile
6765

6866
```julia
6967
using DistributedFactorGraphs
@@ -83,8 +81,3 @@ toDotFile(dfg, "/tmp/test.dot")
8381
# Open with xdot
8482
run(`xdot /tmp/test.dot`)
8583
```
86-
87-
```@docs
88-
toDot
89-
toDotFile
90-
```

0 commit comments

Comments
 (0)