UNPKG

reaviz

Version:

Data Visualization using React

75 lines (74 loc) 1.86 kB
import { default as React, ReactElement, FC } from 'react'; import { Tooltip, TooltipProps } from 'reablocks'; import { SankeyLinkExtra } from '../utils'; export interface SankeyLinkProps extends SankeyLinkExtra { /** * Color of the link. */ color?: string; /** * Whether the element is active or not. Set internally by `Sankey`. * * @default false */ active: boolean; /** * Whether to animate the enter/update/exit. * * @default true */ animated: boolean; /** * Id of Sankey chart. Set internally by `Sankey`. */ chartId: string; /** * CSS class to apply. */ className?: string; /** * Whether the node is disabled. Set internally by `Sankey`. * * @default false */ disabled: boolean; /** * Whether to use gradient or not. * * @default true */ gradient?: boolean; /** * Opacity callback for the link. */ opacity: (active: boolean, disabled: boolean) => number; /** * CSS styles to apply. */ style?: object; /** * Tooltip element. * * @default `<Tooltip followCursor modifiers={[offset(5)]} />` */ tooltip?: ReactElement<TooltipProps, typeof Tooltip> | null; /** * Width of the link. Set internally by `Sankey`. * * @default 0 */ width: number; /** * Event for when the link is clicked. */ onClick?: (event: React.MouseEvent<SVGPathElement>) => void; /** * Event for when the link has mouse enter. */ onMouseEnter?: (event: React.MouseEvent<SVGPathElement>) => void; /** * Event for when the link has mouse leave. */ onMouseLeave?: (event: React.MouseEvent<SVGPathElement>) => void; } export declare const SankeyLink: FC<Partial<SankeyLinkProps>>;