Appearance
The dashboard language
*.diver.yml files define dashboards as versioned resources that can be previewed locally and published to a Diver workspace.
The file is meant to live next to the code, models, or dbt project that explains the data. It gives teams a repeatable way to review dashboard changes before they become workspace dashboards.
Resource Names
Every resource_name in a *.diver.yml file is stable, human-readable, and used by Diver to update the same resource on the next preview or publish.
Resource names are not database IDs. Changing a resource name tells Diver to create or target a different resource.
Diver turns every resource name into lowercase letters, digits and hyphens, and cuts it off at 120 characters. Sales Analytics and sales-analytics therefore point to the same dashboard. Write names in that form to begin with to avoid surprises.
Source resource names are read-only from the CLI. Create or rename sources in the web app, then use diver sources to list the source resource names available to your workspace:
bash
diver sourcesExample
yaml
version: 1
resource_name: sales-analytics
name: Sales Analytics
dashboards:
- resource_name: management-overview
name: Management Overview
dimensions: { width: 12, height: 10 }
charts:
- resource_name: leads-created
title: Leads created
visualization: bar
position: { x: 1, y: 1 }
size: { width: 4, height: 3 }
dataset:
label: Leads
type: bar
source: warehouse-prod
query: |
select count(*) as leads from data.leadsTop-level fields
| Field | Required | Description |
|---|---|---|
version | Yes | The resource file version. Use 1. |
resource_name | No | The resource name for this dashboard package. Preview groups are matched by this value. Defaults to the file name. |
name | No | The display name of the preview group, shown as "Preview: <name>". Defaults to the file name. |
charts | No | Reusable charts that dashboards in the file can place. |
dashboards | Yes | A list of dashboards to preview or publish. It must contain at least one dashboard. |
Dashboard fields
| Field | Required | Description |
|---|---|---|
resource_name | Yes | Stable resource name for the dashboard. Publishing the same resource name updates the same dashboard. |
name | Yes | Dashboard title. |
dimensions.width | No | Number of grid columns. Defaults to 12 when omitted. |
dimensions.height | No | Number of grid rows. Defaults to 12 when omitted. |
cache_ttl | No | How many seconds chart results are cached. Defaults to 0 (no caching) for a new dashboard and keeps the current value for an existing one. |
charts | No | Charts to place on the dashboard. Leave it out or use an empty list for a dashboard without charts. |
The file describes the whole dashboard. When you preview or publish it, charts that are on the dashboard but not in the file are deleted, so remove a chart from the file to remove it from the dashboard.
Chart fields
| Field | Required | Description |
|---|---|---|
chart | No | The resource name of a reusable chart to place. The placement takes the chart's fields from its definition. |
resource_name | Yes | Stable resource name for the chart. It must be unique within the dashboard. A placed reusable chart takes it from its definition. |
title | Yes | Chart title. A placed reusable chart takes it from its definition. |
visualization | No | One of bar, line, scatter, doughnut, gauge, map, table, number or text. Defaults to table. |
position.x | No | Left grid position, starting at 1. Defaults to 1. |
position.y | No | Top grid position, starting at 1. Defaults to 1. |
size.width | No | Chart width in grid columns. Defaults to 1. |
size.height | No | Chart height in grid rows. Defaults to 1. |
dataset | No | Dataset definition for the chart. If omitted, the chart's existing dataset is removed on the next preview or publish. |
Dataset fields
| Field | Required | Description |
|---|---|---|
label | No | Dataset label shown in the chart configuration. Defaults to the chart title. |
type | No | Dataset rendering type. Defaults to the chart's visualization. |
source | Yes | Source resource name from Diver, for example warehouse-prod. Run diver sources to list them. |
query | Unless metric is set | The SQL to run for the dataset. It can use filters, such as {created_at=timerange}. |
metric | Unless query is set | The name of a dbt metric in the source's dbt project, to chart instead of SQL. |
dimensions | No | For a metric, the dimensions to group by, such as metric_time__month or order__country. Without any, the chart shows one number. |
limit | No | For a metric, the most rows to show. Defaults to 500, at most 5000. |
render_settings | No | Visualization-specific settings. |
Each chart has one dataset, with either a query or a metric.
Chart a dbt metric
When the source's dbt project defines a metric, a dataset can chart it by name. Diver writes the SQL from the metric's definition in dbt, so the chart shows the same numbers as dbt does:
yaml
- resource_name: revenue-by-month
title: Revenue by month
visualization: line
position: { x: 1, y: 1 }
size: { width: 6, height: 4 }
dataset:
source: warehouse-prod
metric: revenue
dimensions: [metric_time__month, order__country]The query returns a column per dimension, in the order you list them, and then the metric's value, named after the metric. diver validate checks that the metric and its dimensions exist in the dbt project Diver last synced, so sync the project after you add a metric to dbt.
Reusable charts
Define a chart once in the top-level charts list to place it on several dashboards, for example a core KPI that belongs on both the management and the finance dashboard. A definition has the same fields as a chart, except position and size, which every dashboard sets where it places the chart.
yaml
version: 1
charts:
- resource_name: weekly-revenue
title: Weekly revenue
visualization: number
dataset:
source: warehouse-prod
query: |
select sum(amount) as revenue from data.orders
dashboards:
- resource_name: management-overview
name: Management Overview
charts:
- chart: weekly-revenue
position: { x: 1, y: 1 }
size: { width: 4, height: 2 }
- resource_name: finance
name: Finance
charts:
- chart: weekly-revenue
title: Revenue this week
position: { x: 9, y: 1 }
size: { width: 4, height: 3 }A placement names the definition in chart and can set any chart field except dataset, so every placement shows the same data. Change the dataset in the definition to change it everywhere. Fields the placement sets, such as title, win over the definition's.
A placement keeps the definition's resource_name unless it sets its own. To place the same chart twice on one dashboard, give one of the placements another resource_name.
Reusable charts can only be placed by dashboards in the same file.
Preview and publish behavior
diver preview creates or updates dashboards in your personal preview dashboard group. Preview dashboards are private to you unless the preview group is shared. A dashboard you remove from the file is deleted from the preview group on the next preview.
diver publish creates or updates workspace dashboards. Published dashboards are matched by dashboard resource_name and can be added to normal dashboard groups for sharing. Removing a dashboard from the file doesn't delete the published dashboard; delete it in Diver.
Previewing and publishing require the Analyst or Admin role in the workspace.
Changing a dashboard from a file
The file describes the dashboard, so you change the dashboard in the file and publish it again. Diver doesn't let anyone move, add, edit or delete its charts, or rename or resize it, as the next publish would undo those changes. You can still add it to dashboard groups and share it.
Diver shows such a dashboard as managed in code, with a lock in the toolbar and on each chart. Hover a lock to see the dashboard's or chart's resource_name, and click it to copy the name. To manage a published dashboard in Diver instead, open the toolbar's settings menu and select Manage in Diver instead. It then becomes an ordinary dashboard. Publishing the file again adds a second copy of the dashboard, so remove it from the file too.
Naming guidance
Use short, descriptive resource names that can survive display-name changes:
yaml
resource_name: revenue-operationsAvoid environment-specific or personal names in published resources. Prefer stable source names such as warehouse-prod, stripe, or hubspot.