-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
233 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
default: true | ||
MD025: | ||
front_matter_title: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: Identity | ||
description: implemented by values that have an immutable identifier | ||
--- | ||
|
||
# `Identity` | ||
|
||
Implemented by values that have an immutable identifier | ||
|
||
## source | ||
|
||
```go | ||
--8<-- "attributes/Identity.go" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: Reader | ||
description: implemented by attribute-based values that allows reading them | ||
--- | ||
|
||
# `Reader` | ||
|
||
Implemented by attribute-based values that allows reading them | ||
|
||
## source | ||
|
||
```go | ||
--8<-- "attributes/Reader.go" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: Serializable | ||
description: implemented by values that can be printed as string or written directly into an IO device | ||
--- | ||
|
||
# `Serializable` | ||
|
||
Implemented by values that can be printed as string or written directly into an | ||
IO device. | ||
|
||
## source | ||
|
||
```go | ||
--8<-- "attributes/Serializable.go" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: Styleable | ||
description: implemented by values that support attributes | ||
--- | ||
|
||
# `Styleable` | ||
|
||
Implemented by values that support attributes | ||
|
||
## source | ||
|
||
```go | ||
--8<-- "attributes/Styleable.go" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: Writer | ||
description: implemented by attribute-based values that allows mutating them | ||
--- | ||
|
||
# `Writer` | ||
|
||
Implemented by attribute-based values that allows mutating them | ||
|
||
## source | ||
|
||
```go | ||
--8<-- "attributes/Writer.go" | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: Key | ||
description: attribute key values | ||
--- | ||
|
||
# `Key` | ||
|
||
All Graphviz known attributes are mapped as `string` constants to prevent typos | ||
and the creation of multiple string literals across the code. | ||
|
||
## source | ||
|
||
```go | ||
--8<-- "constants/Key.go" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: StyledEdge | ||
description: implemented by edge values with convenience styling methods | ||
--- | ||
|
||
# `StyledEdge` | ||
|
||
Implemented by dot-compatible edge values which have convenience styling methods | ||
|
||
## source | ||
|
||
```go | ||
--8<-- "StyledEdge.go" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
# Edge | ||
--- | ||
title: Edge | ||
description: implemented by dot-compatible edge values | ||
--- | ||
|
||
# `Edge` | ||
|
||
Implemented by dot-compatible edge values, with support for attributes. | ||
|
||
## source | ||
|
||
```go | ||
--8<-- "Edge.go" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
# Node | ||
--- | ||
title: Node | ||
description: implemented by dot-compatible node values | ||
--- | ||
|
||
# `Node` | ||
|
||
Implemented by dot-compatible node values, with support for attributes. | ||
|
||
## source | ||
|
||
```go | ||
--8<-- "Node.go" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: GraphOptionFn | ||
description: functor that mutates graph options | ||
--- | ||
|
||
# `GraphOptionFn` | ||
|
||
Implemented by functor values that set properties on a `GraphOptions` instance, | ||
which are then used by `Graph`s `NewGraph`/`Graph.Subgraph` to configure new | ||
[sub]graphs. | ||
|
||
A `nil` error is expected as a return value if the functor has successfully set | ||
the options it is intended to. | ||
|
||
These functors are usually returned by `With*` functions that are free to accept | ||
any parameters to be used within the functor, e.g. | ||
|
||
```go | ||
func WithMyOptions(id string) GraphOptionFn { | ||
return func(options GraphOptions) error { | ||
// use the given id | ||
options.SetID(id) | ||
// always create as strict | ||
options.SetStrict(true) | ||
// use undirected (graph) instead of the default directed (digraph) | ||
options.SetType(GraphTypeUndirected) | ||
|
||
return nil | ||
} | ||
} | ||
``` | ||
|
||
then it can be used as | ||
|
||
```go | ||
graph, _ := dot.NewGraph(WithMyOptions("some-id")) | ||
``` | ||
|
||
## implementation | ||
|
||
```go | ||
// GraphOptionFn is a functor that mutates graph options | ||
type GraphOptionFn func(GraphOptions) error | ||
``` | ||
|
||
## source | ||
|
||
```go | ||
--8<-- "Graph.go" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters