Skip to content

Commit 831ca6c

Browse files
committed
fix 3595 i.e. to avoid integer rounding errors in parcoords when using typed arrays
1 parent ecfa45a commit 831ca6c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/traces/parcoords/defaults.js

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ var mergeLength = require('./merge_length');
2222
function handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce) {
2323
var lineColor = coerce('line.color', defaultColor);
2424

25+
if(!Array.isArray(lineColor) && Lib.isArrayOrTypedArray(lineColor)) {
26+
// should convert typed arrays e.g. integers to real numbers
27+
lineColor = traceOut.line.color = Array.prototype.slice.call(lineColor);
28+
}
29+
2530
if(hasColorscale(traceIn, 'line') && Lib.isArrayOrTypedArray(lineColor)) {
2631
if(lineColor.length) {
2732
coerce('line.colorscale');

0 commit comments

Comments
 (0)