MCPcopy Index your code
hub / github.com/apache/echarts / simpleLayoutEdge

Function simpleLayoutEdge

src/chart/graph/simpleLayoutHelper.ts:42–60  ·  view source on GitHub ↗
(graph: Graph, seriesModel: GraphSeriesModel)

Source from the content-addressed store, hash-verified

40}
41
42export function simpleLayoutEdge(graph: Graph, seriesModel: GraphSeriesModel) {
43 graph.eachEdge(function (edge, index) {
44 const curveness = zrUtil.retrieve3(
45 edge.getModel<GraphEdgeItemOption>().get(['lineStyle', 'curveness']),
46 -getCurvenessForEdge(edge, seriesModel, index, true),
47 0
48 );
49 const p1 = vec2.clone(edge.node1.getLayout());
50 const p2 = vec2.clone(edge.node2.getLayout());
51 const points = [p1, p2];
52 if (+curveness) {
53 points.push([
54 (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness,
55 (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness
56 ]);
57 }
58 edge.setLayout(points);
59 });
60}

Callers 3

graphSimpleLayoutFunction · 0.90
renderMethod · 0.90
simpleLayoutFunction · 0.85

Calls 7

getCurvenessForEdgeFunction · 0.90
eachEdgeMethod · 0.80
getLayoutMethod · 0.65
setLayoutMethod · 0.65
getMethod · 0.45
getModelMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…