content: import React from 'react'
  import ReactDOM from 'react-dom'
  
  import { Barchart,
           Donutchart } from '../../../src/index.js'
  
  
  
  const donut_options = {
    default_width: 500,
    viz_title: 'Donutchart Tite'
  }
  
  
  const barchart_options = {
    default_width: 800,
    fill: '#61DAFB',
  }
  
  
  class App extends React.Component {
    constructor(props) {
      super(props)
      this.state = {
        title: 'some cool title',
        barchart_data: [
          { name:"Facebook", score: 2.5 },
          { name:"Google", score: 3 },
          { name:"Apple", score: 4 },
          { name:"Twitter", score: 5 },
          { name:"Microsoft", score: 1 },
        ],
        donut_data: [{
          data: [{ cat: "North America",
                  val: 461.114 },
                { cat: "South America",
                  val: 390.7 },
                { cat: "Europe",
                  val: 738.6 },
                { cat: "Asia",
                  val: 4157.3 },
                { cat: "Australia",
                  val: 36.7 },
                { cat: "Africa",
                  val: 1030.4 },
                ],
          total: 6814.814,
          type: "Population",
          unit: "M"
        }]
      }
    }
  
    demo() {
      let random_data = Math.floor(Math.random() * 6) 
      this.setState({
        title: random_data,
        barchart_data: [
          { name:"Facebook", score: random_data},
          { name:"Google", score: 4 },
          { name:"Apple", score: 1 },
          { name:"Twitter", score: 5 },
          { name:"Microsoft", score: 3 },
        ],
      })
    }
  
    render() {
      return (
        <div>
          <h1>{this.state.title}</h1>
          <Donutchart data={this.state.donut_data} options={donut_options} />
          <Barchart data={this.state.barchart_data} options={barchart_options} />
          <button onClick={this.demo.bind(this)}>click me</button>
        </div>
      )
    }
  }
  
  ReactDOM.render(<App />, document.getElementById('app'))
  