本文へ移動

@eightkk/vue-weave / core / graphPathBounds

Function: graphPathBounds() ​

graphPathBounds(path): GraphRect | undefined

Defined in: src/core/graphView.ts:68

Bounding rectangle of an SVG path string. The result can be larger than the drawn stroke but never smaller: Bézier curves (C, S, Q and T, including the implicit reflected control point of S and T) are bounded by their control points, which always contain the curve. Elliptical arcs are bounded exactly: the end points plus the horizontal and vertical extrema of the rotated ellipse that fall inside the swept angle, after the radius correction of the SVG implementation notes. Stroke width is not included. Returns undefined when the path has no coordinates. Throws when the path data is malformed (including data that does not begin with a moveto) or uses an unsupported command.

Parameters ​

path ​

string

Returns ​

GraphRect | undefined

MIT ライセンスで公開しています。