Closed flekschas closed 3 weeks ago
This PR fixes two issues related point filtering
What was changed in this pull request?
scatterplot.hover(filteredOutPointIdx)
preventFilterReset: true
Here's an example showing the scatterplot.draw(newPoints, { preventFilterReset: true }) works as intended now
scatterplot.draw(newPoints, { preventFilterReset: true })
https://github.com/flekschas/regl-scatterplot/assets/932103/e5e8ae77-d311-4740-af8e-9bbbc01f7ba6
I simulated this with the basic example using:
setTimeout(() => { scatterplot.filter( scatterplot .get('points') .map((point, i) => [point, i]) .filter(([point]) => point[0] >= 0) .map(([_, i]) => i) ); console.log('Filter down to points on the right'); }, [500]); setTimeout(() => { scatterplot.draw(scatterplot.get('points'), { preventFilterReset: true }); console.log('Re-draw points with `preventFilterReset: true`'); }, [1000]); setTimeout(() => { scatterplot.unfilter(); console.log('Unset filter'); }, [3000]);
Why is it necessary?
Fixes an issue raised in Jupyter-Scatter
CHANGELOG.md
README.md
This PR fixes two issues related point filtering
Description
scatterplot.hover(filteredOutPointIdx)
will not work anymorepreventFilterReset: true
, the point index buffer will not be recreated to persist the current filter stateHere's an example showing the
scatterplot.draw(newPoints, { preventFilterReset: true })
works as intended nowhttps://github.com/flekschas/regl-scatterplot/assets/932103/e5e8ae77-d311-4740-af8e-9bbbc01f7ba6
I simulated this with the basic example using:
Fixes an issue raised in Jupyter-Scatter
Checklist
CHANGELOG.md
updatedREADME.md
added or updated