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

Function value

src/chart/graph/circularLayoutHelper.ts:132–148  ·  view source on GitHub ↗
(seriesModel, graph, nodeData, r, cx, cy, count)

Source from the content-addressed store, hash-verified

130const _layoutNodesBasedOn: Record<'value' | 'symbolSize', LayoutNode> = {
131
132 value(seriesModel, graph, nodeData, r, cx, cy, count) {
133 let angle = 0;
134 const sum = nodeData.getSum('value');
135 const unitAngle = Math.PI * 2 / (sum || count);
136
137 graph.eachNode(function (node) {
138 const value = node.getValue('value') as number;
139 const radianHalf = unitAngle * (sum ? value : 1) / 2;
140
141 angle += radianHalf;
142 node.setLayout([
143 r * Math.cos(angle) + cx,
144 r * Math.sin(angle) + cy
145 ]);
146 angle += radianHalf;
147 });
148 },
149
150 symbolSize(seriesModel, graph, nodeData, r, cx, cy, count) {
151 let sumRadian = 0;

Callers

nothing calls this directly

Calls 4

getValueMethod · 0.65
setLayoutMethod · 0.65
getSumMethod · 0.45
eachNodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…