Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add axis title standoff #4279

Merged
merged 5 commits into from
Oct 23, 2019
Merged

Add axis title standoff #4279

merged 5 commits into from
Oct 23, 2019

Conversation

etpinard
Copy link
Contributor

resolves #4224

This PR adds a new attribute title.standoff to cartesian axes - which determines the distance (in px) between the tick labels (at max depth) and the axis title.

example 1: https://codepen.io/etpinard/pen/LYYZJXw?editors=0010
example 2: https://codepen.io/etpinard/pen/jOOrvdZ?editors=1010

cc @plotly/plotly_js

- use `OPPOSITE_SIDE` constants
- use `shiftSign` result in `maxshift` computation
... so that we can add other `title.*` to cartesian axes
    w/o breaking other subplots
- must now compute `ax._depth` when `standoff` is set
  to get compute distance
- add `approxTitleDepth` helper with backward-compatible
  "looser" computation when `standoff` isn't set
- add two mock: one with axis `automargin:true` and one w/o
@etpinard etpinard added this to the v1.51.0 milestone Oct 16, 2019
Copy link
Contributor

@archmoj archmoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant PR.
@etpinard please find my comments below.

src/plots/cartesian/axes.js Show resolved Hide resolved
src/plots/cartesian/axes.js Outdated Show resolved Hide resolved
@archmoj
Copy link
Contributor

archmoj commented Oct 23, 2019

@etpinard My comment above is non-blocking;
so please feel free to merge.
💃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configurable padding between axis title and label
2 participants