Skip to content

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.

@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