8000 Multicategory inside ticks fixes by etpinard · Pull Request #3326 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Multicategory inside ticks fixes #3326

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 3 commits into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
use labelLength to position multicategory ax titles
... replacing (buggy) ax._boundingBox. This fixes ax title placement
    on multicategory axes with mirror ticks
  • Loading branch information
etpinard committed Dec 12, 2018
commit 71dc6b7f34dc40c7d0273894984e22cf1b9a4554
3 changes: 2 additions & 1 deletion src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,7 @@ axes.drawOne = function(gd, ax, opts) {

seq.push(function() {
labelLength += getLabelLevelSpan(ax, axId + 'tick2');
ax._labelLength = labelLength;

return drawDividers(gd, ax, {
vals: dividerVals,
Expand Down Expand Up @@ -2608,7 +2609,7 @@ function drawTitle(gd, ax) {

var titleStandoff;
if(ax.type === 'multicategory') {
titleStandoff = ax._boundingBox[{x: 'height', y: 'width'}[axLetter]];
titleStandoff = ax._labelLength;
} else {
var offsetBase = 1.5;
titleStandoff = 10 + fontSize * offsetBase + (ax.linewidth ? ax.linewidth - 1 : 0);
Expand Down
Binary file modified test/image/baselines/multicategory-mirror.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/image/mocks/multicategory-mirror.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
],
"layout": {
"xaxis": {
"title": "MULTI-CATEGORY",
"ticks": "outside",
"showline": true,
"mirror": "ticks",
Expand Down
0