Interface: RasterOptions
Extends
Properties
backdrop?
optional backdrop?: string;One image across all the cells (a URL), as for SVG.
Inherited from
background?
optional background?: string;Color painted over the whole region. Omit for transparent.
Inherited from
choose?
optional choose?: "placement" | "shape";With imageAspects: "shape" also picks which cells get images by their shape.
Inherited from
containWithin?
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.
Inherited from
contentCells?
optional contentCells?: ContentCells;Which cells may hold an image from the images array (default "all").
Inherited from
fill?
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.
Inherited from
imageAspects?
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.
Inherited from
imageFit?
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.
Inherited from
imageFocus?
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).
Inherited from
images?
optional images?: ImageSource;Images: an array assigned in reading order, or a function per cell.
Inherited from
loaded?
optional loaded?: ReadonlyMap<string, CanvasImage>;Loaded images by URL (see loadImages). Images not in it are skipped and their cells show fill. renderToCanvas and renderToPng load them for you.
Inherited from
loadImage?
optional loadImage?: (url) => Promise<CanvasImage>;Load an image (see loadImages).
Parameters
| Parameter | Type |
|---|---|
url | string |
Returns
Promise<CanvasImage>
pixelRatio?
optional pixelRatio?: number;Device pixels per CSS pixel, for sharp output on high-density screens. Defaults to 1.
placement?
optional placement?: ContentPlacement;Where the images go when there are fewer than cells (default "reading").
Inherited from
relief?
optional relief?: boolean | ReliefOptions;Raised tiles, as for SVG.
Inherited from
RasterOptions.relief
repeatImages?
optional repeatImages?: boolean;Reuse the images array from the start when there are more cells than images.
Inherited from
stroke?
optional stroke?: string;Outline drawn on top of each cell.
Inherited from
strokeWidth?
optional strokeWidth?: number;Inherited from
width?
optional width?: number;Output width in CSS pixels; the height follows the layout's shape. Defaults to the layout's width.