MCPcopy Index your code
hub / github.com/gridstack/gridstack.js / area

Method area

src/utils.ts:297–299  ·  view source on GitHub ↗

* Calculate the total area of a grid position. * * @param a position with width and height * @returns the total area (width * height) * * @example * const area = Utils.area({x: 0, y: 0, w: 3, h: 2}); // returns 6

(a: GridStackPosition)

Source from the content-addressed store, hash-verified

295 * const area = Utils.area({x: 0, y: 0, w: 3, h: 2}); // returns 6
296 */
297 static area(a: GridStackPosition): number {
298 return a.w * a.h;
299 }
300
301 /**
302 * Sort an array of grid nodes by position (y first, then x).

Callers 2

moveNodeMethod · 0.80
utils-spec.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected