Skip to content

Commit 0865fb5

Browse files
committed
ternary grid and axis lines on by default
1 parent 38af594 commit 0865fb5

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

src/plots/ternary/layout/axis_defaults.js

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ module.exports = function supplyLayoutDefaults(containerIn, containerOut, option
2424
return Lib.coerce(containerIn, containerOut, layoutAttributes, attr, dflt);
2525
}
2626

27-
function coerce2(attr, dflt) {
28-
return Lib.coerce2(containerIn, containerOut, layoutAttributes, attr, dflt);
29-
}
30-
3127
containerOut.type = 'linear'; // no other types allowed for ternary
3228

3329
var dfltColor = coerce('color');
@@ -57,8 +53,6 @@ module.exports = function supplyLayoutDefaults(containerIn, containerOut, option
5753
handleTickMarkDefaults(containerIn, containerOut, coerce, 'linear',
5854
{ outerticks: false });
5955

60-
// TODO - below is a bit repetitious from cartesian still...
61-
6256
var showTickLabels = coerce('showticklabels');
6357
if(showTickLabels) {
6458
Lib.coerceFont(coerce, 'tickfont', {
@@ -72,23 +66,17 @@ module.exports = function supplyLayoutDefaults(containerIn, containerOut, option
7266

7367
coerce('hoverformat');
7468

75-
var lineColor = coerce2('linecolor', dfltColor),
76-
lineWidth = coerce2('linewidth'),
77-
showLine = coerce('showline', !!lineColor || !!lineWidth);
78-
79-
if(!showLine) {
80-
delete containerOut.linecolor;
81-
delete containerOut.linewidth;
69+
var showLine = coerce('showline');
70+
if(showLine) {
71+
coerce('linecolor', dfltColor);
72+
coerce('linewidth');
8273
}
8374

84-
// default grid color is darker here (60%, vs cartesian default ~91%)
85-
// because the grid is not square so the eye needs heavier cues to follow
86-
var gridColor = coerce2('gridcolor', colorMix(dfltColor, options.bgColor, 60).toRgbString()),
87-
gridWidth = coerce2('gridwidth'),
88-
showGridLines = coerce('showgrid', !!gridColor || !!gridWidth);
89-
90-
if(!showGridLines) {
91-
delete containerOut.gridcolor;
92-
delete containerOut.gridwidth;
75+
var showGridLines = coerce('showgrid');
76+
if(showGridLines) {
77+
// default grid color is darker here (60%, vs cartesian default ~91%)
78+
// because the grid is not square so the eye needs heavier cues to follow
79+
coerce('gridcolor', colorMix(dfltColor, options.bgColor, 60).toRgbString());
80+
coerce('gridwidth');
9381
}
9482
};

0 commit comments

Comments
 (0)