/** * External dependencies */ import { HotTable } from '@handsontable/react'; import 'handsontable/dist/handsontable.full.css'; /** * WordPress dependencies */ const { __ } = wp.i18n; const { Component } = wp.element; const { Button, ButtonGroup } = wp.components; class ChartEditor extends Component { constructor() { super( ...arguments ); this.data = []; this.dates = []; this.types = [ 'string', 'number', 'boolean', 'date', 'datetime', 'timeofday' ]; } componentWillMount() { this.data[this.data.length] = []; this.data[this.data.length] = []; this.props.chart['visualizer-series'].map( ( i, index ) => { this.data[0][ index ] = i.label; this.data[1][ index ] = i.type; if ( 'date' === i.type ) { this.dates.push( index ); } }); this.props.chart['visualizer-data'].map( ( i ) => { this.data[this.data.length] = i; }); } render() { return (