curran / model

A functional reactive model library for interactive data visualization.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using with React.js?

jefffriesen opened this issue · comments

This looks like a really good approach. I'm trying to move away from the heavy Backbone / d3 architecture to using React.js and some reusable chart libraries, like d4. I can see how this data model would fit in nicely with that.

Have you used this with React? Would you be able to post an example in the documentation?

Thanks! No, I have never used React.js. Do you know of any good starting point example using React.js that is similar to what you'd like to see for a Model.js + React.js example?

There are a few resources I've found.

These are replacing some core functionality of d3 with React:
http://10consulting.com/2014/02/19/d3-plus-reactjs-for-charting/
http://bl.ocks.org/herrstucki/9205264

These are more low-level than I was hoping for. Instead of recreating reusable chart components (like d4, nvd3, dc.js) in React from scratch I was hoping to use an existing library within a React wrapper. It may not take full advantage of React like that first link, but it would allow me to port over a large dc.js project into a React framework without having to recreate all of dc.js in React.

This is one approach that may work:
http://stackoverflow.com/questions/21903604/is-there-any-proper-way-to-integrate-d3-js-graphics-into-facebook-react-applicat

For a fuller framework on top of React (where your model may fit well as the store), Facebook has been using Flux:
http://facebook.github.io/react/docs/flux-overview.html

I think React integration is beyond the scope of this project. ModelJS is really for creating visualizations, and aims to be as simple as possible while supporting a functional reactive programming style.