sanitizeObstacles()
Clamp obstacle coordinates and sizes to finite, non-negative values.
Import
Section titled “Import”import { sanitizeObstacles } from "@graphrefly/ts/solutions/reactive-layout";Signature
Section titled “Signature”function sanitizeObstacles(obstacles: readonly Obstacle[]): readonly Obstacle[]Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
obstacles | readonly Obstacle[] | Input obstacle list. |
Returns
Section titled “Returns”A sanitized obstacle list.
Example
Section titled “Example”sanitizeObstacles([{ kind: "rect", x: 0, y: 0, width: 10, height: 20 }]);Source
Section titled “Source”packages/ts/src/solutions/reactive-layout/flow.ts