Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5720802

Browse files
committed
mv ax drawTitles() to end of Axes.drawOne
- this will allow us to use ax._boundingBox for multicategory axes
1 parent 6dbddc9 commit 5720802

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/plots/cartesian/axes.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,9 +1793,6 @@ axes.drawOne = function(gd, ax, opts) {
17931793
});
17941794
}
17951795

1796-
if(!opts.skipTitle &&
1797-
!((ax.rangeslider || {}).visible && ax._boundingBox && ax.side === 'bottom')
1798-
) {
17991796
// TODO update 'avoid selection' for multicategory
18001797
seq.push(function() {
18011798
return axes.drawTitle(gd, ax);
@@ -1807,7 +1804,7 @@ axes.drawOne = function(gd, ax, opts) {
18071804
range[1] = Math.max(range[1], newRange[1]);
18081805
}
18091806

1810-
seq.push(function calcBoundingBox() {
1807+
function calcBoundingBox() {
18111808
if(ax.showticklabels) {
18121809
var gdBB = gd.getBoundingClientRect();
18131810
var bBox = mainAxLayer.node().getBoundingClientRect();
@@ -1887,9 +1884,9 @@ axes.drawOne = function(gd, ax, opts) {
18871884
[ax._boundingBox.right, ax._boundingBox.left]);
18881885
}
18891886
}
1890-
});
1887+
}
18911888

1892-
seq.push(function doAutoMargins() {
1889+
function doAutoMargins() {
18931890
var pushKey = ax._name + '.automargin';
18941891

18951892
if(!ax.automargin) {
@@ -1915,7 +1912,15 @@ axes.drawOne = function(gd, ax, opts) {
19151912
}
19161913

19171914
Plots.autoMargin(gd, pushKey, push);
1918-
});
1915+
}
1916+
1917+
seq.push(calcBoundingBox, doAutoMargins);
1918+
1919+
if(!opts.skipTitle &&
1920+
!((ax.rangeslider || {}).visible && ax._boundingBox && ax.side === 'bottom')
1921+
) {
1922+
seq.push(function() { return drawTitle(gd, ax); });
1923+
}
19191924

19201925
return Lib.syncOrAsync(seq);
19211926
};

0 commit comments

Comments
 (0)