Including a 'class' attr causes line ghosting
adamvanaken opened this issue · comments
The path and/or line elements in the content graph are added every zoom/pan redraw, rather than updated/replaced.
Steps to reproduce:
-
Open the code sandbox from the docs: https://codesandbox.io/s/muddy-cdn-ibl5x?from-embed
-
Add a
class
attribute:
- Pan/zoom graph and notice the ghosting:
I believe this is happening because setting data.*.attr.class
is overriding the class set by functionPlot on each datum so when there's the d3 data binding it appears to functionPlot that this is a new datum.
A small workaround would be to merge the class with functionPlot's class, on the downside it'd not be possible to remove a class on update, I think that could work.
It should be fixed in https://github.com/mauriciopoppe/function-plot/releases/tag/v1.23.3, thanks for the bug report 🙏🏼.