freddyrangel / playing-with-react-and-d3 Goto Github PK
View Code? Open in Web Editor NEWA tutorial on the basics of getting React to work with D3
A tutorial on the basics of getting React to work with D3
Just a note on the intro paragraph: MVC was originally designed to create user interfaces, not web applications. It doesn't actually fit web applications that well, often. Just FYI :)
When I run npm i
, I get this:
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
and this:
npm WARN [email protected] requires a peer of eslint@<2.3.0 but none was installed.
Then I do npm run start
, and I get this:
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v5.6.0
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start:webpack-dev-server
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'webpack-dev-server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the playing-with-react-and-d3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server
D3 introduced a couple of API changes with versions 4.x. So now when people try to follow along they will get an error.
d3.scale.linear
is now d3.scaleLinear
Let me know if you're interested in updating this, I can send you a pull request. Thanks for the great tutorial!
hi
i couldnot run unfinished dir.
Any hints, thanks a lot.
mehdi@Pole:~/git/d3/playing-with-react-and-d3/unfinished$ npm bugs playing-with-react-and-d3
npm ERR! Linux 4.4.0-66-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "bugs" "playing-with-react-and-d3"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/playing-with-react-and-d3
npm ERR! 404
npm ERR! 404 'playing-with-react-and-d3' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! /home/mehdi/git/d3/playing-with-react-and-d3/unfinished/npm-debug.log
But why does it still work?
//unfinished/src/index.jsx
import './main.css';
import React from 'react';
import ReactDOM from 'react-dom';
import Charts from './components/chart.jsx';
const mountingPoint = document.createElement('div');
mountingPoint.className = 'react-app';
document.body.appendChild(mountingPoint);
ReactDOM.render(<Charts/>, mountingPoint);
// unfinished/src/components/chart.jsx
import React from 'react';
export default (props) => {
return <h1>Unfinished: Hello, World!</h1>;
}
But somehow it is still rendering when Charts was not defined? Charts get mapped to the only (props) there?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.