MCPcopy
hub / github.com/chartjs/Chart.js / wrapBoxes

Function wrapBoxes

src/core/core.layouts.js:28–46  ·  view source on GitHub ↗
(boxes)

Source from the content-addressed store, hash-verified

26}
27
28function wrapBoxes(boxes) {
29 const layoutBoxes = [];
30 let i, ilen, box, pos, stack, stackWeight;
31
32 for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {
33 box = boxes[i];
34 ({position: pos, options: {stack, stackWeight = 1}} = box);
35 layoutBoxes.push({
36 index: i,
37 box,
38 pos,
39 horizontal: box.isHorizontal(),
40 weight: box.weight,
41 stack: stack && (pos + stack),
42 stackWeight
43 });
44 }
45 return layoutBoxes;
46}
47
48function buildStacks(layouts) {
49 const stacks = {};

Callers 1

buildLayoutBoxesFunction · 0.85

Calls 1

isHorizontalMethod · 0.65

Tested by

no test coverage detected