Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ernest committed Oct 30, 2020
1 parent 807d563 commit a78a723
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@ Subgraphs
s := g.Subgraph("cluster")
s.Attr("style","filled")


Initializers

g := dot.NewGraph(dot.Directed)
g.NodeInitializer(func(n dot.Node) {
n.Attr("shape", "rectangle")
n.Attr("fontname", "arial")
n.Attr("style", "rounded,filled")
})

g.EdgeInitializer(func(e dot.Edge) {
e.Attr("fontname", "arial")
e.Attr("fontsize", "9")
e.Attr("arrowsize", "0.8")
e.Attr("arrowhead", "open")
})

HTML and Literal values

node.Attr("label", Literal(`"left-justified text\l"`))
graph.Attr("label", HTML("<B>Hi</B>"))

## cluster example

![](./doc/cluster.png)
Expand Down

0 comments on commit a78a723

Please sign in to comment.