Reference · Cube engine and views
cubeWidthPxfunction
The width in pixels a cube is drawn at: width when it is a number above
zero, and otherwise the scale's. Null when neither is given, which leaves
the cube filling whatever box it is in.
Import it
import { cubeWidthPx } from "@johnmorrisdotca/kyuubu";
Definition
function cubeWidthPx(scale?: CubeScale, width?: number): number | null
Parameters
| Name | Type | Description |
|---|---|---|
scale (optional) | "small" | "medium" | "large" | undefined | The named drawing size, or null to leave the host in control. |
width (optional) | number | undefined | An explicit width in pixels; invalid or omitted widths use the scale. |
Returns
number | null
The width in pixels a cube is drawn at: width when it is a number above zero, and otherwise the scale's. null when neither is given, which leaves the cube filling whatever box it is in.
Examples
import { cubeWidthPx } from "@johnmorrisdotca/kyuubu";
console.log(cubeWidthPx("small"));72What it prints (run when this page was built)