import { type CircleStyleProps } from '../../elements';
import type { RuntimeContext } from '../../runtime/types';
import type { EdgeData, NodeData } from '../../spec';
import type { EdgeStyle } from '../../spec/element/edge';
import type { NodeStyle } from '../../spec/element/node';
import type { ElementType, ID, IPointerEvent } from '../../types';
import type { BasePluginOptions } from '../base-plugin';
import { BasePlugin } from '../base-plugin';
/**
* 边过滤镜插件配置项
*
* Edge filter lens plugin options
*/
export interface EdgeFilterLensOptions extends BasePluginOptions {
/**
* 移动透镜的方式
* - `'pointermove'`:始终跟随鼠标移动
* - `'click'`:鼠标点击时透镜移动
* - `'drag'`:拖拽透镜
*
* The way to move the lens
* - `'pointermove'`: always follow the mouse movement
* - `'click'`: move the lens when the mouse clicks
* - `'drag'`: drag the lens
* @defaultValue 'pointermove'
*/
trigger?: 'pointermove' | 'click' | 'drag';
/**
* 透镜的半径
*
* The radius of the lens
* @defaultValue 60
*/
r?: number;
/**
* 透镜的最大半径。只有在 `scaleRBy` 为 `wheel` 时生效
*
* The maximum radius of the lens. Only valid when `scaleRBy` is `wheel`
* @defaultValue canvas 宽高最小值的一半
*/
maxR?: number;
/**
* 透镜的最小半径。只有在 `scaleRBy` 为 `wheel` 时生效
*
* The minimum radius of the lens. Only valid when `scaleRBy` is `wheel`
* @defaultValue 0
*/
minR?: number;
/**
* 缩放透镜半径的方式
* - `'wheel'`:通过滚轮缩放透镜的半径
*
* The way to scale the radius of the lens
* - `'wheel'`: scale the radius of the lens by the wheel
* @defaultValue `'wheel'`
*/
scaleRBy?: 'wheel';
/**
* 边显示的条件
* - `'both'`:只有起始节点和目标节点都在透镜中时,边才会显示
* - `'source'`:只有起始节点在透镜中时,边才会显示
* - `'target'`:只有目标节点在透镜中时,边才会显示
* - `'either'`:只要起始节点或目标节点有一个在透镜中时,边就会显示
*
* The condition for displaying the edge
* - `'both'`: The edge is displayed only when both the source node and the target node are in the lens
* - `'source'`: The edge is displayed only when the source node is in the lens
* - `'target'`: The edge is displayed only when the target node is in the lens
* - `'either'`: The edge is displayed when either the source node or the target node is in the lens
* @defaultValue 'both'
*/
nodeType?: 'both' | 'source' | 'target' | 'either';
/**
* 过滤出始终不在透镜中显示的元素
*
* Filter elements that are never displayed in the lens
* @param id - 元素的 id | The id of the element
* @param elementType - 元素的类型 | The type of the element
* @returns 是否显示 | Whether to display
*/
filter?: (id: ID, elementType: ElementType) => boolean;
/**
* 透镜的样式
*
* The style of the lens
*/
style?: Partial;
/**
* 在透镜中节点的样式
*
* The style of the nodes displayed in the lens
*/
nodeStyle?: NodeStyle | ((datum: NodeData) => NodeStyle);
/**
* 在透镜中边的样式
*
* The style of the edges displayed in the lens
*/
edgeStyle?: EdgeStyle | ((datum: EdgeData) => EdgeStyle);
/**
* 是否阻止默认事件
*
* Whether to prevent the default event
* @defaultValue true
*/
preventDefault?: boolean;
}
/**
* 边过滤镜插件
*
* Edge filter lens plugin
* @remarks
* 边过滤镜可以将关注的边保留在过滤镜范围内,其他边将在该范围内不显示。
*
* EdgeFilterLens can keep the focused edges within the lens range, while other edges will not be displayed within that range.
*/
export declare class EdgeFilterLens extends BasePlugin {
static defaultOptions: Partial;
constructor(context: RuntimeContext, options: EdgeFilterLensOptions);
private lens;
private shapes;
private r;
private get canvas();
private get isLensOn();
protected onEdgeFilter: (event: IPointerEvent) => void;
private renderLens;
private getFilterData;
private getFocusElements;
private renderFocusElements;
private getElementStyle;
private scaleRByWheel;
get graphDom(): import("@antv/g").CanvasLike | null;
private isLensDragging;
private onDragStart;
private onDrag;
private onDragEnd;
private bindEvents;
private unbindEvents;
update(options: Partial): void;
destroy(): void;
}