import type { GraphConfig } from '@graphysdk/core';
import { GraphProvider } from '@graphysdk/core';
import { DataTable } from '@graphysdk/editor';
import { useState } from 'react';
function MyEditor() {
const [config, setConfig] = useState<GraphConfig>({
data: {
columns: [
{ key: 'month', label: 'Month' },
{ key: 'sales', label: 'Sales' },
],
rows: [
{ month: 'Jan', sales: 1000 },
{ month: 'Feb', sales: 1200 },
{ month: 'Mar', sales: 1450 },
],
},
});
return (
<GraphProvider config={config} onChange={(update) => setConfig({ ...config, ...update })}>
<div style={{ width: 800, height: 500 }}>
<DataTable />
</div>
</GraphProvider>
);
}