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

Function progress

src/chart/scatter/jitterLayout.ts:62–101  ·  view source on GitHub ↗
(params, data)

Source from the content-addressed store, hash-verified

60
61 return {
62 progress(params, data): void {
63 const points = data.getLayout('points') as Float32Array;
64 const hasPoints = !!points;
65
66 if (__DEV__) {
67 hasPoints && validateUpstreamOutputRange(data.getLayout('pointsRange'), params);
68 }
69
70 for (let i = params.start; i < params.end; i++) {
71 const offset = hasPoints ? (i - params.start) * 2 : -1;
72 const layout = hasPoints ? [points[offset], points[offset + 1]] : data.getItemLayout(i);
73 if (!layout) {
74 continue;
75 }
76
77 const rawSize = data.getItemVisual(i, 'symbolSize');
78 const size = rawSize instanceof Array ? (rawSize[1] + rawSize[0]) / 2 : rawSize;
79
80 if (jitterOnY) {
81 // x is fixed, and y is floating
82 const jittered = fixJitter(baseAxis, layout[0], layout[1], size / 2);
83 if (hasPoints) {
84 points[offset + 1] = jittered;
85 }
86 else {
87 layout[1] = jittered;
88 }
89 }
90 else if (jitterOnX) {
91 // y is fixed, and x is floating
92 const jittered = fixJitter(baseAxis, layout[1], layout[0], size / 2);
93 if (hasPoints) {
94 points[offset] = jittered;
95 }
96 else {
97 layout[0] = jittered;
98 }
99 }
100 }
101 }
102 };
103 }
104 };

Callers

nothing calls this directly

Calls 5

fixJitterFunction · 0.90
getItemLayoutMethod · 0.80
getLayoutMethod · 0.65
getItemVisualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…