MCPcopy
hub / github.com/react-grid-layout/react-grid-layout / generateLayout

Function generateLayout

test/spec/benchmark-test.js:30–42  ·  view source on GitHub ↗
(n, cols = 12)

Source from the content-addressed store, hash-verified

28
29// Generate a layout with n items
30function generateLayout(n, cols = 12) {
31 const layout = [];
32 for (let i = 0; i < n; i++) {
33 layout.push({
34 i: String(i),
35 x: (i * 2) % cols,
36 y: Math.floor((i * 2) / cols) * 2,
37 w: 2,
38 h: 2
39 });
40 }
41 return layout;
42}
43
44// Generate a messy (uncompacted) layout
45function generateMessyLayout(n, cols = 12) {

Callers 1

benchmark-test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…