Repository navigation
Conversation
…e all chart components
dw-ukhsa
marked this pull request as ready for review
October 27, 2026 14:59
…rt height when rotated calculations
phill-stanley
previously approved these changes
Nov 2, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This PR adds responsive Plotly configuration to encoded chart responses so the frontend can switch between
full,compactandcompact_rotatedchart layouts.The response contract changes from the precious x-axis-only configuration to:
{ "figure_config": { "full": { "data": [], "layout": {} }, "compact": { "data": [], "layout": {} }, "compact_rotated": { "data": [], "layout": {} } } }All three configurations are provided for every encoded chart response, including charts that are not eligible for rotation. This gives the frontend a consistent contract that can be applied without chart-specific response handling.
fullcontains full-width, unrotated configcompactcontatins compact-width, unrotated configcompact_rotatedcontains compact-width and rotation overrides (where eligible) for rotationRotation Rules
Compact rotation is enabled for:
Compact rotation is not enabled for:
Responsive transformations
For charts eligible for compact rotation,
compact_rotated:xandyvalues.h.error_ytoerror_x.Rotated chart height is calculated as:
max(400, 200 + (category count x 25))Distinct category positions are counted across bar traces so stacked series so not incorrectly increase the height.
The original figure remains unchanged and continues to be used for static and non-JavaScript output.
Tick behaviour
The existing responsive x-axis tick behaviour is retained:
API and serializer changes
dataandlayoutobjects forfull,compactandcompact_rotated.figure_configto single-category, dual-category and subplot encoded responses (ignored by frontend for now, due to be implemented in seperate work).metrics/domain/charts/figure_config.py.Testing
Unit coverage has been added or updated for:
Fixes #3550
Type of change
Please select the options that are relevant.
Checklist: