react-plot
Version:
Library of React components to render SVG 2D plots.
34 lines • 1.15 kB
TypeScript
import type { CSSProperties, ReactNode, SVGAttributes } from 'react';
import type { Scales, TicksType } from './types.js';
interface CoordinatesXY {
x1?: number;
x2?: number;
y1?: number;
y2?: number;
}
export interface TickProps {
children?: ReactNode;
line: CoordinatesXY;
text: Omit<CoordinatesXY, 'x2' | 'y2'>;
secondary?: boolean;
dominantBaseline?: string;
strokeColor?: string;
strokeHeight?: number;
anchor?: SVGAttributes<SVGTextElement>['textAnchor'];
labelStyle?: CSSProperties;
style?: CSSProperties;
}
export interface TicksProps extends Omit<TickProps, 'line' | 'text'> {
primaryTicks: TicksType[];
secondaryTickLength: number;
scale: Scales;
secondaryTickStyle?: CSSProperties;
getPositions: (y: number, secondary?: boolean) => {
line: CoordinatesXY;
text: Omit<CoordinatesXY, 'x2' | 'y2'>;
};
}
export declare function Ticks(props: Omit<TicksProps, 'children'>): import("react/jsx-runtime").JSX.Element;
export declare function Tick(props: TickProps): import("react/jsx-runtime").JSX.Element;
export {};
//# sourceMappingURL=Ticks.d.ts.map