Skip to content

Commit

Permalink
exclude polar and ternary from automargins
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaskruchten committed Mar 2, 2018
1 parent ae6ec95 commit 20bdefa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/plots/polar/polar.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ proto.updateRadialAxis = function(fullLayout, polarLayout) {
position: 0,

// dummy truthy value to make Axes.doTicks draw the grid
_counteraxis: true
_counteraxis: true,

// don't use automargins routine for labels
automargin: false
});

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

// dummy truthy value to make Axes.doTicks draw the grid
_counteraxis: true
_counteraxis: true,

// don't use automargins routine for labels
automargin: false
});

// Set the angular range in degrees to make auto-tick computation cleaner,
Expand Down
9 changes: 6 additions & 3 deletions src/plots/ternary/ternary.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
_pos: 0, // _this.xaxis.domain[0] * graphSize.w,
_id: 'y',
_length: w,
_gridpath: 'M0,0l' + h + ',-' + (w / 2)
_gridpath: 'M0,0l' + h + ',-' + (w / 2),
automargin: false // don't use automargins routine for labels
});
setConvert(aaxis, _this.graphDiv._fullLayout);
aaxis.setScale();
Expand All @@ -280,7 +281,8 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
_pos: 0, // (1 - yDomain0) * graphSize.h,
_id: 'x',
_length: w,
_gridpath: 'M0,0l-' + (w / 2) + ',-' + h
_gridpath: 'M0,0l-' + (w / 2) + ',-' + h,
automargin: false // don't use automargins routine for labels
});
setConvert(baxis, _this.graphDiv._fullLayout);
baxis.setScale();
Expand All @@ -301,7 +303,8 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
_pos: 0, // _this.xaxis.domain[1] * graphSize.w,
_id: 'y',
_length: w,
_gridpath: 'M0,0l-' + h + ',' + (w / 2)
_gridpath: 'M0,0l-' + h + ',' + (w / 2),
automargin: false // don't use automargins routine for labels
});
setConvert(caxis, _this.graphDiv._fullLayout);
caxis.setScale();
Expand Down

0 comments on commit 20bdefa

Please sign in to comment.