Reference · Framing, geometry and quiz tools
boxToViewBoxfunction
A window as an SVG viewBox attribute.
Import it
import { boxToViewBox } from "@johnmorrisdotca/chizu";
Definition
function boxToViewBox(box: MapBox): string
Parameters
| Name | Type | Description |
|---|---|---|
box | MapBox | The window in native map units, or the inset destination specified by this signature. |
Returns
string
A window as an SVG viewBox attribute.
Examples
import WORLD from "@johnmorrisdotca/chizu/world";
import { boxToViewBox, focusBox } from "@johnmorrisdotca/chizu";
console.log(boxToViewBox({ x: 10, y: 20.5, width: 300, height: 200 }));
// 10 20.5 300 20010 20.5 300 200What it prints (run when this page was built)