Skip to content

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 sources

Example ​

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

Top-level fields ​

FieldRequiredDescription
versionYesThe resource file version. Use 1.
resource_nameNoThe resource name for this dashboard package. Preview groups are matched by this value. Defaults to the file name.
nameNoThe display name of the preview group, shown as "Preview: <name>". Defaults to the file name.
chartsNoReusable charts that dashboards in the file can place.
dashboardsYesA list of dashboards to preview or publish. It must contain at least one dashboard.

Dashboard fields ​

FieldRequiredDescription
resource_nameYesStable resource name for the dashboard. Publishing the same resource name updates the same dashboard.
nameYesDashboard title.
dimensions.widthNoNumber of grid columns. Defaults to 12 when omitted.
dimensions.heightNoNumber of grid rows. Defaults to 12 when omitted.
cache_ttlNoHow many seconds chart results are cached. Defaults to 0 (no caching) for a new dashboard and keeps the current value for an existing one.
chartsNoCharts 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 ​

FieldRequiredDescription
chartNoThe resource name of a reusable chart to place. The placement takes the chart's fields from its definition.
resource_nameYesStable resource name for the chart. It must be unique within the dashboard. A placed reusable chart takes it from its definition.
titleYesChart title. A placed reusable chart takes it from its definition.
visualizationNoOne of bar, line, scatter, doughnut, gauge, map, table, number or text. Defaults to table.
position.xNoLeft grid position, starting at 1. Defaults to 1.
position.yNoTop grid position, starting at 1. Defaults to 1.
size.widthNoChart width in grid columns. Defaults to 1.
size.heightNoChart height in grid rows. Defaults to 1.
datasetNoDataset definition for the chart. If omitted, the chart's existing dataset is removed on the next preview or publish.

Dataset fields ​

FieldRequiredDescription
labelNoDataset label shown in the chart configuration. Defaults to the chart title.
typeNoDataset rendering type. Defaults to the chart's visualization.
sourceYesSource resource name from Diver, for example warehouse-prod. Run diver sources to list them.
queryUnless metric is setThe SQL to run for the dataset. It can use filters, such as {created_at=timerange}.
metricUnless query is setThe name of a dbt metric in the source's dbt project, to chart instead of SQL.
dimensionsNoFor a metric, the dimensions to group by, such as metric_time__month or order__country. Without any, the chart shows one number.
limitNoFor a metric, the most rows to show. Defaults to 500, at most 5000.
render_settingsNoVisualization-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-operations

Avoid environment-specific or personal names in published resources. Prefer stable source names such as warehouse-prod, stripe, or hubspot.

Reach new depths