graphology-utils
Version:
Miscellaneous utils for graphology.
19 lines (17 loc) • 550 B
TypeScript
import Graph, {Attributes} from 'graphology-types';
export default function updateGraphKeys<
NodeAttributes extends Attributes = Attributes,
EdgeAttributes extends Attributes = Attributes
>(
graph: Graph<NodeAttributes, EdgeAttributes>,
nodeKeyUpdater: (key: string, attributes: NodeAttributes) => unknown,
edgeKeyUpdater: (
key: string,
attributes: EdgeAttributes,
source: string,
target: string,
sourceAttributes: NodeAttributes,
targetAttributes: NodeAttributes,
undirected: boolean
) => unknown
): Graph;