News for hackers. Stuff that matters.
Re:Reanimate: Haskell library for building declarative anima... by Temporary_31337 on Wednesday December 21, 2022 @01:59AM (#34077522)
But given that this needs to be displayed in a browser eventually, why not use libraries like the d3.js that are mentioned anyway? Seems a lot less complex?
Re:Reanimate: Haskell library for building declarative anima... by BenoitP on Wednesday December 21, 2022 @07:22AM (#34079737)
Yeah, I wish this project had a React component backend.

D3.js and Observable Plot don't work that well with modern reactive frontend frameworks either though. They don't diff the SVG tree. The recommended way to react to some data change is to rebuild the whole SVG in a useEffect [1], when in fact you could just have a reactive SVG tree [2]. You just have to unpack and recode what would D3 do (see the case about Axis in the last link). Using enter(), update() and exit() seems to no longer be the way to do things. Also, React components offers great composability to the programmer.

I wish there was a maintained React version of Observable Plot; just like what React-Three-Fiber [3] does with Three.js. Or maybe a version of this Reanimate lib into a React component.

[1] https://github.com/observablehq/plot-create-react-app-exampl...

[2] https://wattenberger.com/blog/react-and-d3

[3] https://github.com/pmndrs/react-three-fiber

Re:Reanimate: Haskell library for building declarative anima... by anon291 on Wednesday December 21, 2022 @12:32PM (#34083680)
GHC now has official JavaScript and web assembly backends