fybdp-d3-kg
Version:
Knowledge Graph using React and D3.js
109 lines (108 loc) • 3.11 kB
TypeScript
import React, { Component, ReactNode, ReactElement } from 'react';
import { ChartInternalShallowDataShape } from '../../common/data';
import { ChartTooltip, ChartTooltipProps } from '../../common/Tooltip';
import { PropFunctionTypes } from '../../common/utils/functions';
import { ColorSchemeType } from '../../common/color';
export declare type ScatterPointProps = {
/**
* Whether the element is active or not. Set internally by `ScatterSeries`.
*/
active?: boolean;
/**
* Size of the circle element.
*/
size?: ((data: ChartInternalShallowDataShape) => number) | number;
/**
* Color of the circle.
*/
color: ColorSchemeType;
/**
* Cursor for the element.
*/
cursor?: string;
/**
* D3 scale for X Axis. Set internally by `ScatterPlot`.
*/
xScale: any;
/**
* D3 scale for Y Axis. Set internally by `ScatterPlot`.
*/
yScale: any;
/**
* Height of the chart. Set internally by `ScatterPlot`.
*/
height: number;
/**
* Whether to animate the enter/update/exit. Set internally by `ScatterSeries`.
*/
animated: boolean;
/**
* Index of the element in the series. Set internally by `ScatterSeries`.
*/
index: number;
/**
* Tooltip element.
*/
tooltip: ReactElement<ChartTooltipProps, typeof ChartTooltip> | null;
/**
* Parsed data shape. Set internally by `ScatterPlot`.
*/
data: ChartInternalShallowDataShape;
/**
* Id set internally by `ScatterPlot`.
*/
id: string;
/**
* Symbol element to render.
*/
symbol: (data: ChartInternalShallowDataShape) => ReactNode;
/**
* Whether the elment is visiblbe or not.
*/
visible?: (data: ChartInternalShallowDataShape, index: number) => boolean;
/**
* Event for when a symbol is clicked.
*/
onClick: (data: ChartInternalShallowDataShape) => void;
/**
* Event for when the symbol has mouse enter.
*/
onMouseEnter: (data: ChartInternalShallowDataShape) => void;
/**
* Event for when the symbol has mouse leave.
*/
onMouseLeave: (data: ChartInternalShallowDataShape) => void;
} & PropFunctionTypes;
interface ScatterPointState {
active: boolean;
}
export declare class ScatterPoint extends Component<ScatterPointProps, ScatterPointState> {
static defaultProps: Partial<ScatterPointProps>;
rect: React.RefObject<SVGGElement>;
state: ScatterPointState;
onMouseEnter(): void;
onMouseLeave(): void;
onClick(): void;
getYPosition(): any;
getEnter(): {
x: any;
y: any;
};
getExit(): {
y: any;
x: any;
};
getTransition(): {
delay: number;
type: string;
velocity: number;
damping: number;
} | {
type: boolean;
delay: number;
};
renderCircle(): JSX.Element;
renderSymbol(): JSX.Element;
render(): JSX.Element;
}
export {};