Skip to content

Instantly share code, notes, and snippets.

@pbeshai
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbeshai/02ca8a447de4dc838d15 to your computer and use it in GitHub Desktop.
Save pbeshai/02ca8a447de4dc838d15 to your computer and use it in GitHub Desktop.
import React from 'react';
import LineChart from './LineChart';
import RadialHeatmap from './RadialHeatmap';
// CSS via webpack
require('normalize.css');
require('../styles/main.css');
const LinkedHighlightingApp = React.createClass({
getInitialState() {
// make up some data
const data = [];
for (let i = 0; i <= 30; i++) {
data.push({ distance: i, value: Math.random() * 10 + i });
}
return { data };
},
// render the line chart and radial heatmap
render() {
const { data } = this.state;
return (
<div className='main'>
<LineChart data={data} width={400} height={250} xKey='distance' yKey='value' />
<RadialHeatmap data={data} width={400} height={250} radiusKey='distance' colorKey='value' />
</div>
);
}
});
React.render(<LinkedHighlightingApp />, document.getElementById('content'));
export default LinkedHighlightingApp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment