Introducing a new way to review your PRs.

Read the announcement

frappe / insights

Open Source Business Intelligence Tool

View on GitHub

25 documents · Updated Nov 23, 2026

docs / dashboards-and-visualization

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:

ViewAnalytical purpose
NumberShow a current measure or a small set of measures
Bar, Line, RowCompare measures across a dimension or time
DonutShow how a total divides across categories
FunnelShow ordered stages or measures
TableInspect dimensions and measures in a precise layout
MapCompare a measure across regions
BubbleCompare two measures and optional size or grouping
SankeyShow weighted movement from one group to another
HeatmapCompare 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:

ContentRole in the presentation
ChartShows a saved query-backed visual
TextAdds a heading, explanation, or note
FilterLets 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:

  1. An author saves the dashboard composition.
  2. The owner chooses the audience and copies the dashboard link or embed form.
  3. The viewer opens the shared route.
  4. 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

TriggerConsequenceGuard
A dashboard item points to a deleted or unmapped chartThe dashboard shows missing content instead of the intended visualPreserve chart links and the derived linked-chart list when changing or copying workbook assets
A chart configuration omits a field required by its viewThe chart cannot produce a valid resultValidate the chart model and its required roles before refresh
A chart relies on a missing or stale generated queryIt can fall back to raw source rows or show the wrong shapeDerive chart operations from the saved chart configuration at run time
A dashboard filter links to an invalid or unapproved query columnThe filter cannot return values or apply a safe conditionKeep editor links and server-side stored-item checks consistent
A card filter asks for a column that the chart does not drawThe value list or range request is refused instead of reading unrelated query dataDerive allowed card columns from the saved chart operations
Dashboard text is stored without cleaningA shared or preview view can render unsafe markupSanitize text items before storing the dashboard
A layout change is not savedThe author sees one arrangement while readers see the previous arrangementSave the dashboard before leaving edit mode or sharing it
A public dashboard uses a method outside the guest-safe access pathThe shared view fails even though the dashboard is marked publicKeep public route checks and approved dashboard methods aligned
A workbook copy keeps source asset names in dashboard linksThe copied dashboard can show missing charts or data from the wrong workbookRemap internal query and chart references during import and duplication

Key files

FileWhy to read it
insights/…/chart_query.pyDefines chart types, chart configuration checks, and the query shape derived for each visual.
frontend/…/chart.tsShows how a saved chart turns query and visual choices into refreshed chart data.
frontend/…/chart.types.tsDefines the high-level visual models and their required data roles.
insights/…/insights_chart_v3.pyRuns saved chart operations, applies dashboard and card filters, and returns chart, comparison, and sparkline data.
insights/…/insights_dashboard_v3.pyDefines dashboard persistence, filter and card-filter value access, sharing, text cleaning, and preview generation.
frontend/…/dashboard.tsCoordinates dashboard items, layout, filter effects, refresh order, and sharing state.
frontend/…/DashboardBuilder.vueShows the authoring surface for adding, arranging, saving, refreshing, and sharing dashboard content.
frontend/…/DashboardItem.vueShows how chart, text, and filter items become dashboard content.
frontend/…/Dashboard.vueShows the signed-in read-only dashboard view.
frontend/…/SharedDashboard.vueShows the guest-friendly shared rendering path.
insights/…/insights_dashboard_v3.jsonDefines the dashboard fields for workbook links, items, sharing state, linked charts, preview images, and compact layout.
insights/…/dashboards.pyDefines dashboard discovery, recent views, favorites, counts, and preview refresh.
insights/…/insights_workbook.pyDefines how workbook queries, charts, and dashboards remain a connected portable set.
docs/chart-authoring.mdChild page for chart models, field mapping, rendering, and chart sharing.
docs/dashboard-composition.mdChild page for dashboard items, layout, filters, access, and previews.
docs/data-exploration.mdRelated page for source data, query building, execution, and result review.
docs/workbooks.mdRelated page for the workbook boundary and analytical asset lifecycle.