Pipe-friendly view helpers for exploring Choreo models in Livebook.
This module is ordinary Elixir, not a macro DSL. It is a thin convenience
layer over Choreo.View that keeps the stable view API intact while making
common zoom, focus, filter, path, and collapse operations easier to compose in
pipelines.
Choreo.View remains the primitive graph-lens API. Choreo.Lab.View is the
ergonomic exploration API: a place to try friendlier names, positional forms,
and common predicates before deciding whether any of them should graduate into
core Choreo.View.
Prefer alias-qualified usage for better editor autocomplete:
alias Choreo.Lab.View
system
|> View.zoom(1)
|> View.only_type([:service, :database, :cache])
|> View.focus(:api, depth: 2)The functions return ordinary Choreo structs rebuilt through the
Choreo.Viewable protocol.
Summary
Functions
Keeps the shortest path between two nodes, optionally with surrounding radius.
Collapses the listed node IDs into new_id.
Collapses all nodes of the given type(s) into new_id.
Keeps node and its surrounding neighbourhood.
Alias for focus/3 that reads naturally in exploratory pipelines.
Generic keep filter for small Livebook experiments.
Keeps only the listed node IDs.
Keeps only nodes whose :node_type or :type matches the given type(s).
Alias for between/4.
Renders the diagram as a tabbed layout in Livebook featuring Siren, Graphviz, and Sketch.
Returns the view helper vocabulary for Livebook discovery.
Converts the diagram to a Graphviz DOT string.
Converts the diagram to a Mermaid string.
Renders the diagram using the Siren Kino widget in Livebook.
Renders the diagram using the Sketch Kino widget in Livebook.
Keeps a trace path between two nodes using Choreo.View.focus_trace/4.
Compatibility alias for taxonomy/0.
Generic remove filter for small Livebook experiments.
Removes the listed node IDs.
Removes nodes whose :node_type or :type matches the given type(s).
Applies Choreo.View.zoom/2 with a positional level.
Types
Functions
Keeps the shortest path between two nodes, optionally with surrounding radius.
Collapses the listed node IDs into new_id.
Collapses all nodes of the given type(s) into new_id.
Keeps node and its surrounding neighbourhood.
Accepts either :depth or :radius; both map to Choreo.View.focus/3's
:radius option. :mode may be :neighbors, :successors, or
:predecessors.
Alias for focus/3 that reads naturally in exploratory pipelines.
Generic keep filter for small Livebook experiments.
Supported options:
:nodes— node ID or IDs to keep:type/:types— semantic node type or types to keep
When both are supplied, a node may match either condition.
Keeps only the listed node IDs.
Keeps only nodes whose :node_type or :type matches the given type(s).
Alias for between/4.
Renders the diagram as a tabbed layout in Livebook featuring Siren, Graphviz, and Sketch.
Only active when Kino is loaded. Returns the Kino widget tab layout.
If Kino is not loaded, returns the diagram unmodified.
@spec taxonomy() :: %{ transforms: [atom()], filters: [atom()], collapse: [atom()], options: [atom()], renders: [atom()] }
Returns the view helper vocabulary for Livebook discovery.
iex> taxonomy = Choreo.Lab.View.taxonomy()
iex> :zoom in taxonomy.transforms
true
iex> :only_type in taxonomy.filters
true
iex> :collapse_type in taxonomy.collapse
true
Converts the diagram to a Graphviz DOT string.
Converts the diagram to a Mermaid string.
Renders the diagram using the Siren Kino widget in Livebook.
Only active when Kino is loaded. Returns the Kino widget.
If Kino is not loaded, returns the diagram unmodified.
Renders the diagram using the Sketch Kino widget in Livebook.
Only active when Kino is loaded. Returns the Kino widget.
If Kino is not loaded, returns the diagram unmodified.
Keeps a trace path between two nodes using Choreo.View.focus_trace/4.
@spec verbs() :: %{ transforms: [atom()], filters: [atom()], collapse: [atom()], options: [atom()], renders: [atom()] }
Compatibility alias for taxonomy/0.
Generic remove filter for small Livebook experiments.
Supported options mirror only/2.
Removes the listed node IDs.
Removes nodes whose :node_type or :type matches the given type(s).
@spec zoom(viewable(), non_neg_integer(), keyword()) :: viewable()
Applies Choreo.View.zoom/2 with a positional level.
iex> system = Choreo.new() |> Choreo.add_service(:api) |> Choreo.add_database(:db)
iex> system |> Choreo.Lab.View.zoom(0) |> Choreo.nodes()
%{api: %{label: "api", node_type: :service}}