Skip to content

Class: AndamentoLayoutElement ​

<andamento-layout>: a tiling as a web component, for any framework or none (Angular, Svelte, Solid, Lit, plain HTML). Each child element fills one tile, in reading order, clipped to the tile's shape; children stay where you put them (they're shown in the tiles through slots), so frameworks keep managing them.

Set options (a LayoutOptions object, or JSON in the attribute) or layout. Simple settings are attributes too: navigable, animate, relief, safe-area, virtualize, fit, placement, content-cells, choose, background, fill, focus-ring, label. Give children data-aspect (width / height) to put them in tiles of their shape, and data-focus ("x y", fractions of the width and height) to keep that point of a photo in view as its tile crops it (style the photo with coverStyle, or object-position: var(--andamento-object-position)), and data-weight (how many tiles it spans) to give important children featured tiles. A child with slot="backdrop" is copied into every tile as one picture across them all.

Tiles are in the element's shadow root: style them with ::part(tile) (also empty and boundary, e.g. andamento-layout::part(empty)). Activating a tile fires cellactivate, with CellActivateDetail.

Extends ​

  • Base

Constructors ​

Constructor ​

ts
new AndamentoLayoutElement(): AndamentoLayoutElement;

Returns ​

AndamentoLayoutElement

Overrides ​

ts
Base.constructor

Properties ​

observedAttributes ​

ts
static observedAttributes: string[] = ATTRIBUTES;

Accessors ​

animated ​

Get Signature ​

ts
get animated(): 
  | boolean
  | {
  duration?: number;
  easing?: string;
}
  | undefined;

Animate changes (the animate attribute; animate itself is the Web Animations method).

Returns ​

| boolean | { duration?: number; easing?: string; } | undefined

Set Signature ​

ts
set animated(v): void;
Parameters ​
ParameterType
v| boolean | { duration?: number; easing?: string; } | undefined
Returns ​

void


aspects ​

Get Signature ​

ts
get aspects(): readonly number[] | undefined;

Width / height of each child; otherwise read from children's data-aspect.

Returns ​

readonly number[] | undefined

Set Signature ​

ts
set aspects(v): void;
Parameters ​
ParameterType
vreadonly number[] | undefined
Returns ​

void


background ​

Get Signature ​

ts
get background(): string | undefined;
Returns ​

string | undefined

Set Signature ​

ts
set background(v): void;
Parameters ​
ParameterType
vstring | undefined
Returns ​

void


cellLabel ​

Get Signature ​

ts
get cellLabel(): PerCell<string | undefined>;

Accessible name of each tile.

Returns ​

PerCell<string | undefined>

Set Signature ​

ts
set cellLabel(v): void;
Parameters ​
ParameterType
vPerCell<string | undefined>
Returns ​

void


cellStyle ​

Get Signature ​

ts
get cellStyle(): PerCell<StyleMap | undefined>;

Extra style for each tile.

Returns ​

PerCell<StyleMap | undefined>

Set Signature ​

ts
set cellStyle(v): void;
Parameters ​
ParameterType
vPerCell<StyleMap | undefined>
Returns ​

void


choose ​

Get Signature ​

ts
get choose(): "placement" | "shape" | undefined;
Returns ​

"placement" | "shape" | undefined

Set Signature ​

ts
set choose(v): void;
Parameters ​
ParameterType
v"placement" | "shape" | undefined
Returns ​

void


contentCells ​

Get Signature ​

ts
get contentCells(): ContentCells | undefined;
Returns ​

ContentCells | undefined

Set Signature ​

ts
set contentCells(v): void;
Parameters ​
ParameterType
vContentCells | undefined
Returns ​

void


fallback ​

Get Signature ​

ts
get fallback(): PerCell<TileContent>;

Content for empty tiles (rendered in the shadow root).

Returns ​

PerCell<TileContent>

Set Signature ​

ts
set fallback(v): void;
Parameters ​
ParameterType
vPerCell<TileContent>
Returns ​

void


fill ​

Get Signature ​

ts
get fill(): FillSource | undefined;

Color of empty tiles: a color, a palette or a function per cell.

