← Files DataARCHIVED FILE
templates/data-app/base/src/components/Chart.jsx
601 Bytes · Sep 30, 2026 · 23:19 UTC
import React from "react";
import { ChartRenderer } from "../charting/ChartRenderer.jsx";
import { resolveChartSpec } from "../charting/chart-overrides.js";
import { useOptionalDataAppShell } from "../DataAppContext.jsx";
/** Connect authored charts to saved settings; editor previews use the pure renderer. */
export function Chart({ chartId, spec, dataInputs, ...props }) {
const shell = useOptionalDataAppShell();
const chart = resolveChartSpec(spec, chartId ? shell?.chartOverrides?.[chartId] : undefined, dataInputs);
return <ChartRenderer {...props} chartId={chartId} spec={chart} />;
}
SHA-256: bb3193138a46e22fa0c3e3bc342fdfa539f03371cf1d628bef624a6a357e7e52