MCPcopy
hub / github.com/apache/echarts / eachEdge

Method eachEdge

src/data/Graph.ts:198–212  ·  view source on GitHub ↗

* Iterate all edges

(
        cb: (this: Ctx, edge: GraphEdge, idx: number) => void,
        context?: Ctx
    )

Source from the content-addressed store, hash-verified

196 * Iterate all edges
197 */
198 eachEdge<Ctx>(
199 cb: (this: Ctx, edge: GraphEdge, idx: number) => void,
200 context?: Ctx
201 ) {
202 const edges = this.edges;
203 const len = edges.length;
204 for (let i = 0; i < len; i++) {
205 if (edges[i].dataIndex >= 0
206 && edges[i].node1.dataIndex >= 0
207 && edges[i].node2.dataIndex >= 0
208 ) {
209 cb.call(context, edges[i], i);
210 }
211 }
212 };
213
214 /**
215 * Breadth first traverse

Callers 6

chordLayoutFunction · 0.80
renderMethod · 0.80
adjustEdgeFunction · 0.80
simpleLayoutEdgeFunction · 0.80
renderMethod · 0.80
circularLayoutFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected