You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
2.3 KiB

4 months ago
import type { Graph } from '../runtime/graph';
import type { EdgeDirection, ElementType, ID } from '../types';
/**
* <zh/> n ID
*
* <en/> Get the IDs of all elements within an n-degree relationship from the specified element
* @remarks
* <zh/> 0 1
* 0 1
*
* <en/> For a node, 0-degree relationship includes the node itself; 1-degree relationship includes the node's direct neighbors and their connecting edges, etc.
* For an edge, 0-degree relationship includes the edge itself; 1-degree relationship includes the edge and its two endpoints, etc
* @param graph - <zh/> | <en/> graph instance
* @param elementType - <zh/> | <en/> element type
* @param elementId - <zh/> ID | <en/> start element ID
* @param degree - <zh/> | <en/> the specified degree
* @param direction - <zh/> | <en/> edge direction
* @returns - <zh/> ID | <en/> Returns an array of node and edge IDs
*/
export declare function getElementNthDegreeIds(graph: Graph, elementType: ElementType, elementId: ID, degree: number, direction?: EdgeDirection): ID[];
/**
* <zh/> n ID
*
* <en/> Get all elements IDs within n-degree relationship of the specified node
* @remarks
* <zh/> 0 1
* @param direction
* <en/> 0-degree relationship of a node is the node itself; 1-degree relationship is the node's neighboring nodes and related edges, etc
* @param graph - <zh/> | <en/> graph instance
* @param startNodeId - <zh/> ID | <en/> The ID of the starting node
* @param degree - <zh/> | <en/> The specified degree
* @param direction - <zh/> | <en/> The direction of the edge
* @returns - <zh/> ID | <en/> Returns an array of node and edge IDs
*/
export declare function getNodeNthDegreeIds(graph: Graph, startNodeId: ID, degree: number, direction?: EdgeDirection): ID[];