UNPKG

reagraph

Version:

WebGL Node-based Graph for React

29 lines (28 loc) 1.16 kB
import { PerspectiveCamera } from 'three'; import { EdgeLabelPosition } from '../symbols'; export type LabelVisibilityType = 'all' | 'auto' | 'none' | 'nodes' | 'edges'; /** * Whether label visibility for a given mode depends on the camera * distance/zoom. Only 'auto' re-evaluates as the camera moves; every other * mode is always-on, always-off, or shape-gated and therefore camera * independent. Callers use this to skip per-camera-frame recomputation. */ export declare function isLabelVisibilityCameraDependent(labelType: LabelVisibilityType): boolean; interface CalcLabelVisibilityArgs { nodeCount: number; nodePosition?: { x: number; y: number; z: number; }; labelType: LabelVisibilityType; camera?: PerspectiveCamera; } export declare function calcLabelVisibility({ nodePosition, labelType, camera }: CalcLabelVisibilityArgs): (shape: "node" | "edge", size: number, nodePositionOverride?: { x: number; y: number; z: number; }) => boolean; export declare function getLabelOffsetByType(offset: number, position: EdgeLabelPosition): number; export declare const isServerRender: boolean; export {};