Returns ​

FillSource | undefined

Set Signature ​

ts
set fill(v): void;
Parameters ​
ParameterType
vFillSource | undefined
Returns ​

void


fit ​

Get Signature ​

ts
get fit(): FitProp | undefined;
Returns ​

FitProp | undefined

Set Signature ​

ts
set fit(v): void;
Parameters ​
ParameterType
vFitProp | undefined
Returns ​

void


focalPoints ​

Get Signature ​

ts
get focalPoints(): 
  | readonly (Focus | undefined)[]
  | undefined;

Focal point of each child; otherwise read from children's data-focus.

Returns ​

| readonly (Focus | undefined)[] | undefined

Set Signature ​

ts
set focalPoints(v): void;
Parameters ​
ParameterType
v| readonly (Focus | undefined)[] | undefined
Returns ​

void


focusRing ​

Get Signature ​

ts
get focusRing(): string | false | undefined;
Returns ​

string | false | undefined

Set Signature ​

ts
set focusRing(v): void;
Parameters ​
ParameterType
vstring | false | undefined
Returns ​

void


layout ​

Get Signature ​

ts
get layout(): Layout | undefined;

A precomputed layout, instead of options.

Returns ​

Layout | undefined

Set Signature ​

ts
set layout(v): void;
Parameters ​
ParameterType
vLayout | undefined
Returns ​

void


Get Signature ​

ts
get navigable(): boolean | undefined;
Returns ​

boolean | undefined

Set Signature ​

ts
set navigable(v): void;
Parameters ​
ParameterType
vboolean | undefined
Returns ​

void


options ​

Get Signature ​

ts
get options(): LayoutOptions | undefined;

Layout options (also the options attribute, as JSON).

Returns ​

LayoutOptions | undefined

Set Signature ​

ts
set options(v): void;
Parameters ​
ParameterType
vLayoutOptions | undefined
Returns ​

void


placement ​

Get Signature ​

ts
get placement(): 
  | ContentPlacement
  | undefined;
Returns ​

| ContentPlacement | undefined

Set Signature ​

ts
set placement(v): void;
Parameters ​
ParameterType
v| ContentPlacement | undefined
Returns ​

void


relief ​

Get Signature ​

ts
get relief(): boolean | ReliefOptions | undefined;
Returns ​

boolean | ReliefOptions | undefined

Set Signature ​

ts
set relief(v): void;
Parameters ​
ParameterType
vboolean | ReliefOptions | undefined
Returns ​

void


safeArea ​

Get Signature ​

ts
get safeArea(): SafeAreaProp | undefined;
Returns ​

SafeAreaProp | undefined

Set Signature ​

ts
set safeArea(v): void;
Parameters ​
ParameterType
vSafeAreaProp | undefined
Returns ​

void


virtualize ​

Get Signature ​

ts
get virtualize(): 
  | boolean
  | {
  overscan?: number;
}
  | undefined;
Returns ​

| boolean | { overscan?: number; } | undefined

Set Signature ​

ts
set virtualize(v): void;
Parameters ​
ParameterType
v| boolean | { overscan?: number; } | undefined
Returns ​

void


weights ​

Get Signature ​

ts
get weights(): readonly number[] | undefined;

Tiles each child spans; otherwise read from children's data-weight.

Returns ​

readonly number[] | undefined

Set Signature ​

ts
set weights(v): void;
Parameters ​
ParameterType
vreadonly number[] | undefined
Returns ​

void

Methods ​

attributeChangedCallback() ​

ts
attributeChangedCallback(): void;

Returns ​

void


connectedCallback() ​

ts
connectedCallback(): void;

Returns ​

void


disconnectedCallback() ​

ts
disconnectedCallback(): void;

Returns ​

void


render() ​

ts
render(): void;

Render now rather than at the end of the current task (e.g. before measuring).

Returns ​

void


tileElement() ​

ts
tileElement(cellId): HTMLElement | undefined;

The tile element (in the shadow root) showing a cell, if it's rendered.

Parameters ​

ParameterType
cellIdstring

Returns ​

HTMLElement | undefined

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