mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Profile per-column cardinality and extent; add data-aware chart warnings (M4, A3/A4)
This commit is contained in:
@@ -358,8 +358,14 @@ export function ChartBuilderModal() {
|
||||
// fresh array each render (which loops useSyncExternalStore — see SnippetStore note).
|
||||
const config = useChartBuilderStore((s) => s.config);
|
||||
const rowCount = useChartBuilderStore((s) => s.rowCount);
|
||||
// `columns` is a stable reference set once at init (not rebuilt per render), so
|
||||
// subscribing to it won't loop useSyncExternalStore.
|
||||
const columns = useChartBuilderStore((s) => s.columns);
|
||||
const valid = useMemo(() => isBuilderConfigValid(config), [config]);
|
||||
const warnings = useMemo(() => builderWarnings(config, rowCount), [config, rowCount]);
|
||||
const warnings = useMemo(
|
||||
() => builderWarnings(config, rowCount, columns),
|
||||
[config, rowCount, columns],
|
||||
);
|
||||
const canSort = useMemo(() => supportsSort(config), [config]);
|
||||
const canStack = useMemo(() => supportsStack(config), [config]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user