Skip to content

Commit 3199d70

Browse files
committed
Tweak grid defaults
1 parent 1c064fc commit 3199d70

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/traces/carpet/defaults.js

+16-7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ module.exports = function supplyDefaults(traceIn, traceOut) {
3838

3939
handleAxisDefaults(traceIn, traceOut, 'a');
4040
handleAxisDefaults(traceIn, traceOut, 'b');
41+
42+
if (traceOut.a.length < 3) {
43+
traceOut.aaxis.smoothing = 0;
44+
}
45+
46+
if (traceOut.b.length < 3) {
47+
traceOut.baxis.smoothing = 0;
48+
}
49+
4150
};
4251

4352
function handleAxisDefaults(traceIn, traceOut, axis) {
@@ -65,16 +74,16 @@ function handleAxisDefaults(traceIn, traceOut, axis) {
6574
//coerce('gridoffset');
6675
//coerce('gridstep');
6776

68-
coerce('startline');
69-
coerce('startlinewidth');
70-
coerce('startlinecolor');
71-
coerce('endline');
72-
coerce('endlinewidth');
73-
coerce('endlinecolor');
74-
7577
coerce('gridwidth');
7678
coerce('gridcolor');
7779

80+
coerce('startline');
81+
coerce('startlinewidth', traceOut.gridwidth);
82+
coerce('startlinecolor', traceOut.gridcolor);
83+
coerce('endline');
84+
coerce('endlinewidth', traceOut.gridwidth);
85+
coerce('endlinecolor', traceOut.gridwidth);
86+
7887
coerce('minorgridwidth');
7988
coerce('minorgridcolor');
8089

0 commit comments

Comments
 (0)