View Source Workspace.Graph.Formatter behaviour (Workspace v0.1.2)

A behaviour for defining custom formatters for using with mix workspace.graph.

A formatter is responsible for visualizing the workpsace graph.

Summary

Types

A module implementing the Workspace.Graph.Formatter behaviour.

Callbacks

Renders the given workspace graph.

Functions

Formats the given workspace using the provided formatter and options.

Types

@type formatter() :: module()

A module implementing the Workspace.Graph.Formatter behaviour.

Callbacks

Link to this callback

render(graph, workspace, opts)

View Source
@callback render(
  graph :: :digraph.graph(),
  workspace :: Workspace.State.t(),
  opts :: keyword()
) :: :ok

Renders the given workspace graph.

The formatter is responsible for printing any console output or generating any output file, based on the given opts.

The graph is expected to be the :digraph.graph() to be printed. The graph may be a subgraph of the full workspace graph.

Options are arbitrary and any formatter can support custom options.

Functions

Link to this function

format(formatter, workspace, opts)

View Source
@spec format(
  formatter :: formatter(),
  workspace :: Workspace.State.t(),
  opts :: keyword()
) :: :ok

Formats the given workspace using the provided formatter and options.

Options