Skip to content

Commit b4ef2ab

Browse files
committed
fix drawing splines
1 parent 7052984 commit b4ef2ab

10 files changed

+11
-18
lines changed

src/components/drawing/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,12 @@ function applyBackoff(pt, start) {
11651165
var d = pt.d;
11661166
var i = pt.i;
11671167

1168-
if(backoff && trace && trace.marker && trace.marker.angle === 0) {
1168+
if(backoff && trace &&
1169+
trace.marker &&
1170+
trace.marker.angle % 360 === 0 &&
1171+
trace.line &&
1172+
trace.line.shape !== 'spline'
1173+
) {
11691174
var arrayBackoff = Lib.isArrayOrTypedArray(backoff);
11701175
var end = pt;
11711176

src/traces/scatter/attributes.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,12 @@ module.exports = {
306306
},
307307
simplify: {
308308
valType: 'boolean',
309+
dflt: true,
309310
editType: 'plot',
310311
description: [
311312
'Simplifies lines by removing nearly-collinear points. When transitioning',
312313
'lines, it may be desirable to disable this so that the number of points',
313-
'along the resulting SVG path is unaffected.',
314-
'Defaults to *false* when `backoff` is set,',
315-
'otherwise defaults to *true*.'
314+
'along the resulting SVG path is unaffected.'
316315
].join(' ')
317316
},
318317
editType: 'plot'

src/traces/scatter/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
4242
handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce, {backoff: true});
4343
handleLineShapeDefaults(traceIn, traceOut, coerce);
4444
coerce('connectgaps');
45-
coerce('line.simplify', traceOut.backoff ? false : true);
45+
coerce('line.simplify');
4646
}
4747

4848
if(subTypes.hasMarkers(traceOut)) {
Loading

test/image/baselines/smith_gaps.png

170 Bytes
Loading
883 Bytes
Loading
Loading
537 Bytes
Loading

test/image/mocks/z-line-shape-arrow_backoff-auto.json

-12
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,15 @@
5656
"x": [
5757
1,
5858
2,
59-
null,
60-
2,
61-
3,
62-
null,
6359
3,
6460
4,
65-
null,
66-
4,
6761
5
6862
],
6963
"y": [
7064
6,
7165
8,
72-
null,
73-
8,
74-
7,
75-
null,
7666
7,
7767
8,
78-
null,
79-
8,
8068
6
8169
]
8270
},

test/plot-schema.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -43322,7 +43322,8 @@
4332243322
]
4332343323
},
4332443324
"simplify": {
43325-
"description": "Simplifies lines by removing nearly-collinear points. When transitioning lines, it may be desirable to disable this so that the number of points along the resulting SVG path is unaffected. Defaults to *false* when `backoff` is set, otherwise defaults to *true*.",
43325+
"description": "Simplifies lines by removing nearly-collinear points. When transitioning lines, it may be desirable to disable this so that the number of points along the resulting SVG path is unaffected.",
43326+
"dflt": true,
4332643327
"editType": "plot",
4332743328
"valType": "boolean"
4332843329
},

0 commit comments

Comments
 (0)