Skip to content

Save a View

Write a Saved View, a View a Project keeps as a query over the Model, so a question that comes up often has a link that stays current.

  • The Elements the View shows are in the Model. See Add a Service.
  • No Generated View answers the question already: c1, c2, c2/<system>, c3/<service> or deployment/<environment>. See Views.

Run archidocs dev. Get the screen to answer the question: open what needs opening and turn on a Lens. Then use Save as View, which gives you the View as YAML.

Paste it under views › structural in the Project’s views.yaml, keyed by an id unique among the Project’s Views:

sink/views.yaml
structural:
everything:
title: Everything
description: Every Element, with Shop and API open.
level: c3
include:
- element: shop
with: descendants
- customer
- search
- payment-gateway
- payments-provider
orders-db-outage:
title: What an Orders DB outage affects
description: The Services that depend on Orders DB, with the Impact Lens on.
level: c2
include:
- element: orders-db
upstream: all
exclude:
- customer
lens:
impact: orders-db
direction: upstream

title and level are required. The selectors that include and exclude take, and the Lenses, are in the Saved Views reference.

Terminal window
archidocs check
0 errors, 0 warnings

In the viewer, open the View from the Views tree. It draws the same diagram you saved:

The Kitchen sink Services that depend on Orders DB, marked by how far upstream they are.The Kitchen sink Services that depend on Orders DB, marked by how far upstream they are.
Open in the live viewer ↗

Once published, its link is #/view/<project>:<id> in the viewer.

check reports empty-view when the View’s selectors match nothing. Check the ids it names.

check reports oversized-view when the View is too big to read. Narrow its include, or split it in two.

upsert_view writes a View. get_view shows what it resolves to.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.