text: 'use strict';
  
  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  
  var React = require('react');
  var LegendChart = require('./LegendChart');
  var BasicChart = require('./BasicChart');
  
  module.exports = React.createClass({
  
    displayName: 'Chart',
  
    propTypes: {
      legend: React.PropTypes.bool,
      svgClassName: React.PropTypes.string,
      titleClassName: React.PropTypes.string,
      shouldUpdate: React.PropTypes.bool
    },
  
    getDefaultProps: function getDefaultProps() {
      return {
        legend: false,
        svgClassName: 'rd3-chart',
        titleClassName: 'rd3-chart-title',
        shouldUpdate: true
      };
    },
    shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
      return nextProps.shouldUpdate;
    },
    render: function render() {
      var props = this.props;
  
      if (props.legend) {
        return React.createElement(LegendChart, _extends({
          svgClassName: props.svgClassName,
          titleClassName: props.titleClassName
        }, this.props));
      }
      return React.createElement(BasicChart, _extends({
        svgClassName: props.svgClassName,
        titleClassName: props.titleClassName
      }, this.props));
    }
  });