blueprint v0.3.0 Blueprint.Plot.Graph

Convenient functions for building simple node dependency graphs.

Link to this section Summary

Functions

Write the DOT graph to a file

Convert a node graph into a DOT graph

Link to this section Types

Link to this type graph()
graph() :: [connection()]
Link to this type graph_node()
graph_node() :: any()
Link to this type labeler()
labeler() :: (graph_node() -> String.t())
Link to this type meta()
meta() :: any()
Link to this type styler()
styler() :: ({:node, graph_node()} | {:connection, connection()} -> keyword())

Link to this section Functions

Link to this function save!(dot, path \\ "graph.dot")
save!(String.t(), String.t()) :: :ok | no_return()

Write the DOT graph to a file.

Link to this function to_dot(graph, opts \\ [])
to_dot(graph(), keyword()) :: String.t()

Convert a node graph into a DOT graph.

Options can be provided to change the resulting graph. These options are:

  • :labeler - A function of type labeler, where the node is passed to the function and is expected to receive a string that will be used on the graph to label it as a result.
  • :styler - A function of type styler where a node or connection is passed the function and is expected to return any styling changes to overwrite the defaults with.
  • :group - Define the grouping of nodes based on app or mod