The following code generates a data path.
var path = gameBoard.append('path')
.attr("id", "snake" + snakeIndex)
.attr("d", interpolator(data))
.attr('stroke-width', snakeStroke)
.attr('fill', 'none')
.attr('stroke', config.snakeColor);
The healing path defined by the data is drawn correctly.
Failure here getTotalLength () is undefined:
var totalLength = path.getTotalLength();
Additionally, getPointAlongLength () is also not defined:
var point = path.getPointAtLength(position);
source
share