Repository navigation
Implement ticklabeloverflow to improve control over display of tick labels - #5584
Conversation
| tickvals: axesAttrs.tickvals, | ||
| ticktext: axesAttrs.ticktext, | ||
| ticks: extendFlat({}, axesAttrs.ticks, {dflt: ''}), | ||
| ticklabeloverflow: extendFlat({}, axesAttrs.ticklabeloverflow, {dflt: 'allow'}), |
There was a problem hiding this comment.
You don't want a dflt here, do you?
| else if(pushOverflow) { | ||
| if(adjust.indexOf('left') !== -1) t.attr('text-anchor', 'start'); | ||
| if(adjust.indexOf('right') !== -1) t.attr('text-anchor', 'end'); | ||
| // more TODO: https://github.com/plotly/plotly.js/issues/3292 |
There was a problem hiding this comment.
You could leave another branch open with this WIP for "push to ..." but I'd rather not have it commented out in the main codebase. Anyway the eventual solution is going to need to be a bit more complex than this: we'll want to push these labels only as far as necessary, and then if doing so causes them to intersect the next labels we should still hide them.
|
The new test images look great. I don't think we want the indicator mock to change though - if indicator labels overflow the div I think we should still show them. |
Co-authored-by: Alex Johnson <[email protected]>
Good call. Done in 0deec98. |
|
⭐ please merge! |
Addressing #5404 by adding new attribute to
cartesianaxes (and few more places than use cartesian axis e.g.indicatorandcolorbar, obviously notgl3d).The options currently implemented are
allow,hide past div,hide past domain.The default value when
ticklabelpositionis set to inside is 'hide past domain'.Otherwise on category and multicategory axes the default is 'allow'.
In other cases the "new" default (to fix the bug) is 'hide past div'.
This PR also paved the way so that other options such as
push to div, andpush to domaincould be added later on the road to address #3292.@plotly/plotly_js