UNPKG

drizzle-cube

Version:

Drizzle ORM-first semantic layer with Cube.js compatibility. Type-safe analytics and dashboards with SQL injection protection.

57 lines (56 loc) 1.46 kB
import { ReactNode } from 'react'; import { ChartType, ChartProps } from '../types'; /** * Check if a chart type is supported */ export declare function isValidChartType(chartType: string): chartType is ChartType; export interface LazyChartProps extends ChartProps { chartType: ChartType; fallback?: ReactNode; } /** * Lazy Chart Component * * Renders a chart component with React.lazy dynamic loading. * The chart type determines which chart component is loaded. * * @example * ```tsx * <LazyChart * chartType="bar" * data={chartData} * chartConfig={{ yAxis: ['value'] }} * height={300} * /> * ``` */ export declare function LazyChart({ chartType, fallback, height, ...chartProps }: LazyChartProps): import("react/jsx-runtime").JSX.Element; /** * Preload a chart type * * Triggers the dynamic import without rendering. * Useful for prefetching charts that will likely be needed. * * @example * ```tsx * // Preload bar chart on hover * onMouseEnter={() => preloadChart('bar')} * ``` */ export declare function preloadChart(chartType: ChartType): void; /** * Preload multiple chart types * * @example * ```tsx * // Preload common charts on app init * useEffect(() => { * preloadCharts(['bar', 'line', 'pie']) * }, []) * ``` */ export declare function preloadCharts(chartTypes: ChartType[]): void; /** * Get all available chart types */ export declare function getAvailableChartTypes(): ChartType[];