Skip to content

feat: add minrange autorange option to enforce a minimum axis span - #8059

Open
seshan18 wants to merge 1 commit into
plotly:mainfrom
seshan18:main
Open

seshan18 wants to merge 1 commit into
plotly:mainfrom
seshan18:main

Conversation

@seshan18

Copy link
Copy Markdown

Title: feat: add minrange autorange option to enforce a minimum axis span

Description:

This PR introduces the autorangeoptions.minrange feature, addressing the need for a minimum visible window (especially useful for streaming graphs) that can still expand when outliers appear.

Overview of Changes:

Schema & Defaults: Added minrange to Cartesian, Polar, and GL3D schemas. Coerced the property inside handleAutorangeOptionsDefaults.
Core Logic (autorange.js): Modified applyAutorangeOptions to ensure the computed autorange span meets minrange in linearized units. It symmetrically expands the range when possible, and smartly shifts any remaining slack to the free end if a clipmin or clipmax boundary is encountered.
Valid Pins: Properly skips expansion if both ends of the axis are pinned via valid minallowed and maxallowed options.
Testing: Added comprehensive unit tests in axes_test.js validating the symmetric expansion, clipping offsets, pinning, and reversed axis logic.
Schemas: Regenerated schemas via npm run schema.
Resolves #7770

(Note: The corresponding draftlog 7770_add.md has been created and committed as per the contributing guidelines).

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.

[FEATURE]: minimum autorange window

1 participant