8000 Add `ticklabelstandoff` and `ticklabelshift` to cartesian axes by my-tien · Pull Request #7006 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Add ticklabelstandoff and ticklabelshift to cartesian axes #7006

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

Merged
merged 26 commits into from
Jul 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6c81892
Add property axis.ticklabelshiftx and axis.ticklabelshifty
my-tien May 27, 2024
ad4509b
makeTransTickLabelFn: default vals for ax.ticklabelshiftx/y
my-tien May 28, 2024
fa50121
Add draftlog for PR 7006
my-tien May 27, 2024
d33e47c
Add ticklabelshiftx/y property to colorbar, indicator, gl3d, carpet, …
my-tien May 28, 2024
3dcb2aa
baseline image for updated date_axes_period2 using ticklabelshiftx/y
my-tien May 28, 2024
facdad3
ticklabelshiftx/y: valType number → integer. for carpet: editType tic…
my-tien May 28, 2024
ecf4787
Revert ticklabelshiftx/y change to mock date_axes_period2
my-tien Jun 3, 2024
2b9c90c
Replace ticklabelshiftx/y with ticklabelrunoff and ticklabelstandoff
my-tien Jun 3, 2024
f06a81e
Adjust ticklabelrunoff/ticklabelstandoff behavior depending on axis, …
my-tien Jun 7, 2024
57c82ee
baseline test mock for ticklabelrunoff/ticklabelstandoff
my-tien Jun 7, 2024
4ccaf73
Merge remote-tracking branch 'origin-plotly/master' into shift_axis_l…
my-tien Jun 7, 2024
4b62652
baseline image for mock zzz_ticklabelrunoff_standoff
my-tien Jun 8, 2024
94878cb
Split option noTicklabelrunoffstandoff → noTicklabelrunoff, noTicklab…
my-tien Jun 13, 2024
9ca95a2
Update property names in draftlog for PR 7006
my-tien Jun 13, 2024
6ea832f
Mark flaky: "should be able to restyle radial axis title"
my-tien Jun 18, 2024
b7a6327
Revert "Mark flaky: "should be able to restyle radial axis title""
my-tien Jun 19, 2024
316158d
Merge remote-tracking branch 'origin-plotly/master' into shift_axis_l…
my-tien Jun 19, 2024
e7a980a
Revert accidentally removed line in colorbar attributes
my-tien Jun 26, 2024
e8f88ba
correct var name. it's not ticks inside/outside, but labels inside/ou…
my-tien Jun 26, 2024
d9210da
Clarify the direction of movement for ticklabelstandoff and ticklabel…
my-tien Jun 26, 2024
e33270b
update plot-schema as well
my-tien Jun 26, 2024
ec5df56
Rename ticklabelrunoff → ticklabelshift
my-tien Jul 3, 2024
e3b0baa
Update draftlogs/7006_add.md
my-tien Jul 5, 2024
23a21c1
Simplify code for standoff sign
my-tien Jul 5, 2024
6715564
Update draftlogs/7006_add.md
my-tien Jul 5, 2024
26315dc
improve ticklabelstandoff description and note that inside ticks coul…
my-tien Jul 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
correct var name. it's not ticks inside/outside, but labels inside/ou…
…tside
  • Loading branch information
my-tien committed Jun 26, 2024
commit e8f88bacd32cbd710138455203b29f70a5a4080d
12 changes: 6 additions & 6 deletions src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2977,19 +2977,19 @@ axes.makeTransTickLabelFn = function(ax) {
var isXaxis = ax._id.charAt(0) === 'x';
var isYaxis = !isXaxis;
var isReversed = ax.range[0] > ax.range[1];
var ticksInside = ax.ticklabelposition && ax.ticklabelposition.indexOf('inside') !== -1;
var ticksOutside = !ticksInside;
var labelsInside = ax.ticklabelposition && ax.ticklabelposition.indexOf('inside') !== -1;
var labelsOutside = !labelsInside;

if(runoff) {
var runoffSign = isReversed ? -1 : 1;
runoff = runoff * runoffSign;
}
if(standoff) {
var standoffSign =
isXaxis && ax.side === 'bottom' && ticksOutside ||
isXaxis && ax.side === 'top' && ticksInside ||
isYaxis && ax.side === 'right' && ticksOutside ||
isYaxis && ax.side === 'left' && ticksInside ? 1 : -1;
isXaxis && ax.side === 'bottom' && labelsOutside ||
isXaxis && ax.side === 'top' && labelsInside ||
isYaxis && ax.side === 'right' && labelsOutside ||
isYaxis && ax.side === 'left' && labelsInside ? 1 : -1;
standoff = standoff * standoffSign;
}
return isXaxis ?
Expand Down
0