本文整理匯總了TypeScript中graphlib.Graph.removeEdge方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Graph.removeEdge方法的具體用法?TypeScript Graph.removeEdge怎麽用?TypeScript Graph.removeEdge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類graphlib.Graph
的用法示例。
在下文中一共展示了Graph.removeEdge方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test_graph
function test_graph() {
var g = new graphlib.Graph({
compound: true,
directed: true,
multigraph: true
});
g.setEdge('a', 'b');
g.setEdge('a', 'b', 1.023, 'test');
g.setEdge({ v: 'a', w: 'b', name: 'test' }, 1.023);
g.hasEdge('a', 'b', 'test');
g.hasEdge({ v: 'a', w: 'b', name: 'test' });
g.removeEdge('a', 'b', 'test');
g.removeEdge({ v: 'a', w: 'b', name: 'test' });
g.edge('a', 'b', 'test');
g.edge({v: 'a', w: 'b', name: 'test'});
g.setDefaultNodeLabel({});
g.setDefaultNodeLabel(() => 42);
g.setDefaultEdgeLabel({});
g.setDefaultEdgeLabel(() => 'e42');
g.setNodes(['a', 'b', 'c'], 42);
g.setParent('d', 'a');
g.setParent('d');
g.parent('d');
g.children('a');
g.filterNodes(v => true);
g.setPath(['a', 'b', 'c'], 42);
graphlib.json.read(graphlib.json.write(g));
graphlib.alg.dijkstra(g, 'a', e => g.edge(e));
graphlib.alg.dijkstraAll(g, e => g.edge(e));
graphlib.alg.dijkstraAll(g);
graphlib.alg.findCycles(g);
graphlib.alg.isAcyclic(g);
graphlib.alg.prim(g, e => g.edge(e));
graphlib.alg.tarjan(g);
graphlib.alg.topsort(g);
graphlib.alg.preorder(g, g.nodes());
graphlib.alg.postorder(g, g.nodes());
}
示例2: if
return patchImports.map(patch => {
let operation = patch[0];
let importPath = patch[1];
if (this.graph.node(importPath)) {
if (operation === 'connect') {
this.graph.setEdge(relativePath, importPath);
let inEdges = this.graph.outEdges(importPath);
let inEdgePaths = inEdges.map(edge => this.graph.node(edge.v).inputPath);
return [inputPath, ...inEdgePaths];
} else if (operation === 'disconnect') {
this.graph.removeEdge(normalizedPath.id, importPath);
let inEdges = this.graph.inEdges(importPath);
return null;
}
}
// TODO we need to handle things coming out of node_modules
}).filter(Boolean);