Skip to content

Diagnostics

Pass diagnostics: { onFrame } in GridOptions<T> to inspect viewport geometry, DOM pool allocation, and per-frame DOM write counts on every rendered frame.

const grid = new Grid<Order>({
container,
columnDefs,
rowData,
diagnostics: {
onFrame: (stats) => {
if (stats.renderDurationMs > 8) {
console.warn('Slow frame', {
frame: stats.frame,
ms: stats.renderDurationMs.toFixed(2),
rows: `${stats.dom.activeRows}/${stats.dom.allocatedRows}`,
cells: `${stats.dom.activeCells}/${stats.dom.allocatedCells}`,
writes: stats.writes,
});
}
},
},
});
Field Contents
frame / renderDurationMs Frame counter and render pass duration in milliseconds
viewport { scrollTop, scrollLeft, width, height }
rowRange / columnRange Visible { first, last } inclusive display indices
dom (GridDomDiagnostics) allocatedRows, activeRows, allocatedCells, activeCells, allocatedHeaders, allocatedHeaderGroups, activeHeaderGroups
writes (GridRenderWrites) canvasHeight, headerOffset, rowLayout, cellLayout, cellContent, headerBindings
rowContent Optional full-width/detail metrics (descriptors, causal, mounted, pending, measuredValues, measurementEpochs, sourceOrdinary, sourceReserved, ownedReserved)

Steady-state scrolling should show allocatedRows and allocatedCells staying constant while rowRange advances.