/** * External dependencies */ import { Chart } from 'react-google-charts'; import merge from 'merge'; import { compact, formatDate, isValidJSON } from '../utils.js'; /** * WordPress dependencies */ const { startCase } = lodash; const { __ } = wp.i18n; const { Component, Fragment } = wp.element; const { Button, Dashicon, Toolbar, Tooltip } = wp.components; const { BlockControls } = wp.editor; class ChartRender extends Component { constructor() { super( ...arguments ); } render() { let chart; let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) ); if ( 0 <= [ 'gauge', 'table', 'timeline' ].indexOf( this.props.chart['visualizer-chart-type']) ) { chart = startCase( this.props.chart['visualizer-chart-type']); } else { chart = `${ startCase( this.props.chart['visualizer-chart-type']) }Chart`; } return (