react-d3 / react-d3-basic

Basic d3 charts in React.js, only include: line, bar, pie, scatter, area charts.
http://reactd3.org/docs/basic
221 stars 117 forks source link

Example for chartData from web URLs? #22

Open daluu opened 8 years ago

daluu commented 8 years ago

I'm new to this project, react, webpack, browserify, and d3. It's nice you have a getting started section that talks a bit about the chart data:

http://www.reactd3.org/get_start/#getting_started

http://www.reactd3.org/get_start/#write_chart (full code in your javascript section)

but it only shows the chart data structure & how you load from CSV/TSV/JSON files. What if the data is dynamic/real time from a URL (REST API, etc.)? As a novice to these JS stacks, I'm not familiar with what is the proper or simple suggested method to load the chart data from URL.

With this stack, is the loading via node.js HTTP request related modules (more like server side with the webpack/browserify bundling translating that to the needed client side equivalent) or via client side XmlHttpRequests (or whatever JS abstractions to that that one uses like jQuery/d3)?

An example of how to load the chart data from a URL would be really useful. With the assumption that the data is already in the proper format that this project requires (and if not, up to the user to reformat it).

chilijung commented 8 years ago

@daluu, react-d3 is based on React. You can find out how to load data via API in react docs, such as https://facebook.github.io/react/tips/initial-ajax.html. I'm pretty busy recently I'll write a demo if I have time.