PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.3.4
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.3.4
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
← All changes | classes/Visualizer/Gutenberg/src/Components/ChartSelect.js +11 -57 3.10.43.3.4 View file →
@@ -10,10 +10,8 @@
10 10 import RemoteImport from './Import/RemoteImport.js';
11 11
12 12 import ChartImport from './Import/ChartImport.js';
13 13
14 -import DataImport from './Import/DataImport.js';
15 -
16 14 import ManualData from './Import/ManualData.js';
17 15
18 16 import Sidebar from './Sidebar.js';
19 17
@@ -22,9 +20,9 @@
22 20 import PanelButton from './PanelButton.js';
23 21
24 22 import merge from 'merge';
25 23
26 -import { compact, formatDate, isValidJSON, formatData } from '../utils.js';
24 +import { compact, formatDate, isValidJSON } from '../utils.js';
27 25
28 26 /**
29 27 * WordPress dependencies
30 28 */
@@ -36,9 +34,9 @@
36 34 Component,
37 35 Fragment
38 36 } = wp.element;
39 37
40 -const { InspectorControls } = wp.blockEditor || wp.editor;
38 +const { InspectorControls } = wp.editor;
41 39
42 40 class ChartSelect extends Component {
43 41 constructor() {
44 42 super( ...arguments );
@@ -56,32 +54,22 @@
56 54 }
57 55
58 56 render() {
59 57
60 - let chartVersion = 'undefined' !== typeof google ? google.visualization.Version : 'current';
58 + let chart;
61 59
62 - let chart, footer;
63 -
64 60 let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) );
65 61
66 - if ( 0 <= [ 'gauge', 'tabular', 'timeline' ].indexOf( this.props.chart['visualizer-chart-type']) ) {
67 - if ( 'DataTable' === data['visualizer-chart-library']) {
62 + if ( 0 <= [ 'gauge', 'table', 'timeline', 'dataTable' ].indexOf( this.props.chart['visualizer-chart-type']) ) {
63 + if ( 'dataTable' === data['visualizer-chart-type']) {
68 64 chart = data['visualizer-chart-type'];
69 65 } else {
70 - chart = this.props.chart['visualizer-chart-type'];
71 - if ( 'tabular' === chart ) {
72 - chart = 'table';
73 - }
74 - chart = startCase( chart );
66 + chart = startCase( this.props.chart['visualizer-chart-type']);
75 67 }
76 68 } else {
77 69 chart = `${ startCase( this.props.chart['visualizer-chart-type']) }Chart`;
78 70 }
79 71
80 - if ( data['visualizer-data-exploded']) {
81 - footer = __( 'Annotations in this chart may not display here but they will display in the front end.' );
82 - }
83 -
84 72 return (
85 73 <Fragment>
86 74 { 'home' === this.state.route &&
87 75 <InspectorControls>
@@ -91,35 +79,21 @@
91 79 readUploadedFile={ this.props.readUploadedFile }
92 80 />
93 81
94 82 <RemoteImport
95 - id={ this.props.id }
96 83 chart={ this.props.chart }
97 84 editURL={ this.props.editURL }
98 85 isLoading={ this.props.isLoading }
99 86 uploadData={ this.props.uploadData }
100 87 editSchedule={ this.props.editSchedule }
101 - editJSONSchedule={ this.props.editJSONSchedule }
102 - editJSONURL={ this.props.editJSONURL }
103 - editJSONHeaders={ this.props.editJSONHeaders }
104 - editJSONRoot={ this.props.editJSONRoot }
105 - editJSONPaging={ this.props.editJSONPaging }
106 - JSONImportData={ this.props.JSONImportData }
107 88 />
108 89
109 90 <ChartImport getChartData={ this.props.getChartData } isLoading={ this.props.isLoading } />
110 91
111 - <DataImport
112 - chart={ this.props.chart }
113 - editSchedule={ this.props.editDatabaseSchedule }
114 - databaseImportData={ this.props.databaseImportData }
115 - />
116 -
117 92 <ManualData chart={ this.props.chart } editChartData={ this.props.editChartData } />
118 93
119 94 <PanelButton
120 95 label={ __( 'Advanced Options' ) }
121 - className="visualizer-advanced-options"
122 96 icon="admin-tools"
123 97 onClick={ () => this.setState({ route: 'showAdvanced' }) }
124 98 />
125 99
@@ -139,9 +113,9 @@
139 113 isBack={ true }
140 114 />
141 115
142 116 { 'showAdvanced' === this.state.route &&
143 - <Sidebar chart={ this.props.chart } attributes={ this.props.attributes } edit={ this.props.editSettings } />
117 + <Sidebar chart={ this.props.chart } edit={ this.props.editSettings } />
144 118 }
145 119
146 120 { 'showPermissions' === this.state.route &&
147 121 <ChartPermissions chart={ this.props.chart } edit={ this.props.editPermissions } />
@@ -148,13 +122,13 @@
148 122 }
149 123 </InspectorControls>
150 124 }
151 125
152 - <div className="visualizer-settings__chart" data-chart-type={ chart }>
126 + <div className="visualizer-settings__chart">
153 127
154 128 { ( null !== this.props.chart ) &&
155 129
156 - ( 'DataTable' === data['visualizer-chart-library']) ? (
130 + ( 'dataTable' === chart ) ? (
157 131 <DataTable
158 132 id={ this.props.id }
159 133 rows={ data['visualizer-data'] }
160 134 columns={ data['visualizer-series'] }
@@ -159,11 +133,10 @@
159 133 rows={ data['visualizer-data'] }
160 134 columns={ data['visualizer-series'] }
161 135 options={ data['visualizer-settings'] }
162 136 />
163 - ) : ( '' !== data['visualizer-data-exploded'] ? (
137 + ) : (
164 138 <Chart
165 - chartVersion={ chartVersion }
166 139 chartType={ chart }
167 140 rows={ data['visualizer-data'] }
168 141 columns={ data['visualizer-series'] }
169 142 options={
@@ -171,30 +144,11 @@
171 144 merge( compact( this.props.chart['visualizer-settings']), JSON.parse( this.props.chart['visualizer-settings'].manual ) ) :
172 145 compact( this.props.chart['visualizer-settings'])
173 146 }
174 147 height="500px"
175 - formatters={ formatData( data ) }
176 148 />
177 - ) : (
178 - <Chart
179 - chartVersion={ chartVersion }
180 - chartType={ chart }
181 - rows={ data['visualizer-data'] }
182 - columns={ data['visualizer-series'] }
183 - options={
184 - isValidJSON( this.props.chart['visualizer-settings'].manual ) ?
185 - merge( compact( this.props.chart['visualizer-settings']), JSON.parse( this.props.chart['visualizer-settings'].manual ) ) :
186 - compact( this.props.chart['visualizer-settings'])
187 - }
188 - height="500px"
189 - formatters={ formatData( data ) }
190 - />
191 149 )
192 - ) }
193 -
194 - <div className="visualizer-settings__charts-footer"><sub>
195 - { footer }
196 - </sub></div>
150 + }
197 151
198 152 </div>
199 153 </Fragment>
200 154 );