feat(imshow): support facet_row for subplot rows (plotly>=6.7)#82
Conversation
📝 WalkthroughWalkthroughThis PR adds Changesimshow facet_row feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
px.imshow gained facet_row support in plotly 6.7.0. Add it to the imshow slot order (y, x, facet_col, facet_row, animation_frame), consistent with all other plot types. On older plotly versions, auto-assignment skips the facet_row slot so behavior is unchanged (the fourth dimension still animates); explicitly requesting facet_row raises an informative error. Note: with plotly>=6.7.0, 4D DataArrays now auto-assign their fourth dimension to facet_row instead of animation_frame. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ee2f904 to
34b9799
Compare
Summary
px.imshowgainedfacet_rowsupport in plotly 6.7.0 (plotly/plotly.py#5445). This PR ports it intoxarray_plotly.imshow.facet_rowto the imshow slot order:("y", "x", "facet_col", "facet_row", "animation_frame")— now consistent with all other plot typesfacet_rowparameter onplotting.imshow()andDataArray.plotly.imshow()zmin/zmax) apply across the full facet grid, as beforedimensions.ipynb(it already listedfacet_rowaspirationally) and added a heatmap-grid exampleCompatibility
The plotly requirement stays at
>=5.0.0:facet_rowanimation_frame(unchanged)facet_row="dim"ValueErrorsuggesting upgradeAuto-assignment only fills
facet_rowwhen the installed plotly supports it, so existing code keeps working on older plotly versions.Test plan
facet_row, facet grid + animation, shared color bounds across facets, old-plotly fallback and error paths (pytest: 154 passed)🤖 Generated with Claude Code