import EdgeList from './edgeList'; import { AdjacencyOptions, AnimateOptions } from '../types'; /** * @class NodeList * @constructor * @param {value} 初始化 */ export default class NodeList { private galaxyvis; private ids; isNodeList: boolean; size: number; constructor(galaxyvis: any, ids: string[] | undefined); forEach: (callback: any, context: any) => void; /** * 多点居中 * @param options * @returns */ locate: (options?: AnimateOptions) => Promise; /** * 删除某个点集合的指定class * @param className * @returns */ removeClass: (className: string) => Promise; /** * 将指定的类添加到节点集合 * @param className * @returns */ addClass: (className: string) => Promise; /** * 返回这个点集合的class * @returns */ getClassList: () => string[]; /** * 返回点一度关联点 * @param options * @returns */ getAdjacentNodes: (options?: AdjacencyOptions) => NodeList; /** * 重置attribute的属性 当attributeName为空的时候整个重置 * 有值的时候重置值的那一部分。 * @param attributeNames * @returns */ resetAttributes: (attributeNames?: any[]) => Promise; /** * 设置选中 * @param active */ setSelected: (active?: boolean) => void; /** * 检索节点的位置。它严格地等价于node.getAttributes ([' x ', ' y '])。 */ getPosition: () => { x: number; y: number; }[]; /** * 检索节点的指定数据属性。 * 该方法返回内部数据对象;修改它可能会导致意外的行为。 * @param param 指定数据 string | Array * @returns */ getData: (param: string | Array) => any[]; /** * 设置节点的指定数据属性。如果没有指定属性,则更新整个数据对象。 * @param param 指定数据 string | Array * @param value 要改变的值 * @returns */ setData: (param: string | Array, value: any, isRender?: boolean) => void; /** * 返回节点的相邻边列表。 * @returns */ getAdjacentEdges: (options?: AdjacencyOptions) => EdgeList | NodeList; /** * 返回当前点的id * @returns */ getId: () => string[]; /** * 获取所有属性 或者 根据属性名获取某个属性 * 使用loadsh里的方法原先的不能获取到层级较深的属性 * @param {...any} attribute * @returns */ getAttribute: (attribute?: any, useHidden?: boolean) => any[]; /** * 设置属性 * @param {*} attribute */ setAttributes: (attribute: any, useHidden?: boolean) => Promise; /** * 翻转nodelist及获取除了这个nodelist外的点 * @returns */ inverse: () => NodeList; /** * 获取当前nodeList的包围盒 * @param staticOffsetX * @param staticOffsetY * @param incrementalNode * @returns */ getBoundingBox: (staticOffsetX?: number, staticOffsetY?: number, incrementalNode?: any) => { maxX: number; minX: number; maxY: number; minY: number; width: number; height: number; cx: number; cy: number; }; }