Skip to content

feat(plugin-chart-univer): add a Spreadsheet chart built on Univer - #45278

Draft
AliIbnBotir wants to merge 3 commits into
apache:masterfrom
AliIbnBotir:feat/plugin-chart-univer
Draft

AliIbnBotir wants to merge 3 commits into
apache:masterfrom
AliIbnBotir:feat/plugin-chart-univer

Conversation

@AliIbnBotir

Copy link
Copy Markdown

SUMMARY

Implements the Spreadsheet chart proposed in SIP #45265.

Depends on #45263 and #45275. This branch contains their commits, so until they merge, please review only the last commit, feat(plugin-chart-univer): add a Spreadsheet chart built on Univer. I will rebase once they are in.

Adds a new chart type, Spreadsheet (viz_type: univer_sheet, category Table), built on Univer, an Apache-2.0 spreadsheet engine.

  • In Explore the query result loads into a spreadsheet editor (toolbar, formula bar, sheet tabs, context menu). Authors can rename headers, format cells, write formulas, add rows and sheets. Edits are saved with the chart in the univer_workbook control.
  • On dashboards and embedded the chart is a read-only sheet with the saved edits applied on top of fresh data. It uses appSection from feat(explore): pass appSection to chart plugins #45275 to tell where it renders.
  • Query modes: Aggregate, Raw records, and Pivot (rows, columns, metrics, totals). Pivot runs on the backend with the existing pivot and flatten post-processing (which needs the fix in fix(post-processing): flatten every index level #45263) and shows stacked, merged header rows.
  • Group rows by dimensions (optional): Excel-style Subtotals groups with +/- buttons, level buttons and a Grand Total. The collapsed state is saved.
  • Refresh data on load (default on): the query result is rewritten into the data area each time the chart loads, keeping formatting, formulas outside the data area and other sheets. Query values are stripped before saving, so the saved state only holds the user's edits.

Design notes:

  • Only Univer's open source packages are used: @univerjs/presets and @univerjs/preset-sheets-core 1.0.4. No Univer Pro packages. The 93 new lockfile packages are all ASF Category A licences (MIT, Apache-2.0, BSD-3-Clause, ISC).
  • Univer is lazy-loaded (loadChart: () => import('../UniverChart')), so it is only downloaded when a Spreadsheet chart renders. Nothing Univer-related is in the entry bundles.
  • All Univer calls live in src/univer/mountUniver.ts. Grid, layout, saved-state and group logic is plain TypeScript with unit tests.
  • The saved state has a version field so its format can change later.
  • Frontend only. The Excel export with edits is a separate follow-up PR. Until it lands, "Export to Excel" on this chart exports the raw query result like other charts.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

01-explore-editor _Editing in Explore: rename headers, fill the header row, add an Average row with formulas, save._ 02-dashboard _The same chart on a dashboard: read-only, saved edits on fresh data._ 03-pivot _Pivot mode: stacked, merged column headers and totals._ 04-row-groups _Row groups: Subtotals rows, collapsing with -/+ and the level buttons, Grand Total._

TESTING INSTRUCTIONS

Automated:

  • npm run test -- plugins/plugin-chart-univer src/components/Chart/ChartRenderer.test.tsx
  • npm run plugins:build && npm run type

Manual:

  1. Create a chart on video_game_sales (or any dataset) and pick Spreadsheet.
  2. Aggregate mode: add genre as a dimension and a few metrics, then run the query.
  3. In the sheet, rename a header, give the header row a fill colour, insert a row under the data and type a formula such as =AVERAGE(B2:B13). Save the chart.
  4. Reload Explore: the edits are kept and the data is fresh.
  5. Add the chart to a dashboard: it renders read-only with the edits.
  6. Switch to Pivot mode with Rows = genre, Columns = platform: check the merged headers and totals.
  7. Back in Aggregate mode, add a second dimension and tick Group rows by dimensions: check the Subtotals rows, the -/+ and level buttons, and that the collapsed state survives a save.

ADDITIONAL INFORMATION

The chart is registered unconditionally. If maintainers prefer, it can go behind a feature flag (for example SPREADSHEET_CHART) until it has had wider use.

Arabbek and others added 3 commits October 14, 2026 17:15
flatten reset only the first level of a MultiIndex, so a pivot with
several index columns lost the others when the result was serialized.
A single-level index is reset as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Charts can tell whether they render in Explore, on a dashboard or embedded
(standalone Explore, also used for report screenshots), e.g. to allow
editing only in Explore.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A Table-category chart that shows the query result as an Excel-like sheet
using Univer's open source packages. In Explore it is a full editor whose
edits (formatting, formulas, renamed headers, extra sheets) are saved in the
chart's form data; on dashboards it is read-only with fresh data.

Query modes: aggregate, raw records and pivot (pivot and flatten
post-processing on the backend). Rows can be grouped by dimensions with
subtotals and collapsible groups.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 6922386
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6acf7aae6de9467c521848db
😎 Deploy Preview https://deploy-preview-45278--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.02%. Comparing base (7f1bfab) to head (6922386).
⚠️ Report is 257 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (7f1bfab) and HEAD (6922386). Click for more details.

HEAD has 3 uploads less than BASE
Flag BASE (7f1bfab) HEAD (6922386)
python 7 5
postgres 2 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #45278       +/-   ##
===========================================
- Coverage   83.29%   65.02%   -18.28%     
===========================================
  Files        3039     3039               
  Lines      198375   198382        +7     
  Branches    46213    46213               
===========================================
- Hits       165235   128995    -36240     
- Misses      29916    66487    +36571     
+ Partials     3224     2900      -324     
Flag Coverage Δ
hive 34.98% <0.00%> (+<0.01%) ⬆️
mysql 52.99% <100.00%> (+<0.01%) ⬆️
postgres 53.00% <100.00%> (+<0.01%) ⬆️
presto 36.74% <0.00%> (+<0.01%) ⬆️
python 53.28% <100.00%> (-33.63%) ⬇️
sqlite 52.76% <100.00%> (+<0.01%) ⬆️
unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Oct 15, 2026
@AliIbnBotir AliIbnBotir changed the title Feat/plugin chart univer feat(plugin-chart-univer): add a Spreadsheet chart built on Univer Oct 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants