Dashboards and visualization
Insights turns saved analytical queries into visual charts and combines those charts into arrangeable dashboards. A workbook provides the shared context for this work: queries supply data, charts give the data a readable form, and dashboards present selected results to an audience through interactive or shared views.
Analytical presentation model
Query-backed charts
A chart is a saved visual view of a workbook query. The chart keeps its visual choices separate from the source query, so one query can support several views without losing its reusable analytical meaning. Read Chart authoring for the detailed chart-building flow.
Chart selection follows the question that the data must answer:
| View | Analytical purpose |
|---|---|
| Number | Show a current measure or a small set of measures |
| Bar, Line, Row | Compare measures across a dimension or time |
| Donut | Show how a total divides across categories |
| Funnel | Show ordered stages or measures |
| Table | Inspect dimensions and measures in a precise layout |
| Map | Compare a measure across regions |
| Bubble | Compare two measures and optional size or grouping |
| Sankey | Show weighted movement from one group to another |
| Heatmap | Compare a measure across two dimensions as a grid |
The selected view defines the fields needed to produce its result. Insights derives those choices into query operations when the chart runs, then renders the returned data as an interactive visual rather than as a separate copy of the source analysis.
References: insights/…/chart_query.py• L34-70 insights/…/insights_chart_v3.py• L318-338
Dashboard views
A dashboard is a saved presentation view that selects charts from the workbook and places them with text and filters. It does not copy chart definitions. Each chart item points back to a saved chart, while the dashboard keeps a derived list of the charts it reaches so presentation and chart access stay aligned.
The same dashboard definition supports three uses:
- An editable workbook view for arranging and configuring content.
- A read-only signed-in view for consuming the saved result.
- A shared view for people who receive dashboard access or a public link.
This separation lets an author improve a chart in its own authoring surface while keeping the dashboard as the place where several results form one message. Read Dashboard composition for the detailed composition and access model.
References: frontend/…/workbook.types.ts• L105-156 frontend/…/DashboardBuilder.vue• L68-207 frontend/…/Dashboard.vue• L42-92 frontend/…/SharedDashboard.vue• L18-31 insights/…/insights_dashboard_v3.py• L137-147
Visualization flow
The presentation flow moves from reusable data work to a rendered visual and then to a dashboard that adds context and comparison. The diagram shows the main relationship between these stages.
flowchart LR
A[Workbook query] --> B[Chart definition]
B --> C[Chart data result]
C --> D[Rendered chart]
D --> E[Dashboard item]
E --> F[Arranged dashboard]
F --> G[Signed-in or shared view]
Chart data flow
When a chart is displayed, Insights uses the selected workbook query as its source and derives the grouping, measure, filter, sort, and limit choices needed by the chart view. The chart creates these operations from its saved configuration whenever it runs, so it does not need a second stored query populated by a previous browser visit.
Number charts can also request comparison periods and a sparkline. The sparkline is a separate query for how a span-based number moved inside its period, while the main result answers the current number and its comparisons. Dashboard filter conditions remain request data and are applied to the source query named by the dashboard link.
This path keeps query exploration and visual presentation connected. Query changes can affect many charts, while chart choices change only the chart's own view of that query. Read Data exploration for the source and execution side of this relationship.
References: insights/…/chart_query.py• L55-135 insights/…/insights_chart_v3.py• L138-217 insights/…/insights_chart_v3.py• L284-338
Dashboard data flow
When a viewer changes a dashboard filter, Insights sends the new condition to the charts linked to that filter. It groups the conditions by source query and refreshes the affected charts, so one control can update several related visuals while unrelated charts stay unchanged.
The filter value list also comes from a linked query column. The dashboard reads the requested column from its stored filter links and checks that the chart is part of the dashboard before it returns values. Card filters use the same boundary: they can ask only about columns that the chart draws, and their conditions stay on that chart's query. These checks keep interactive filtering within the scope that the dashboard author exposed.
References: insights/…/insights_dashboard_v3.py• L149-234 insights/…/insights_dashboard_v3.py• L236-319 insights/…/insights_dashboard_v3.py• L499-634 frontend/…/workbook.types.ts• L143-151
Dashboard composition
Arrangeable canvas
The dashboard canvas uses one shared layout for editing and viewing. Each item has a position and size, which lets an author build a visual order that supports the intended reading path. The editor allows drag and resize actions, while read-only views preserve the saved arrangement.
New charts and text appear below existing content. Filters occupy the top area and can move the content below them when a filter row becomes full. An optional compact layout fills open vertical space without changing the meaning of the items.
References: frontend/…/workbook.types.ts• L126-156 frontend/…/dashboard.ts• L59-207 frontend/…/VueGridLayout.vue• L1-72 frontend/…/DashboardBuilder.vue• L181-207 insights/…/insights_dashboard_v3.py• L42-51
Dashboard content
Dashboard content has three roles that work together to communicate an analysis:
| Content | Role in the presentation |
|---|---|
| Chart | Shows a saved query-backed visual |
| Text | Adds a heading, explanation, or note |
| Filter | Lets viewers change the conditions used by linked charts |
The dashboard stores these roles as items and chooses the matching display for each one. Text is cleaned before it is stored because shared readers can view it without the workbook editor. A missing chart remains visible as a clear missing-content state, which helps an engineer detect a broken relationship instead of mistaking it for an empty result.
References: frontend/…/DashboardItem.vue• L15-52 frontend/…/DashboardChart.vue• L13-59 frontend/…/DashboardText.vue• L8-66 frontend/…/DashboardFilter.vue• L13-126 insights/…/insights_dashboard_v3.py• L54-78
Sharing and distribution
Audience boundaries
A dashboard has its own audience, separate from access to the workbook that contains its source queries and charts. An owner can share it with named users, the organization, or anyone with the link. These choices control who can read the dashboard; workbook access controls who can return to or change the underlying analytical workspace.
The dashboard records the access state and exposes editing controls only to users who can change the dashboard. A viewer may read a shared dashboard without being able to open its workbook, so a shared presentation can reach a wider audience than the authoring workspace. Public sharing also checks access to the dashboard's charts before it is enabled, so the published view does not expose a chart that its publisher cannot read.
References: insights/…/insights_dashboard_v3.py• L110-119 insights/…/insights_dashboard_v3.py• L401-477 frontend/…/DashboardShareDialog.vue• L16-179 frontend/…/workbook.types.ts• L105-124
Shared views and previews
The shared dashboard is a read-only rendering of the saved dashboard. It uses the same item types and layout as the signed-in view, but it removes editing actions. A public dashboard can therefore serve as a stable page for communicating a result without giving guests access to the workbook editor.
Insights also creates a preview image for dashboard browsing. The preview is generated from the shared dashboard view and stored for use in dashboard lists. It runs with a short-lived key tied to the dashboard and the publishing user, so the image follows the same data access boundary as the published result. Preview generation runs after an initial dashboard insert and after saved items change, although it can update shortly after a dashboard change.
The main sharing path is:
- An author saves the dashboard composition.
- The owner chooses the audience and copies the dashboard link or embed form.
- The viewer opens the shared route.
- Insights checks access and renders the saved items without edit controls.
References: frontend/…/Dashboard.vue• L13-92 frontend/…/SharedDashboard.vue• L8-31 frontend/…/dashboards.ts• L40-81 insights/…/insights_dashboard_v3.py• L121-135 insights/…/insights_dashboard_v3.py• L321-362 insights/…/insights_dashboard_v3.py• L697-717 insights/…/dashboards.py• L150-156
Workbook relationships
Workbooks are the boundary that keeps queries, charts, and dashboards connected. The workbook lists its dashboards and charts, while each chart and dashboard points back to that workbook. This gives an engineer one place to move from the data question to its visual answer and then to the audience-facing presentation.
Workbook export, import, and duplication preserve this relationship by rebuilding asset links in the new workbook. A copied dashboard therefore continues to use the copied charts and queries instead of reaching back to the original analysis. Read Workbooks for the full asset lifecycle and Data exploration for query construction.
References: insights/…/insights_workbook.py• L179-240 insights/…/insights_workbook.py• L268-366 insights/…/insights_workbook.py• L480-493 frontend/…/workbook.ts• L96-148
Change checklist
When these files or sections are changed, remember to consider these:
- Keep chart type choices, required visual roles, query shaping, and chart rendering aligned when adding or changing a chart view.
- Keep number-card period derivation, comparison row lookup, sparkline operations, and result ordering aligned when changing time-window behavior.
- Keep dashboard item links and the derived linked-chart list aligned with workbook chart names during chart deletion, duplication, import, and workbook duplication.
- Keep the filter link format consistent between filter editing, chart refresh, distinct-value and range lookup, and public access checks.
- Keep card-filter column checks aligned with the columns the chart actually draws, including dimensions, measures, and pivot results.
- Keep dashboard text sanitization in place for every reader, including public and preview views.
- Keep the saved layout shape shared by the editor, signed-in view, shared view, and preview generation.
- Keep dashboard access choices separate from workbook access and aligned with the public shared route.
- Keep workbook export and import reference remapping aligned with query, chart, and dashboard relationships.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A dashboard item points to a deleted or unmapped chart | The dashboard shows missing content instead of the intended visual | Preserve chart links and the derived linked-chart list when changing or copying workbook assets |
| A chart configuration omits a field required by its view | The chart cannot produce a valid result | Validate the chart model and its required roles before refresh |
| A chart relies on a missing or stale generated query | It can fall back to raw source rows or show the wrong shape | Derive chart operations from the saved chart configuration at run time |
| A dashboard filter links to an invalid or unapproved query column | The filter cannot return values or apply a safe condition | Keep editor links and server-side stored-item checks consistent |
| A card filter asks for a column that the chart does not draw | The value list or range request is refused instead of reading unrelated query data | Derive allowed card columns from the saved chart operations |
| Dashboard text is stored without cleaning | A shared or preview view can render unsafe markup | Sanitize text items before storing the dashboard |
| A layout change is not saved | The author sees one arrangement while readers see the previous arrangement | Save the dashboard before leaving edit mode or sharing it |
| A public dashboard uses a method outside the guest-safe access path | The shared view fails even though the dashboard is marked public | Keep public route checks and approved dashboard methods aligned |
| A workbook copy keeps source asset names in dashboard links | The copied dashboard can show missing charts or data from the wrong workbook | Remap internal query and chart references during import and duplication |
Key files
| File | Why to read it |
|---|---|
| insights/…/chart_query.py | Defines chart types, chart configuration checks, and the query shape derived for each visual. |
| frontend/…/chart.ts | Shows how a saved chart turns query and visual choices into refreshed chart data. |
| frontend/…/chart.types.ts | Defines the high-level visual models and their required data roles. |
| insights/…/insights_chart_v3.py | Runs saved chart operations, applies dashboard and card filters, and returns chart, comparison, and sparkline data. |
| insights/…/insights_dashboard_v3.py | Defines dashboard persistence, filter and card-filter value access, sharing, text cleaning, and preview generation. |
| frontend/…/dashboard.ts | Coordinates dashboard items, layout, filter effects, refresh order, and sharing state. |
| frontend/…/DashboardBuilder.vue | Shows the authoring surface for adding, arranging, saving, refreshing, and sharing dashboard content. |
| frontend/…/DashboardItem.vue | Shows how chart, text, and filter items become dashboard content. |
| frontend/…/Dashboard.vue | Shows the signed-in read-only dashboard view. |
| frontend/…/SharedDashboard.vue | Shows the guest-friendly shared rendering path. |
| insights/…/insights_dashboard_v3.json | Defines the dashboard fields for workbook links, items, sharing state, linked charts, preview images, and compact layout. |
| insights/…/dashboards.py | Defines dashboard discovery, recent views, favorites, counts, and preview refresh. |
| insights/…/insights_workbook.py | Defines how workbook queries, charts, and dashboards remain a connected portable set. |
docs/chart-authoring.md | Child page for chart models, field mapping, rendering, and chart sharing. |
docs/dashboard-composition.md | Child page for dashboard items, layout, filters, access, and previews. |
docs/data-exploration.md | Related page for source data, query building, execution, and result review. |
docs/workbooks.md | Related page for the workbook boundary and analytical asset lifecycle. |