Clarity.Perspective.Lens (Clarity v0.4.0)
View SourceData structure representing a lens that provides a specific view onto the graph.
A lens filters the graph to a subset relevant for a certain audience and defines how that filtered view should be presented, including the starting vertex and default content ordering.
Summary
Functions
Default vertex type filter that shows all vertex types.
Default content sorter that sorts alphabetically by content name, with Graph deprioritized.
Types
@type content_sorter_fn() :: (Clarity.Content.t(), Clarity.Content.t() -> boolean())
@type icon_fn() :: (-> Phoenix.LiveView.Rendered.t())
@type t() :: %Clarity.Perspective.Lens{ content_sorter: content_sorter_fn(), description: String.t() | nil, filter: Clarity.Graph.Filter.filter(), icon: icon_fn(), id: String.t(), name: String.t(), show_vertex_types: show_vertex_types_fn() }
Functions
Default vertex type filter that shows all vertex types.
This is the default function used by lenses unless they specify their own show_vertex_types function. Returns all types unchanged.
@spec sort_alphabetically(Clarity.Content.t(), Clarity.Content.t()) :: boolean()
Default content sorter that sorts alphabetically by content name, with Graph deprioritized.
This is the default sorting function used by lenses unless they specify their own content_sorter function. Graph content is moved to the end.