UNPKG

@blockscout/ui-toolkit

Version:

A comprehensive collection of reusable Chakra UI components and theme system for Blockscout's projects

23 lines (22 loc) 855 B
import { AxesConfig, TimeChartData } from '../types'; import * as d3 from 'd3'; export declare const DEFAULT_MAXIMUM_SIGNIFICANT_DIGITS = 2; export declare const DEFAULT_MAXIMUM_FRACTION_DIGITS = 3; export declare const MAXIMUM_SIGNIFICANT_DIGITS_LIMIT = 8; export declare const DEFAULT_LABEL_LENGTH = 5; export interface LabelFormatParams extends Intl.NumberFormatOptions { maxLabelLength: number; } type Data = TimeChartData; export declare function getAxesParams(data: Data, axesConfig?: AxesConfig): { x: { scale: d3.ScaleTime<number, number, never>; tickFormatter: (axis: d3.Axis<d3.NumberValue>) => (d: d3.AxisDomain) => string; }; y: { scale: d3.ScaleLinear<number, number, never>; labelFormatParams: LabelFormatParams; tickFormatter: () => (d: d3.AxisDomain) => string; }; }; export {};