flowhub / the-graph

SVG custom elements for FBP graph editing and visualization. Used in noflo/noflo-ui
https://flowhub.github.io/the-graph/demo-full.html
MIT License
1.01k stars 179 forks source link

abstract out a model for the whole visual state #176

Open forresto opened 10 years ago

forresto commented 10 years ago

Model? Store?

We are hooking into noflo.Graph directly, listening for change events to rerender. I'm thinking that an abstracted model will clean up some of the spaghetti.

Inputs:

Output:

If we use an immutable data structure (mori, immutable-js, React.addons.update), and everything is sent to components as props, then all of the shouldComponentUpdate() calls will be simplified to a single, fast ===.

So, the model will be responsible for:

forresto commented 10 years ago

Is immutable data a bad idea with animation?


Google says: probably. But then again... https://thestrangeloop.com/sessions/clojure-in-unity-3d-functional-video-game-development

jonnor commented 7 years ago

Once everything rendered is in specifiable via props, intermediate/internal state is in state and all events call callbacks specified in props, then the app can keep the state datastructure however it likes.