MCPcopy
hub / github.com/ChartGPU/ChartGPU / makePieData

Function makePieData

examples/data-update-animation/main.ts:79–86  ·  view source on GitHub ↗
(rng: () => number)

Source from the content-addressed store, hash-verified

77};
78
79const makePieData = (rng: () => number): ReadonlyArray<PieDataItem> => {
80 return pieSliceBase.map((s) => {
81 // Keep strictly positive values so slices remain stable.
82 const jitter = 0.35 + rng() * 1.65;
83 const value = Math.max(0.1, s.base * jitter);
84 return { name: s.name, value, color: s.color };
85 });
86};
87
88const createAnimationConfig = (enabled: boolean): ChartGPUOptions['animation'] => {
89 if (!enabled) return false;

Callers 2

mainFunction · 0.85
updateChartsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected