Skip to main content

Module utils

Module utils 

Source

Functions§

bezier_control_points
bezier_path
bezier_point
distance
distance_to_bezier
orthogonal_path
Subway-style orthogonal routing: exit the source horizontally, turn at the mid-x, run vertically to the target’s row, then enter the target horizontally — with small rounded corners (quadratic turns). Reads as right-angle “subway map” wiring rather than bezier curves.
parse_px
Parse a CSS length that is a plain px value (e.g. "160px"). Returns None for any other unit or keyword, which callers read as “no constraint”.
rounded_polyline_path
SVG path through a polyline, with each corner replaced by a quadratic turn of up to radius (clamped to half of the shorter adjoining leg, so short segments round proportionally instead of overshooting).
snap_to_grid