Skip to content

Add pie plots#8

Merged
FBumann merged 1 commit intomainfrom
feature/pie-plot
Jan 9, 2026
Merged

Add pie plots#8
FBumann merged 1 commit intomainfrom
feature/pie-plot

Conversation

@FBumann
Copy link
Owner

@FBumann FBumann commented Jan 9, 2026

Summary by CodeRabbit

Release Notes

  • New Features
    • Added pie chart visualization capability for DataArrays and Datasets through the plotly accessor, supporting custom labels, color mapping, and faceted display options.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Introduces pie chart plotting functionality to xarray_plotly by adding a new pie() function in the plotting module, extending both DataArrayPlotlyAccessor and DatasetPlotlyAccessor with pie methods, and configuring slot ordering for the pie plot type in the configuration module.

Changes

Cohort / File(s) Summary
Accessor API Extensions
xarray_plotly/accessor.py
Added pie() methods to DataArrayPlotlyAccessor and DatasetPlotlyAccessor with parameters for names, color, facet_col, facet_row, and px_kwargs; updated __all__ exports to include "pie" in both classes
Plotting Core
xarray_plotly/plotting.py
New pie() function processes DataArray slots, converts to DataFrame, determines value column, builds labels, and delegates to px.pie() with support for names, color, and faceting parameters
Configuration
xarray_plotly/config.py
Added "pie" entry to DEFAULT_SLOT_ORDERS with slot ordering ("names", "facet_col", "facet_row")

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🥧 A pie plot hops into view,
With names and colors, faceted too!
From DataArray to express so sweet,
The plotter's toolkit's now complete! 🐰✨

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c04a25b and d290e24.

📒 Files selected for processing (3)
  • xarray_plotly/accessor.py
  • xarray_plotly/config.py
  • xarray_plotly/plotting.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@FBumann FBumann merged commit e49ec17 into main Jan 9, 2026
5 of 6 checks passed
@FBumann FBumann deleted the feature/pie-plot branch January 9, 2026 14:03
@coderabbitai coderabbitai bot mentioned this pull request Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant