Skip to content

fix(charts): pie chart innerRadius undefined incorrect rendering #10104

Merged
Light2Dark merged 2 commits into
marimo-team:mainfrom
ohmdelta:pie_chart_donut_fix
Jul 8, 2026
Merged

fix(charts): pie chart innerRadius undefined incorrect rendering #10104
Light2Dark merged 2 commits into
marimo-team:mainfrom
ohmdelta:pie_chart_donut_fix

Conversation

@ohmdelta

@ohmdelta ohmdelta commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

📝 Summary

By default the pie chart visualisation has donut size (innerRadius) set to undefined. Filtering out undefined and null values in the altair chart generator prevents undefined values from populating the python args.

Before

image

After

image

Closes #10103

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jul 8, 2026 4:01pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect Python code generation for Altair pie charts when optional mark properties (notably innerRadius) are present but unset, which previously resulted in invalid kwargs being emitted.

Changes:

  • Filter out undefined and null values from Vega-Lite mark properties before converting them into Python kwargs.
  • Add a regression test ensuring innerRadius: undefined does not appear in the generated .mark_arc(...) call.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
frontend/src/components/data-table/charts/chart-spec/altair-generator.ts Skips undefined/null mark properties so generated Altair code omits invalid kwargs.
frontend/src/components/data-table/charts/tests/altair-generator.test.ts Adds coverage for innerRadius: undefined to prevent regressions in pie/donut codegen.

Comment thread frontend/src/components/data-table/charts/__tests__/altair-generator.test.ts Outdated
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

rename test

@Light2Dark Light2Dark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the fix!

@Light2Dark Light2Dark merged commit 3e8e439 into marimo-team:main Jul 8, 2026
26 checks passed
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.14-dev32

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Altair Generator / Python Code Rendering adding empty fields to output

3 participants