# `Graphic`

Build directed graphs, query them,
and compile into common diagramming languages.

    iex> alias Graphic, as: G
    iex> G.new() |> G.bridge("a", "b") |> G.edges()
    [
      {"a", "b", []}
    ]

Edges can also be assigned a label.

    iex> alias Graphic, as: G
    iex> G.new() |> G.bridge("a", "b", "broken!") |> G.edges()
    [
      {"a", "b", "broken!"}
    ]

# `as_d2`
*since 0.1.2* 

render graph as a [d2 diagram](https://d2lang.com).
See https://d2lang.com

    iex>alias Graphic, as: G
    iex> G.new()
    ...> |>G.bridge("a", "b")
    ...> |>G.bridge("a", "c")
    ...> |>G.bridge("c", "d", "broken!")
    ...> |>G.bridge("b", "d")
    ...> |>G.as_d2()
    """
    a -> b
    a -> c
    c -> d: 'broken!'
    b -> d
    """

# `bridge`
*since 0.1.2* 

add a plain edge, and any missing nodes.

# `bridge`
*since 0.1.2* 

add a labeled edge, and any missing nodes.

# `edges`
*since 0.1.2* 

query all edges in graph.

# `edges`
*since 0.1.2* 

query all edges from a node.

# `neighbors`
*since 0.1.2* 

describe neighboring nodes.

# `new`
*since 0.1.2* 

---

*Consult [api-reference.md](api-reference.md) for complete listing*
