View Source Skitter.Dot (Skitter v0.5.3)

Export skitter workflows as graphviz dot graphs.

The main function in this module is the to_dot/1 function, which accepts a skitter workflow and returns its dot representation as a string. End users may prefer the print_dot/1 function, which immediately prints the returned string. If dot is installed on the system, the export/3 function can be used to export the generated graph in a variety of formats.

Link to this section Summary

Functions

Renders the generated dot graph, requires dot to be installed on the system.

Renders the generated dot graph and save it to path.

Return the dot representation of a workflow as a string.

Link to this section Functions

Link to this function

render(w, format, opts \\ [])

View Source

Specs

render(Skitter.Workflow.t(), String.t(),
  dot_exe: String.t(),
  extra: [String.t()]
) ::
  {:ok, binary()} | {:error, String.t()}

Renders the generated dot graph, requires dot to be installed on the system.

This function exports a given workflow to the dot language (using to_dot/1), after which it calls dot on the generated dot representation. When dot returns successfully, {:ok, string} is returned, where string is the output generated by dot.

A format should be specified. This format is passed to dot through the use of its -T option. For a list of the options supported on your system, see man dot.

An optional list of options may be passed to further configure the use of dot. The following options are supported:

  • dot_exe: the path to the dot executable, by default, this function assumes dot is present in your $PATH.
  • extra: a list of extra arguments to pass to the dot executable.

Examples

Save workflow as a svg file:

render(workflow, "svg")
Link to this function

render_to_file(w, format \\ "pdf", path \\ "dot.pdf", opts \\ [])

View Source

Specs

render_to_file(Skitter.Workflow.t(), String.t(), String.t(),
  dot_exe: String.t(),
  extra: [String.t()]
) :: :ok | {:error, String.t()}

Renders the generated dot graph and save it to path.

Renders the provided workflow (with render/3) and store the output to path. format and opts are passed to render/3.

Specs

to_dot(Skitter.Workflow.t()) :: String.t()

Return the dot representation of a workflow as a string.