You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when drawing lines and area charts, the interpolation between points is a line, as that is the default behavior when drawing lines with WebGL. Interpolating between the points non-linearly has value. This could be accomplished potentially by adding a check to the linecase in VertexCalculator._calculateForMark. Knowledge of the previous mark would be necessary for interpolation but this is already done when calculating area charts. The case for lines would likely look something like this:
if(this.track.mark==="line"){lettoReturn;if(this.track.interpolation==="linear"||!this.track.interpolation){// defaulttoReturn=this._getVertexForDot(mark);}elseif(this.track.interpolation==="basis"){toReturn=this._getVerticesForInterpolatedLine(mark,"basis")}this.lastMark=mark;returntoReturn;}
...
_getVerticesForInterpolatedLine(mark,interpolationType){constinterpolateFunc=getInterpolationFunctionBetweenPoints(this._mapToGPUSpace([mark.x,mark.y]),this._mapToGPUSpace([this.lastMark.x,this.lastMark.y]),interpolationType);// takes t in [0, 1] where t = 0 -> mark.xy and t -> 1 this.lastMark.xyletvertices=[]for(leti=0;i<NUM_POINTS_FOR_INTERPOLATION;i++){vertices.push(...interpolateFunc(i/NUM_POINTS_FOR_INTERPOLATION));}returnvertices;}
Be sure to add an example using the interpolation and record the expected output for future integration tests.
The text was updated successfully, but these errors were encountered:
Currently when drawing lines and area charts, the interpolation between points is a line, as that is the default behavior when drawing lines with WebGL. Interpolating between the points non-linearly has value. This could be accomplished potentially by adding a check to the
line
case inVertexCalculator._calculateForMark
. Knowledge of the previous mark would be necessary for interpolation but this is already done when calculating area charts. The case for lines would likely look something like this:Be sure to add an example using the interpolation and record the expected output for future integration tests.
The text was updated successfully, but these errors were encountered: