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.
| Method | Returns | Description |
|---|---|---|
| active | boolean | True while a presentation is running. |
| scale | number | The current enlargement. |
| start(options?) | boolean | Begin presenting. scale, views, chrome keep-list, interval for auto-advance. |
| stop() | boolean | Stop and put the grid back as it was. |
| setScale(value) | number | Set the enlargement, clamped to 0.5-4. |
| nudge(steps?) | number | Move the enlargement by steps, for the live keyboard adjustment. |
| options | object | The options the running presentation started with. |
| views | string[] | The view ids being stepped through. |
| index | number | Position in the sequence, -1 when there is none. |
| viewId | string | null | The view id currently shown. |
| step(by?) | number | Step forward or back through the sequence. |
| goTo(index) | number | Show a numbered position. |
| spotlight | object | null | What is currently lit. |
| setSpotlight(target?) | boolean | Light rows, columns or their intersection and let the rest recede. Call with nothing to clear. |
| reset() | boolean | Put 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
| Method | Returns | Description |
|---|---|---|
| attached | boolean | Whether the scrubber is recording. |
| live | boolean | True when the grid is showing the present. |
| position | number | How many steps back the grid is standing. Zero is live. |
| depth | number | How many steps back it is possible to go. |
| attach() | void | Start recording what changes replace. |
| detach() | void | Stop recording and return to the present. |
| seek(steps) | number | Stand a number of steps back, 0 being live. Clamped, not refused, at both ends. |
| step(by) | number | Move relatively; negative goes back in time. |
| toLive() | number | Return to the present, applying everything stepped over. |
| at() | number | null | The 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();
| Method | Returns | Description |
|---|---|---|
| enter() | boolean | Fill the window. false when the host element is not in the document. |
| exit() | boolean | Back to the page. false when it was not maximised. |
| toggle() | boolean | Whether the grid is maximised afterwards. |
| active() | boolean | Whether 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
| Method | Returns | Description |
|---|---|---|
| show(kind, message?) | void | 'loading' or 'empty'. |
| hide() | void |