8000 small fixup in axis drawTitle() · lzhice/plotly.js@6dbddc9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6dbddc9

Browse files
committed
small fixup in axis drawTitle()
- no need to export it on Axes - return Lib.syncOrAsync result
1 parent 9ebbe7d commit 6dbddc9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/plots/cartesian/axes.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,7 +2429,6 @@ axes.drawLabels = function(gd, ax, opts) {
24292429
};
24302430

24312431
function drawTitle(gd, ax) {
2432-
axes.drawTitle = function(gd, ax) {
24332432
var fullLayout = gd._fullLayout;
24342433
var axId = ax._id;
24352434
var axLetter = axId.charAt(0);
@@ -2457,13 +2456,13 @@ axes.drawTitle = function(gd, ax) {
24572456
fontSize * (ax.showticklabels ? 1.5 : 0.5);
24582457
}
24592458
y += counterAxis._offset;
2460-
}
2461-
else {
2459+
} else {
24622460
counterAxis = (ax.anchor === 'free') ?
24632461
{_offset: gs.l + (ax.position || 0) * gs.w, _length: 0} :
24642462
axisIds.getFromId(gd, ax.anchor);
24652463

24662464
y = ax._offset + ax._length / 2;
2465+
24672466
if(ax.side === 'right') {
24682467
x = counterAxis._length + titleStandoff +
24692468
fontSize * (ax.showticklabels ? 1 : 0.5);
@@ -2492,15 +2491,15 @@ axes.drawTitle = function(gd, ax) {
24922491
}
24932492
}
24942493

2495-
Titles.draw(gd, axId + 'title', {
2494+
return Titles.draw(gd, axId + 'title', {
24962495
propContainer: ax,
24972496
propName: ax._name + '.title.text',
24982497
placeholder: fullLayout._dfltTitle[axLetter],
24992498
avoid: avoid,
25002499
transform: transform,
25012500
attributes: {x: x, y: y, 'text-anchor': 'middle'}
25022501
});
2503-
};
2502+
}
25042503

25052504
axes.shouldShowZeroLine = function(gd, ax, counterAxis) {
25062505
var rng = Lib.simpleMap(ax.range, ax.r2l);

0 commit comments

Comments
 (0)
0