reagraph
Version:
WebGL Node-based Graph for React
81 lines (80 loc) • 1.89 kB
TypeScript
import { ThreeEvent } from '@react-three/fiber';
import { FC } from 'react';
import { ColorRepresentation, Curve, Vector3 } from 'three';
export interface LineProps {
/**
* Whether the line should be animated.
*/
animated?: boolean;
/**
* The color of the line.
*
* @default '#000'
*/
color?: ColorRepresentation;
/**
* Whether the line should be curved.
*
* @default false
*/
curved: boolean;
/**
* The curve of the line in 3D space.
*/
curve: Curve<Vector3>;
/**
* Whether the line should be dashed.
*
* @default false
*/
dashed?: boolean;
/**
* Dash pattern for the line: [dashSize, gapSize]
*
* @default [3, 1]
*/
dashArray?: [number, number];
/**
* The unique identifier of the line.
*/
id: string;
/**
* The opacity of the line.
*
* @default 1
*/
opacity?: number;
/**
* The size of the line.
*
* @default 1
*/
size?: number;
/**
* The render order of the line. Useful when edges are rendered on top of each other.
*
* @default -1
*/
renderOrder?: number;
/**
* A function that is called when the line is clicked.
*/
onClick?: (event: ThreeEvent<MouseEvent>) => void;
/**
* A function that is called when the line is right-clicked.
*/
onContextMenu?: () => void;
/**
* A function that is called when the mouse pointer is moved over the line.
*/
onPointerOver?: (event: ThreeEvent<PointerEvent>) => void;
/**
* A function that is called when the mouse pointer is moved out of the line.
*/
onPointerOut?: (event: ThreeEvent<PointerEvent>) => void;
/**
* The offset of the curve.
*/
curveOffset?: number;
}
export declare const Line: FC<LineProps>;