@blockscout/ui-toolkit
Version:
A comprehensive collection of reusable Chakra UI components and theme system for Blockscout's projects
31 lines (30 loc) • 925 B
TypeScript
import { default as React } from 'react';
import { AxesConfig, ChartMargin, TimeChartData } from '../types';
interface Props {
data: TimeChartData;
margin?: ChartMargin;
axesConfig?: AxesConfig;
}
export declare function useTimeChartController({ data, margin, axesConfig }: Props): {
rect: DOMRect | null;
ref: React.LegacyRef<SVGSVGElement> | undefined;
chartMargin: {
left: number;
top?: number;
right?: number;
bottom?: number;
};
innerWidth: number;
innerHeight: number;
axes: {
x: {
tickFormatter: (axis: d3.Axis<d3.NumberValue>) => (d: d3.AxisDomain) => string;
scale: import('d3-scale').ScaleTime<number, number, never>;
};
y: {
tickFormatter: () => (d: d3.AxisDomain) => string;
scale: import('d3-scale').ScaleLinear<number, number, never>;
};
};
};
export {};