Closed flekschas closed 1 year ago
When one tries to connect all points via a single line, the line connection does not show up.
E.g., the following example does not work
const scatterplot = createScatterplot({ showLineConnections: true, ... }); scatterplot.draw( new Array(10) .fill() .map((e, i) => [-1 + (i / 6) * 2, -1 + Math.random() * 2, i, 1, 0]) );
However, as soon as one attempts to draw two lines by simply changing the last point component from 0 to i % 5 the lines are drawn correctly.
0
i % 5
E.g.:
const scatterplot = createScatterplot({ showLineConnections: true, ... }); scatterplot.draw( new Array(10) .fill() .map((e, i) => [-1 + (i / 6) * 2, -1 + Math.random() * 2, i, 1, i % 5]) );
A simple fix is to flatten the curvePointValues array as follows:
curvePointValues
pointConnections.setPoints( curvePointValues.length === 1 ? curvePointValues[0] : curvePointValues, { colorIndices: getPointConnectionColorIndices(curvePointValues), opacities: getPointConnectionOpacities(curvePointValues), widths: getPointConnectionWidths(curvePointValues), } );
Thank you very much!
When one tries to connect all points via a single line, the line connection does not show up.
E.g., the following example does not work
However, as soon as one attempts to draw two lines by simply changing the last point component from
0
toi % 5
the lines are drawn correctly.E.g.:
A simple fix is to flatten the
curvePointValues
array as follows: