# `Clarity.Perspective.Lens`
[🔗](https://github.com/team-alembic/clarity/blob/v0.5.1/lib/clarity/perspective/lens.ex#L1)

Data 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.

# `content_sorter_fn`

```elixir
@type content_sorter_fn() :: (Clarity.Content.t(), Clarity.Content.t() -&gt; boolean())
```

# `icon_fn`

```elixir
@type icon_fn() :: (-&gt; Phoenix.LiveView.Rendered.t())
```

# `show_vertex_types_fn`

```elixir
@type show_vertex_types_fn() :: ([module()] -&gt; [module()])
```

# `t`

```elixir
@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()
}
```

# `default_show_vertex_types`

```elixir
@spec default_show_vertex_types([module()]) :: [module()]
```

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.

# `sort_alphabetically`

```elixir
@spec sort_alphabetically(Clarity.Content.t(), Clarity.Content.t()) :: boolean()
```

Default content sorter that sorts by priority, then alphabetically by name,
then by id for deterministic ordering.

This is the default sorting function used by lenses unless they specify
their own content_sorter function. Content providers can implement the
`sort_priority/0` callback to control their position (lower values first).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
