Closed jbphet closed 9 years ago
Why do you need to set path.shape=null
before updating the shape?
From the client standpoint, the answer is that if you don't do this, it doesn't work.
If you're asking about why Scenery requires this, my guess is that it is necessary because otherwise the Path assumes that the shape is immutable once supplied (@jonathanolson mentioned something about this), so no update will occur if the shape is set to the same value.
Graph Lines are created using moveTo, LineTo Instead adding multiple line nodes.
Looks good, closing.
MembranePotentialChart.js currently contains the following code:
This can create potentially thousands of little line nodes. It would be better to have a single Path node and update a Kite Shape on each change to the data series. Note that in order to have this work for the path, you'll need to set the shape to null. In pseudo code, you'll need to do something like this:
path.shape = null; update the shape by adding the new data point path.shape = shape
This was found during code review, see #29.