Conversation
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.
What
Add
chart.setLayoutOptions(layout)to change layout defaults afterinit().Why
Axes of panes created after
init()are built from layout options merged in the Store constructor, and there is no public way to change them afterwards:overrideYAxiswrites only to the addressed axis instances and never back to the layout defaults. An app that lets users switch y-axis placement at runtime (e.g.inside: true) ends up with new panes whose axes silently revert to the init-time defaults, while the shared gutter width is held by the single axis that stayed outside.How
setLayoutOptions(layout: DeepPartial<Layout>)merges into the same_layoutOptionsthe constructor populates, so panes and axes created afterwards pick the new defaults up automatically — both call sites (_createOrUseIndicatorYAxis,createYAxis) readgetLayoutOptions()at creation time, and explicit arguments still win over defaults.Semantics: affects only panes/axes created after the call; existing axes and panes are untouched (
overrideYAxis/setPaneOptionsremain the tools for those). No behavior change unless the new method is called.Also declares the existing
getLayoutOptions()in theStoreinterface (implementation already existed) and exports theLayouttype.Verification
Browser acceptance test on the built dev bundle:
inside: false, position: 'right') — unchanged behaviorsetLayoutOptions({ yAxis: { inside: true, position: 'right' } }): newMACDpane axis is created withinside: true, position: 'right'inside: falsebefore and after the callcreateYAxis({ position: 'left' })aftersetLayoutOptions({ yAxis: { position: 'right' } })yieldsposition: 'left'type-checkandcode-lintclean. Docs page + reference + menu entry included.