demo D181
The statistics panel
The column profile as a docked tool panel, following the filters
toolPanel: { panels: ['statistics'] }
Loading a live grid…
The configuration
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/lattice-grid.min.css">
<script type="module">
import { defineLatticeGrid } from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/modules/webcomponent.esm.js';
defineLatticeGrid();
</script>
<lattice-grid row-key="id" style="display: block; height: 540px"></lattice-grid>
<script type="module">
const grid = document.querySelector('lattice-grid');
grid.config = {
selection: 'multiple',
// openPanel shows the statistics panel on load rather than leaving it to a
// click, so the figures and the histogram are the first thing seen. Pick a
// column in the panel and every figure follows the filtered rows.
toolPanel: { side: 'left', panels: ['columns', 'filters', 'statistics'], openPanel: 'statistics', exportName: 'book' },
columnDefaults: { filter: true },
columns: [
{ field: 'symbol', title: 'Symbol', layout: { pin: 'start', width: 120 } },
{ field: 'desk', title: 'Desk', filter: { type: 'set' } },
{ field: 'region', title: 'Region', filter: { type: 'set' } },
{ field: 'price', title: 'Price', type: 'number', format: { decimals: 4 } },
{ field: 'change', title: 'Change', type: 'number', format: { style: 'percent', decimals: 2 } },
{ field: 'volume', title: 'Volume', type: 'number', format: { notation: 'compact' } },
{ field: 'notional', title: 'Notional', type: 'number', format: { style: 'currency', currency: 'USD', decimals: 2 }, total: 'sum' },
],
};
grid.rows = rows; // an array of instruments, one per row
</script>