import { __ } from '@wordpress/i18n'; import { useBlockProps, InspectorControls } from '@wordpress/block-editor'; import { PanelBody, ColorPicker } from '@wordpress/components'; import './editor.scss'; import BarGraph from './components/BarGraph'; import LCPDatasetBuilder from '../../components/LCPDatasetBuilder'; import LCPDimensionControl from '../../components/LCPDimensionControl'; import LCPChartBlockSettings from '../../components/LCPChartBlockSettings'; export default function Edit({ attributes, setAttributes }) { const { chartHeight = '400px', chartWidth = '100%', barColor = '#007cba', chartData = [], valueColumn = 'Value', labelsColumn = 'Label', colorColumn = 'color', popoverColumn = 'content', } = attributes; const blockProps = useBlockProps(); const handleDatasetChange = (newData) => { setAttributes({ chartData: newData }); }; return (
{/* Bar Graph-specific Settings */} setAttributes({ chartHeight: value })} /> setAttributes({ chartWidth: value })} /> {/* Common Chart Settings */}
); }