Skip to content

Commit 20bdefa

Browse files
exclude polar and ternary from automargins
1 parent ae6ec95 commit 20bdefa

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/plots/polar/polar.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ proto.updateRadialAxis = function(fullLayout, polarLayout) {
286286
position: 0,
287287

288288
// dummy truthy value to make Axes.doTicks draw the grid
289-
_counteraxis: true
289+
_counteraxis: true,
290+
291+
// don't use automargins routine for labels
292+
automargin: false
290293
});
291294

292295
setScale(ax, radialLayout, fullLayout);
@@ -410,7 +413,10 @@ proto.updateAngularAxis = function(fullLayout, polarLayout) {
410413
position: 0,
411414

412415
// dummy truthy value to make Axes.doTicks draw the grid
413-
_counteraxis: true
416+
_counteraxis: true,
417+
418+
// don't use automargins routine for labels
419+
automargin: false
414420
});
415421

416422
// Set the angular range in degrees to make auto-tick computation cleaner,

src/plots/ternary/ternary.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
261261
_pos: 0, // _this.xaxis.domain[0] * graphSize.w,
262262
_id: 'y',
263263
_length: w,
264-
_gridpath: 'M0,0l' + h + ',-' + (w / 2)
264+
_gridpath: 'M0,0l' + h + ',-' + (w / 2),
265+
automargin: false // don't use automargins routine for labels
265266
});
266267
setConvert(aaxis, _this.graphDiv._fullLayout);
267268
aaxis.setScale();
@@ -280,7 +281,8 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
280281
_pos: 0, // (1 - yDomain0) * graphSize.h,
281282
_id: 'x',
282283
_length: w,
283-
_gridpath: 'M0,0l-' + (w / 2) + ',-' + h
284+
_gridpath: 'M0,0l-' + (w / 2) + ',-' + h,
285+
automargin: false // don't use automargins routine for labels
284286
});
285287
setConvert(baxis, _this.graphDiv._fullLayout);
286288
baxis.setScale();
@@ -301,7 +303,8 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
301303
_pos: 0, // _this.xaxis.domain[1] * graphSize.w,
302304
_id: 'y',
303305
_length: w,
304-
_gridpath: 'M0,0l-' + h + ',' + (w / 2)
306+
_gridpath: 'M0,0l-' + h + ',' + (w / 2),
307+
automargin: false // don't use automargins routine for labels
305308
});
306309
setConvert(caxis, _this.graphDiv._fullLayout);
307310
caxis.setScale();

0 commit comments

Comments
 (0)