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

Function calcGridColWidth

src/core/calculate.ts:35–40  ·  view source on GitHub ↗
(positionParams: PositionParams)

Source from the content-addressed store, hash-verified

33 * @returns Column width in pixels
34 */
35export function calcGridColWidth(positionParams: PositionParams): number {
36 const { margin, containerPadding, containerWidth, cols } = positionParams;
37 return (
38 (containerWidth - margin[0] * (cols - 1) - containerPadding[0] * 2) / cols
39 );
40}
41
42/**
43 * Calculate the pixel size for a grid unit dimension (width or height).

Callers 12

utils-test.jsFile · 0.90
GridItemFunction · 0.85
GridLayoutFunction · 0.85
calcGridItemPositionFunction · 0.85
calcXYFunction · 0.85
calcXYRawFunction · 0.85
calcWHFunction · 0.85
calcWHRawFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…