# visualizer/3.7.0/classes/Visualizer/Gutenberg/src/Components/Sidebar/ManualConfiguration.js

Visualizer – Tables &amp; Charts Manager with Built-in AI Generator, version 3.7.0. 105 lines.

- Page: https://pluginprobe.com/plugins/visualizer/3.7.0/code/classes/Visualizer/Gutenberg/src/Components/Sidebar/ManualConfiguration.js
- Raw: https://pluginprobe.com/plugins/visualizer/3.7.0/raw/classes/Visualizer/Gutenberg/src/Components/Sidebar/ManualConfiguration.js
- Modified: 2020-07-08T14:32:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/visualizer/3.7.0/code/classes/Visualizer/Gutenberg/src/Components/Sidebar/ManualConfiguration.js#L10-L20`.

```javascript
/**
 * 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 (
			<PanelBody
				title={ __( 'Manual Configuration' ) }
				initialOpen={ false }
				className="visualizer-advanced-panel"
			>

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

				<p>
					<ExternalLink href={ `https://developers.google.com/chart/interactive/docs/gallery/${chart}#configuration-options` }>
						{ __( 'Google Visualization API' ) }
					</ExternalLink>
				</p>

				<JSONInput
					locale={ locale }
					theme="light_mitsuketa_tribute"
					placeholder={
						isValidJSON( settings.manual ) ?
							JSON.parse( settings.manual ) :
							{}
					}
					width="100%"
					height="250px"
					style={ {
						errorMessage: {
							height: '100%',
							fontSize: '10px'
						},
						container: {
							border: '1px solid #ddd',
							boxShadow: 'inset 0 1px 2px rgba(0,0,0,.07)'
						},
						labelColumn: {
							background: '#F5F5F5',
							width: 'auto',
							padding: '5px 10px 5px 10px'
						}
					} }
					onChange={ e => {
						if ( false === e.error ) {
							settings.manual = e.json;
							this.props.edit( settings );
						}
					} }
				/>


			</PanelBody>
		);
	}
}

export default ManualConfiguration;

```
