Skip to content

Function: fitAspect() ​

ts
function fitAspect(rect, aspect?): ViewportRect;

Experimental

The largest rect of aspect ratio aspect (width / height) centered in rect (plan E4.5: aspect-preserving fit, so pies stay circular in a wide domain).

Parameters ​

ParameterTypeDefault value
rectReadonly<ViewportRect>undefined
aspectnumber1

Returns ​

ViewportRect

Released under the MIT License.