Skip to content

Commit

Permalink
added text corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Nov 20, 2020
1 parent 695dc12 commit 0f925d2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions docs/cmd/graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

The `graph` command generates graphical representaitons of the deployed topology.

Two graphing options are available; using a HTML page generated by `containerlab` based on a Go html template, or using a [dot file](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) that can visualized using [Graphviz](https://graphviz.org/)
Two graphing options are available:

* an HTML page with embedded graphics generated by `containerlab` based on a Go HTML template
* a [graph description file in dot format](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) that can be rendered using [Graphviz](https://graphviz.org/) or viewed [online](https://dreampuf.github.io/GraphvizOnline/).

#### HTML

The HTML based graph is created by rendering a [GoHTML](https://golang.org/pkg/html/template/) template against a `struct` containing the topology name as well as a `json` string where 2 lists are present: `nodes` and `links` .
The HTML based graph is created by rendering a [Go HTML](https://golang.org/pkg/html/template/) template against a `struct` containing the topology name as well as a `json` string where 2 lists are present: `nodes` and `links` .

`nodes` contains data about the lab nodes, such as name, kind, type, image, state, IP addresses,...

Expand Down Expand Up @@ -50,7 +53,7 @@ Within the template Javascript libraries such as [**d3js directed force graph**

`containerlab` comes with a (minimalistic) default template using [d3js](https://github.com/d3/d3-force).

After the graph generation, it allows to freely move the nodes to a desired position then export the graph in PNG format
After the graph generation, its possible to freely move the nodes to a desired position and export the graph in PNG format.

![default_graph](https://gitlab.com/rdodin/pics/-/wikis/uploads/5f3ade3559a5f044d4786bfd0e278b65/image.png)

Expand All @@ -72,13 +75,13 @@ With the global `--name | -n` flag a user sets the name of the lab that will be

#### srv

The `--srv` flag enables the HTML graph representation if present, it specifies an address a http server will listen to.
The `--srv` flag enables the HTML graph representation if present, it specifies an address a HTTP server will listen to.

A single path `/` is served, where the graph is generated based on either a default template or on the template supplied using `--template`
A single path `/` is served, where the graph is generated based on either a default template or on the template supplied using `--template`.

#### template

The `--template` flag allows to customize the HTML based graph by supplying a user defined template that will be rendered and exposed on the address specified by `--srv`
The `--template` flag allows to customize the HTML based graph by supplying a user defined template that will be rendered and exposed on the address specified by `--srv`.


### Examples
Expand All @@ -93,4 +96,4 @@ containerlab graph --topo /path/to/topo1.yaml --srv ":3002"

# start an http server on :3002 where topo1 graph will be rendered using a custom template my_template.html
containerlab graph --topo /path/to/topo1.yaml --srv ":3002" --template my_template.html
```
```

0 comments on commit 0f925d2

Please sign in to comment.