fix: protect ECharts setOption from invalid data + add import debug logs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9b218a487a
commit
b7edc7f86e
|
|
@ -53,8 +53,12 @@ export const EChartsBase: React.FC<EChartsBaseProps> = ({
|
|||
|
||||
// Update option
|
||||
useEffect(() => {
|
||||
if (!chartRef.current) return;
|
||||
if (!chartRef.current || !option) return;
|
||||
try {
|
||||
chartRef.current.setOption(option, { notMerge: true });
|
||||
} catch (e) {
|
||||
console.warn('ECharts setOption error:', e);
|
||||
}
|
||||
}, [option]);
|
||||
|
||||
// Handle loading state
|
||||
|
|
|
|||
|
|
@ -60,8 +60,9 @@ export function useImportData() {
|
|||
try {
|
||||
const rowsResp = await dataServiceClient.getRows(dataSetId, 10000);
|
||||
rows = rowsResp.rows ?? rowsResp ?? [];
|
||||
} catch {
|
||||
// rows fetch failed, continue without
|
||||
console.log(`[DataViz] Fetched ${rows.length} rows for dataset ${dataSetId}`);
|
||||
} catch (e) {
|
||||
console.error('[DataViz] Failed to fetch rows:', e);
|
||||
}
|
||||
|
||||
const dataSet = mapBackendDataSet(rawDataSet, rows);
|
||||
|
|
|
|||
Loading…
Reference in New Issue