Skip to content

Interface: RenderOptions ​

Properties ​

backdrop? ​

ts
optional backdrop?: string;

One image across all the cells (a URL): drawn once over the layout bounds (cropped to cover them) and clipped to the cells, so each cell shows its piece. Cells' fill isn't drawn; per-cell images still go on top.


background? ​

ts
optional background?: string;

Color painted over the whole region. Omit for transparent.


choose? ​

ts
optional choose?: "placement" | "shape";

With imageAspects: "shape" also picks which cells get images by their shape.


containWithin? ​

ts
optional containWithin?: "tile" | "visible";

With imageFit: "contain", for cells an edges: "window" layout cuts: fit the image in the whole tile ("tile", the default; partly hidden like the tile) or in the part that shows ("visible"). See SafeAreaOptions.within.


contentCells? ​

ts
optional contentCells?: ContentCells;

Which cells may hold an image from the images array (default "all").


fill? ​

ts
optional fill?: FillSource;

Cell color when there is no image: a color, a palette (neighboring cells get different entries), or a function. Defaults to defaultPalette.


height? ​

ts
optional height?: string | number;

idPrefix? ​

ts
optional idPrefix?: string;

Prefix for generated element ids; set it when several layouts share a page.


imageAlts? ​

ts
optional imageAlts?: readonly string[];

Text alternative for each image in images (by position). Cells showing an image with one become labeled images to assistive technology, and the SVG a group of them; the other cells are hidden as decoration.


imageAspects? ​

ts
optional imageAspects?: readonly number[];

Width / height of each image in images. When given, each image goes in a cell of similar shape, to crop as little as possible (see matchSlots). Ignored with repeatImages.


imageFit? ​

ts
optional imageFit?: "cover" | "contain";

How each image fills its cell: "cover" (default) fills the cell's bounding box and is cropped to the cell's shape; "contain" shows the whole image inside the cell's safe area (see safeArea), uncropped. Give imageAspects so the safe area has each image's shape.


imageFocus? ​

ts
optional imageFocus?: readonly (Focus | undefined)[];

Focal point of each image in images (by position; fractions of its width and height, see estimateFocus): what to keep in view when "cover" crops it. It goes as near the middle of what shows of its cell as covering the cell allows (see coverRect). Needs each image's shape, from imageAspects or the focus's aspect (the canvas renderers measure the images themselves).


images? ​

ts
optional images?: ImageSource;

Images: an array assigned in reading order, or a function per cell.


placement? ​

ts
optional placement?: ContentPlacement;

Where the images go when there are fewer than cells (default "reading").


precision? ​

ts
optional precision?: number;

Decimal places for coordinates. Defaults to 3.


relief? ​

ts
optional relief?: boolean | ReliefOptions;

Raised tiles: a lit bevel round each tile, and optionally a shadow cast into the grout. true for the defaults. See ReliefOptions.


repeatImages? ​

ts
optional repeatImages?: boolean;

Reuse the images array from the start when there are more cells than images.


stroke? ​

ts
optional stroke?: string;

Outline drawn on top of each cell.


strokeWidth? ​

ts
optional strokeWidth?: number;

title? ​

ts
optional title?: string;

Accessible title.


width? ​

ts
optional width?: string | number;

Width/height attributes of the <svg>; it always gets a viewBox.

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).