Dashboard composition and sharing
Dashboards are workbook views that arrange saved charts with text and interactive filters. An engineer can create a dashboard from a workbook, shape its grid, save the view as a reusable document, and expose it to selected users, the organization, or anyone with a link. The same dashboard definition drives the signed-in editor, the read-only dashboard view, and the guest-friendly shared view.
Dashboard lifecycle
The dashboard lifecycle connects workbook authoring to dashboard display. A dashboard starts as a child view of a workbook, gains a title and items during editing, and then becomes a saved document that can be listed, opened, previewed, and shared.
When an engineer creates a dashboard from a workbook, the workbook keeps the dashboard name and title in its dashboard list. The dashboard keeps the workbook link so that an authorized viewer can return to the source workbook. The dashboard list also provides search and personal views for all accessible dashboards, recent dashboards, favorites, dashboards created by the current user, and dashboards shared by another user. References: frontend/…/workbook.ts• L137-148, frontend/…/DashboardList.vue• L17-53, frontend/…/dashboards.ts• L31-64, frontend/…/workbook.types.ts• L49-64
Opening a dashboard loads its document and then refreshes its chart items. A signed-in open records a view for recent-dashboard results. The server also records the view surface for product telemetry, while keeping repeated views in a short interval from creating repeated view-log entries. A dashboard title change also updates the matching dashboard entry in the parent workbook. References: frontend/…/Dashboard.vue• L13-31, frontend/…/dashboard.ts• L209-220, frontend/…/dashboard.ts• L356-383, insights/…/insights_dashboard_v3.py• L85-103
Grid layout
The grid is the shared spatial model for editing and display. Each dashboard item has a layout with an identifier, position, width, and height. The editor enables drag and resize, while read-only views use the same positions without allowing changes. References: frontend/…/workbook.types.ts• L126-156, frontend/…/DashboardBuilder.vue• L181-207, frontend/…/Dashboard.vue• L79-92, frontend/…/SharedDashboard.vue• L18-31
The dashboard uses a 20-column grid. New charts and text items are placed below the current content. New filters are placed in the filter area at the top; when a row is full, the filter row moves down and nearby content moves with it. The editor can also use vertical compaction to fill open space or reset unsaved layout changes. The saved document records whether vertical compact layout is enabled. References: frontend/…/dashboard.ts• L59-97, frontend/…/dashboard.ts• L101-164, frontend/…/dashboard.ts• L170-207, frontend/…/DashboardBuilder.vue• L147-177, insights/…/insights_dashboard_v3.json• L94-99
The layout is a presentation contract rather than a separate view-only setting. Saving item positions stores the new layout with the dashboard document, so the signed-in dashboard and shared dashboard render the same arrangement. References: frontend/…/DashboardBuilder.vue• L187-206, frontend/…/VueGridLayout.vue• L1-35, frontend/…/workbook.types.ts• L131-156
Dashboard items
Dashboard items are the content units placed in the grid. The item type selects the renderer, and edit mode adds item actions for editing or deletion without changing the meaning of the saved item. References: frontend/…/DashboardItem.vue• L15-52, frontend/…/DashboardItemActions.vue• L12-23
| Item | Purpose | Relationship |
|---|---|---|
| Chart | Displays a saved workbook chart and its current data. | Points to one chart by name. |
| Text | Adds explanatory or descriptive content. | Stores rich text in the dashboard item. |
| Filter | Lets a viewer change linked chart data. | Maps a filter value to columns used by one or more charts. |
Chart items
Chart items turn workbook charts into dashboard content without copying the chart definition. The dashboard resolves the saved chart, sends it through the normal chart renderer, and refreshes it with the dashboard's active filter values. If the chart cannot be resolved, the item shows a clear missing-chart state instead of silently disappearing. References: frontend/…/DashboardChart.vue• L13-38, frontend/…/DashboardChart.vue• L53-59, frontend/…/workbook.types.ts• L138-142
The chart selector is the main way to add chart items. It starts with the charts available from the workbook, supports title search and select-all behavior, and adds the selected charts as a group. A chart already present on the dashboard is not added again. A chart can also be dropped into the dashboard from the workbook chart area. References: frontend/…/DashboardChartSelectorDialog.vue• L15-56, frontend/…/dashboard.ts• L59-79, frontend/…/DashboardBuilder.vue• L39-55
Text items
Text items provide context around chart data, such as headings or notes. An empty text item opens an editor in edit mode; saving replaces the item content, while cancel leaves the current content unchanged. The server sanitizes stored text before it can be rendered as HTML, and both normal and shared views show the cleaned formatted text. References: frontend/…/DashboardText.vue• L8-25, frontend/…/DashboardText.vue• L27-66, frontend/…/workbook.types.ts• L153-156, insights/…/insights_dashboard_v3.py• L54-78
Filter items
Filter items connect a dashboard control to chart query columns. A filter has a label, a type, links to chart columns, and an optional default condition. Its supported value model covers text, number, and date input. References: frontend/…/workbook.types.ts• L143-151, frontend/…/DashboardFilterEditor.vue• L83-123
The filter editor separates setup from display configuration. Setup chooses the label, type, and linked charts and columns. Configuration chooses the icon and an optional default operator and value. Changing the filter type clears incompatible defaults and links so that the filter cannot keep a condition for the wrong kind of column. References: frontend/…/DashboardFilterEditor.vue• L30-40, frontend/…/DashboardFilterEditor.vue• L42-101, frontend/…/DashboardFilterEditor.vue• L103-156
Filter application
Filter application is the data path from a viewer's control to the chart queries. The dashboard keeps filter state separately from the item definition, turns linked columns into query filters, groups filters by query with an AND rule, and refreshes only the affected charts. References: frontend/…/dashboard.ts• L232-304, frontend/…/DashboardFilter.vue• L51-71, insights/…/insights_dashboard_v3.py• L499-549
When a viewer changes a filter, the dashboard follows this sequence:
- The filter control stores its operator and value in the dashboard's filter state.
- The dashboard finds each chart linked to that filter.
- It maps the selected column to its source query.
- It builds valid ad hoc filters for those queries.
- It refreshes the linked charts with the new query conditions.
The server uses the saved dashboard items as the access boundary for filter-value requests. This prevents a caller from naming a different query column in the request and reading values that the dashboard did not publish. For an edit in progress, the builder can still route its unsaved item state; public reads use the stored dashboard. References: frontend/…/DashboardFilter.vue• L28-49, frontend/…/dashboard.ts• L319-331, insights/…/insights_dashboard_v3.py• L149-234
The filter value list comes from distinct values in the linked query. The dashboard API checks that the requested column is one of the columns linked by a dashboard filter before it returns values. This check also protects public dashboard requests from reading unrelated query columns. The same API provides ranges for date and number filters and applies the other active filters to both value and range requests. References: frontend/…/DashboardFilter.vue• L28-49, frontend/…/dashboard.ts• L319-331, insights/…/insights_dashboard_v3.py• L172-234, insights/…/insights_dashboard_v3.py• L309-319
Chart cards can also offer filters that are not saved dashboard items. These card filters apply only to columns drawn by that chart and retain the chart's own conditions. The dashboard API checks the stored chart membership and the chart's drawn columns before it returns values or ranges. Measures and columns made by a pivot do not provide source values for a card filter. References: frontend/…/DashboardChart.vue• L13-38, insights/…/insights_dashboard_v3.py• L236-307, insights/…/insights_dashboard_v3.py• L552-601
Default filter values are applied after the dashboard loads. Stored viewer filter state takes precedence during initial restoration, which lets a viewer return to the prior state while still giving a new viewer the dashboard author's default. References: frontend/…/DashboardFilter.vue• L51-63, frontend/…/dashboard.ts• L353-368
The following diagram shows how a filter selection changes the data shown by linked chart items.
flowchart LR
A[Viewer selects a filter value] --> B[Dashboard filter state]
B --> C[Linked chart columns]
C --> D[Source queries]
D --> E[Ad hoc query filters]
E --> F[Chart refresh]
F --> G[Updated chart items]
Sharing and access
Sharing controls who can view a dashboard and provides the URL used for direct access or embedding. The share dialog presents one general-access choice at a time: anyone with the link, anyone in the organization, or specific people. It also lets the owner add or remove named users and copy either the dashboard link or an iframe snippet. References: frontend/…/DashboardShareDialog.vue• L16-75, frontend/…/DashboardShareDialog.vue• L78-179, frontend/…/dashboard.ts• L333-350
The owner submits the complete access state rather than a single incremental change. The dashboard API reconciles named user shares and organization-wide access, then stores the public flag on the dashboard. Sharing requires the dashboard share permission. Before it applies any share changes, the server checks access to all linked charts when the dashboard becomes public. A public dashboard also records the publishing user so that public query execution uses the access context of the person who published it. References: insights/…/insights_dashboard_v3.py• L401-478, insights/…/insights_dashboard_v3.json• L108-142
The access choices have different boundaries:
| Choice | Viewer boundary | Main result |
|---|---|---|
| Anyone with the link | Guest or signed-in user with the shared URL. | The dashboard is public. |
| Organization | Users covered by the organization share. | The dashboard is not public, but access is granted to the organization. |
| Specific people | Named users in the share list. | The dashboard is available through document shares. |
The dashboard document exposes the people and organization access state to users who can write the dashboard. Read-only viewers do not receive the owner-only access editor. The dashboard also exposes whether the viewer can open the source workbook. References: insights/…/insights_dashboard_v3.py• L110-119, insights/…/insights_dashboard_v3.py• L364-399, frontend/…/DashboardBuilder.vue• L90-109, frontend/…/Dashboard.vue• L23-31
Shared-dashboard rendering
The shared dashboard is a read-only rendering of the saved dashboard document. Its route is marked as a guest view, resolves renamed dashboard identifiers before loading, and uses the same grid and item renderers as the signed-in dashboard. This keeps the shared page aligned with the dashboard layout while removing edit controls and navigation chrome. References: frontend/…/router.ts• L100-108, frontend/…/SharedDashboard.vue• L8-31, insights/…/shared.py• L133-141
Public access is checked against the dashboard's public state. A valid preview key is a separate trusted path used while generating dashboard preview images. The preview key is limited to one dashboard and carries the publisher's access context, so the headless render shows the same permitted rows as the dashboard preview owner. Public dashboard calls are limited to approved document methods, including distinct filter values, filter ranges, card filter values and ranges, and view tracking. References: insights/…/shared.py• L6-30, insights/…/shared.py• L57-71, insights/…/__init__.py• L217-239, insights/…/insights_dashboard_v3.py• L637-717
Dashboard cards use stored preview images for the list page. If a preview is missing, an authorized user can request a new one. A dashboard with content also creates an initial preview after insertion, and later item changes queue a new preview only when the items change. The server creates previews from the shared dashboard route and stores the result as a private file, so the preview follows the same visible composition as the shared page without making the image itself a public access grant. References: frontend/…/DashboardCard.vue• L21-47, frontend/…/DashboardList.vue• L102-113, insights/…/dashboards.py• L150-156, insights/…/insights_dashboard_v3.py• L121-136, insights/…/insights_dashboard_v3.py• L321-362, insights/…/insights_dashboard_v3.py• L671-717
The following diagram shows the main path from a saved dashboard to a direct shared view and to its list preview.
flowchart TD
A[Saved dashboard document] --> B{Access check}
B -->|Allowed| C[Shared dashboard route]
C --> D[Read-only grid]
D --> E[Chart, text, and filter items]
A --> F[Preview request]
F --> C
C --> G[Stored dashboard preview]
Related authoring context
Dashboards depend on workbook charts for visual content but do not replace chart authoring. Read Dashboards and visualization for the wider dashboard model, and read Chart authoring for how a chart defines its query-backed visual. Read Workbooks for the parent workspace that owns queries, charts, and dashboards. Read Teams and resource access for the wider access model that surrounds named and organization sharing.
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the dashboard item union, grid layout shape, and all three item renderers aligned when adding or changing an item type.
- Keep filter link encoding consistent between the editor, client-side query filter construction, card filter handling, and server-side stored-column checks.
- Keep server-side filter and card-column checks based on stored dashboard composition for shared requests, while preserving the builder path for unsaved edits.
- Keep text sanitization in the save path aligned with every surface that renders dashboard item text, including guest views and previews.
- Keep the shared route and preview-generation route aligned so previews show the same content and access behavior as direct shared views.
- Keep preview-key scope tied to one dashboard and its publisher's access context.
- Keep the share dialog's three access states aligned with document shares, the dashboard public flag, and the public execution user.
- Keep workbook dashboard titles synchronized when dashboard title updates change the parent workbook's dashboard list.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A chart name in an item no longer resolves. | The dashboard shows a missing-chart state and cannot display that item. | Keep dashboard chart items linked to existing workbook charts. |
| A filter link points to a column that is not present in the linked query. | The filter cannot produce valid query conditions or value choices. | The editor limits columns by filter type, and the server rejects unlinked value requests. |
| A card filter asks for a column the card does not draw. | The request cannot return values or apply the filter to that card. | The dashboard checks chart membership and the chart's derived output columns. |
| A public dashboard calls a document method outside the approved public method set. | Guest access is denied even when the dashboard itself is public. | Add public methods to the allow-list only when the method is safe for guest use. |
| Dashboard publication includes a linked chart the publisher cannot access. | The public state change is refused before shares or public state are changed. | Check linked-chart access before applying the complete share update. |
| Dashboard text contains unsafe markup. | A shared or preview view can expose content that should not render. | Sanitize text items before saving them in the JSON item list. |
| A dashboard item changes without a successful save. | The visible edit state can differ from the stored shared view. | Use Done to save or Reset Layout to discard the current edit state. |
| Access data is changed without dashboard share permission. | The access update fails and existing shares remain unchanged. | Enforce the dashboard share permission before reconciling shares. |
Key files
| File | Why to read it |
|---|---|
| frontend/…/dashboard.ts | Central dashboard state, item creation, layout placement, filter application, refresh order, and share-link behavior. |
| frontend/…/DashboardBuilder.vue | Main editing flow and the controls that add charts, filters, text, and sharing. |
| frontend/…/DashboardItem.vue | Common item boundary that maps saved item types to renderers. |
| frontend/…/DashboardChartSelectorDialog.vue | Chart selection and duplicate-safe addition flow. |
| frontend/…/DashboardFilter.vue | Viewer filter control and live filter-state updates. |
| frontend/…/DashboardFilterEditor.vue | Filter setup, chart-column links, and default-value configuration. |
| frontend/…/DashboardShareDialog.vue | User, organization, and public sharing choices plus link and embed copying. |
| frontend/…/SharedDashboard.vue | Read-only shared-dashboard rendering. |
| frontend/…/VueGridLayout.vue | Shared grid behavior used by edit and read-only views. |
| insights/…/insights_dashboard_v3.py | Server-side dashboard document behavior, composition-based filter access, share reconciliation, public execution context, and preview generation. |
| insights/…/insights_dashboard_v3.json | Dashboard document fields, item storage, workbook link, public state, compact-layout setting, and permissions. |
| insights/…/shared.py | Public-access rules and stable dashboard-name resolution for shared routes. |
| insights/…/dashboards.py | Dashboard list, recency, counts, and preview API behavior. |
| frontend/…/workbook.types.ts | Shared dashboard, layout, and item data shapes used by the frontend. |