feat: DH-20808: Add subplot_titles and title parameters to make_subplots#1283
feat: DH-20808: Add subplot_titles and title parameters to make_subplots#1283jnumainville wants to merge 16 commits intodeephaven:mainfrom
Conversation
…_subplots Co-authored-by: jnumainville <10480451+jnumainville@users.noreply.github.com>
Co-authored-by: jnumainville <10480451+jnumainville@users.noreply.github.com>
Co-authored-by: jnumainville <10480451+jnumainville@users.noreply.github.com>
Co-authored-by: jnumainville <10480451+jnumainville@users.noreply.github.com>
…ncation logic Co-authored-by: jnumainville <10480451+jnumainville@users.noreply.github.com>
…title check Co-authored-by: jnumainville <10480451+jnumainville@users.noreply.github.com>
Co-authored-by: jnumainville <10480451+jnumainville@users.noreply.github.com>
- Rename use_existing_titles to titles_as_subtitles for clarity - Remove default value annotations from docstrings - Extract title handling logic into get_subplot_titles helper function - Move annotation and title application from unsafe_update_figure to atomic_layer - Add subplot_annotations and overall_title parameters to atomic_layer and layer - Update documentation to use simpler language (left to right, top to bottom instead of row-major) - Update all tests to use titles_as_subtitles - Simplify extract_title_from_figure to always return string Co-authored-by: jnumainville <10480451+jnumainville@users.noreply.github.com>
- Rename 'overall_title' parameter to 'title' in layer function - Remove unnecessary padding logic from get_subplot_titles (annotations are skipped for missing titles anyway) - Remove erroneous duplicate return statement in atomic_make_subplots Co-authored-by: jnumainville <10480451+jnumainville@users.noreply.github.com>
|
Looks like this needs deephaven/deephaven-core#7596 to pass fully |
|
ui docs preview (Available for 14 days) |
|
ui docs preview (Available for 14 days) |
|
plotly-express docs preview (Available for 14 days) |
There was a problem hiding this comment.
Pull request overview
This pull request adds support for subplot titles and an overall title to the make_subplots function in the Deephaven plotly-express plugin. The implementation allows users to specify individual subplot titles via a list or automatically extract titles from existing figures by setting subplot_titles=True. Additionally, users can now add an overall title to the entire subplot figure.
Changes:
- Added
subplot_titlesandtitleparameters tomake_subplotsfunction - Implemented helper functions for title extraction, annotation creation, and grid position mapping
- Updated documentation with examples of the new functionality
- Added comprehensive unit tests for the new features
- Updated test fixtures for precision handling in datetime comparisons
Reviewed changes
Copilot reviewed 22 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/plotly-express/src/deephaven/plot/express/plots/subplots.py | Core implementation of subplot titles and overall title functionality |
| plugins/plotly-express/src/deephaven/plot/express/plots/_layer.py | Added support for subplot annotations and title handling in layer function |
| plugins/plotly-express/test/deephaven/plot/express/plots/test_make_subplots.py | Added comprehensive test coverage for new subplot title features |
| plugins/plotly-express/docs/sub-plots.md | Updated documentation with examples of subplot titles and overall title usage |
| plugins/plotly-express/test/deephaven/plot/express/preprocess/*.py | Updated test assertions to use pandas.testing.assert_frame_equal for better precision handling |
| plugins/plotly-express/test/deephaven/plot/express/plots/test_timeline.py | Updated timeline test to handle datetime precision differences |
| tests/express.spec.ts | Added integration tests for titles and subplots |
| tests/app.d/express.py | Added test fixtures using the new functionality |
| sphinx_ext/sphinx-requirements.txt | Added Sphinx version constraint to prevent incompatibility |
| plugins/plotly-express/setup.cfg | Bumped deephaven-core dependency to 0.41.1 |
| plugins/plotly-express/docs/snapshots/*.json | Updated documentation snapshots |
| tests/express.spec.ts-snapshots/*.png | Added visual regression test snapshots |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/plotly-express/src/deephaven/plot/express/plots/subplots.py
Outdated
Show resolved
Hide resolved
|
plotly-express docs preview (Available for 14 days) |
|
ui docs preview (Available for 14 days) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 28 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Titles are filled left to right, top to bottom. | ||
| Empty strings ("") can be included in the list if no subplot title | ||
| is desired in that space. | ||
| If True, automatically extracts and uses titles from the input figures |
There was a problem hiding this comment.
Consider making True the default argument. This is technically breaking (because instead of one of the subplot titles "winning" and becoming the overall chart title the titles become the subplot titles) but the current behavior is wonky and only really useful if you have a bunch of charts with the same titles that you want to subplot and maintain the title of on the whole chart.
The downside of this would be you would have to either specify title or set this argument to False (None wouldn't be an option anymore as it would be redundant).
Added subplot_titles argument to make_subplots that can either pass in a list of new subplot titles or be set to True to maintain existing subplot titles.
Added title argument to make_subplots as well, similar to other charts.