import { JSX, FunctionComponent, MouseEvent } from 'react'; import { Interpolation, SpringValue } from '@react-spring/web'; import { Box, MotionProps, PropertyAccessor, ValueFormat, SvgDefsAndFill, Dimensions } from '@nivo/core'; import { PartialTheme } from '@nivo/theming'; import { InheritedColorConfig, OrdinalColorScaleConfig } from '@nivo/colors'; export interface ComputedDatum { id: string; path: string[]; value: number; percentage: number; formattedValue: string; x: number; y: number; radius: number; color: string; fill?: string; data: Datum; depth: number; height: number; parent?: ComputedDatum; } export type CirclePackingLayerId = 'circles' | 'labels'; export interface CirclePackingCustomLayerProps { nodes: ComputedDatum[]; } export type CirclePackingCustomLayer = FunctionComponent>; export type CirclePackingLayer = CirclePackingLayerId | CirclePackingCustomLayer; export type MouseHandler = (datum: ComputedDatum, event: MouseEvent) => void; export type MouseHandlers = { onClick?: MouseHandler; onMouseEnter?: MouseHandler; onMouseMove?: MouseHandler; onMouseLeave?: MouseHandler; }; export interface CirclePackingDataProps { data: Readonly; } export interface CirclePackingCommonProps { id: PropertyAccessor; value: PropertyAccessor; valueFormat?: ValueFormat; margin: Box; padding: number; leavesOnly: boolean; theme: PartialTheme; colors: OrdinalColorScaleConfig, 'color' | 'fill'>>; colorBy: 'id' | 'depth'; inheritColorFromParent: boolean; childColor: InheritedColorConfig>; borderWidth: number; borderColor: InheritedColorConfig>; enableLabels: boolean; label: PropertyAccessor, string>; labelsFilter?: (label: ComputedLabel) => boolean; labelsSkipRadius: number; labelTextColor: InheritedColorConfig>; layers: CirclePackingLayer[]; isInteractive: boolean; tooltip: (props: ComputedDatum) => JSX.Element; zoomedId?: string | null; animate: boolean; motionConfig: MotionProps['motionConfig']; role?: string; renderWrapper: boolean; } export interface CirclePackingSvgExtraProps { circleComponent: CircleComponent; labelComponent: LabelComponent; } export type CirclePackingSvgProps = Dimensions & CirclePackingDataProps & Partial> & Partial> & MouseHandlers & SvgDefsAndFill>; export type CirclePackingSvgPropsWithDefaults = Dimensions & CirclePackingDataProps & CirclePackingCommonProps & CirclePackingSvgExtraProps & MouseHandlers & SvgDefsAndFill>; export interface CirclePackingHtmlExtraProps { circleComponent: CircleComponent; labelComponent: LabelComponent; } export type CirclePackingHtmlProps = Dimensions & CirclePackingDataProps & Partial> & Partial> & MouseHandlers; export type CirclePackingHtmlPropsWithDefaults = Dimensions & CirclePackingDataProps & CirclePackingCommonProps & CirclePackingHtmlExtraProps & MouseHandlers; export interface CirclePackingCanvasExtraProps { pixelRatio: number; } export type CirclePackingCanvasProps = Dimensions & CirclePackingDataProps & Partial> & Partial & Pick, 'onMouseMove' | 'onClick'>; export type CirclePackingCanvasPropsWithDefaults = Dimensions & CirclePackingDataProps & CirclePackingCommonProps & CirclePackingCanvasExtraProps & Pick, 'onMouseMove' | 'onClick'>; export type CircleProps = { node: ComputedDatum; style: { x: SpringValue; y: SpringValue; radius: Interpolation; color: SpringValue; opacity: SpringValue; borderWidth: number; borderColor: SpringValue; }; } & MouseHandlers; export type CircleComponent = (props: CircleProps) => JSX.Element; export interface ComputedLabel { label: string | number; textColor: string; node: ComputedDatum; } export interface LabelProps { node: ComputedDatum; label: string | number; style: { x: SpringValue; y: SpringValue; radius: Interpolation; textColor: SpringValue; opacity: SpringValue; }; } export type LabelComponent = (props: LabelProps) => JSX.Element; //# sourceMappingURL=types.d.ts.map