/** * External dependencies */ import JSONInput from 'react-json-editor-ajrm'; import locale from 'react-json-editor-ajrm/locale/en'; import { isValidJSON } from '../../utils.js'; /** * WordPress dependencies */ const { __ } = wp.i18n; const { Component } = wp.element; const { ExternalLink, PanelBody } = wp.components; class ManualConfiguration extends Component { constructor() { super( ...arguments ); this.isValidJSON = this.isValidJSON.bind( this ); } isValidJSON( obj ) { try { JSON.parse( obj ); } catch ( e ) { return false; } return true; } render() { let chart; const settings = this.props.chart['visualizer-settings']; if ( 0 <= [ 'gauge', 'tabular', 'timeline' ].indexOf( this.props.chart['visualizer-chart-type']) ) { chart = this.props.chart['visualizer-chart-type']; } else { chart = `${ this.props.chart['visualizer-chart-type'] }chart`; } return (

{ __( 'Configure the graph by providing configuration variables right from the Google Visualization API.' ) }

{ __( 'Google Visualization API' ) }

{ if ( false === e.error ) { settings.manual = e.json; this.props.edit( settings ); } } } />
); } } export default ManualConfiguration;