Lattice Grid Buy a licence

api reference

Presentation, timeline and maximise

grid.presentation, grid.timeline, grid.maximise, and grid.overlay.

API reference › Presentation, timeline and maximise

grid.presentation

Enlarges the grid, drops the chrome and steps through saved views, for a screen share or a room. State only at this level: full screen and the pixels are the DOM layer's, so a headless grid can still be put into presentation state and asked about it.

grid.presentation.start({ scale: 1.5, views: ['q3', 'q4'] });
grid.presentation.step(1);                       // next view
grid.presentation.setSpotlight({ colIds: ['revenue'] });
grid.presentation.nudge(1);                      // a little larger
grid.presentation.stop();                        // or Esc

Esc ends the presentation, not just full screen: leaving one without the other would strand an enlarged, chrome-less grid in the page with no control left to turn it off. An open editor or menu still closes first.

MethodReturnsDescription
activebooleanTrue while a presentation is running.
scalenumberThe current enlargement.
start(options?)booleanBegin presenting. scale, views, chrome keep-list, interval for auto-advance.
stop()booleanStop and put the grid back as it was.
setScale(value)numberSet the enlargement, clamped to 0.5-4.
nudge(steps?)numberMove the enlargement by steps, for the live keyboard adjustment.
optionsobjectThe options the running presentation started with.
viewsstring[]The view ids being stepped through.
indexnumberPosition in the sequence, -1 when there is none.
viewIdstring | nullThe view id currently shown.
step(by?)numberStep forward or back through the sequence.
goTo(index)numberShow a numbered position.
spotlightobject | nullWhat is currently lit.
setSpotlight(target?)booleanLight rows, columns or their intersection and let the rest recede. Call with nothing to clear.
reset()booleanPut the current view back as it was saved, discarding what the presenter has sorted or filtered since.

Enlargement is a CSS scale factor multiplied into the same tokens density uses, so text, rows, padding and controls grow together rather than the grid being zoomed as an image. Font size is damped against it: type that scaled linearly with a 2× row height reads as shouting.

grid.timeline

Moves the grid back through recent data changes: what a row held a minute ago, before the number moved. It reads the change log rather than the undo history: history records what you did, and on a live grid the question is what the data did.

Nothing is scrubbable until attach(). What a value used to be is not recoverable after the fact, and reading a row per key on every change is real cost on a busy feed, so recording is off until you ask for it and the window fills from that moment.

grid.timeline.attach();              // start recording; a scrubber appears
grid.timeline.seek(5);               // stand five changes back
grid.timeline.step(-1);              // one further back
grid.timeline.at();                  // the moment being shown
grid.timeline.toLive();              // return, applying everything stepped over
grid.timeline.detach();              // stop recording; the scrubber goes
MethodReturnsDescription
attachedbooleanWhether the scrubber is recording.
livebooleanTrue when the grid is showing the present.
positionnumberHow many steps back the grid is standing. Zero is live.
depthnumberHow many steps back it is possible to go.
attach()voidStart recording what changes replace.
detach()voidStop recording and return to the present.
seek(steps)numberStand a number of steps back, 0 being live. Clamped, not refused, at both ends.
step(by)numberMove relatively; negative goes back in time.
toLive()numberReturn to the present, applying everything stepped over.
at()number | nullThe timestamp being shown.
span()object | null{ from, to }, the range the scrubber can move over.

Cells whose value moved during a seek are marked and stay marked until the next seek, in --lattice-timeline-changed. On a wide row the change you are hunting for is easy to scroll past, and a flash you can miss helps nobody. Marking compares rendered column values rather than raw fields, so a computed column that moved because its inputs moved is marked too. Chart columns redraw as you scrub, like any other cell.

Value changes reverse; row additions and removals do not, a window containing them scrubs over the value changes and leaves the row set alone. While scrubbed back the grid is not live: changes keep being recorded but are not applied, and returning to the head applies everything missed. The delta renderer is the one cell type to keep off a scrubbed grid, because it samples on a wall-clock timer and reads a seek as a real movement.

grid.maximise

Fills the browser window with the grid, and puts it back. The rail's last button is this; grid.maximise is the same thing, so an application can bind its own control or keyboard shortcut. Esc restores.

grid.maximise.toggle();     // what the rail button calls
grid.maximise.enter();
grid.maximise.active();     // true while it fills the window
grid.maximise.exit();
MethodReturnsDescription
enter()booleanFill the window. false when the host element is not in the document.
exit()booleanBack to the page. false when it was not maximised.
toggle()booleanWhether the grid is maximised afterwards.
active()booleanWhether it is filling the window now.

The host element is moved to <body> and pinned to the viewport, then moved back between the same two siblings. A position: fixed element is positioned against the nearest ancestor carrying a transform, filter, contain or will-change (any card, animated panel or sticky shell) so styling alone fills the window on one page and lands in a small box on the next. A hidden placeholder holds the vacated space at the size the grid had, so the page behind neither reflows nor loses its scroll position.

Geometry is applied as inline styles and every displaced property is handed back exactly as it was found, because the element being restyled is yours. While maximised the element carries .lat-maximised and <body> carries .lat-maximised-host, as hooks for your own CSS.

grid.overlay

MethodReturnsDescription
show(kind, message?)void'loading' or 'empty'.
hide()void