Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Charts In React - Article resources
import React, { Component } from 'react';
import { select } from 'd3-select';
class LineChart extends Component {
componentDidMount() {
this.renderChart();
}
renderChart() {
const svg = select(this.containerEl);
// ... d3 logic goes here
}
render() {
return (
<svg
width="960"
height="500"
ref={el => this.containerEl = el}
/>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.