Lattice Grid Buy a licence

demo D168

Waterfall, stream, marimekko

Sequence and composition across categories

type: 'waterfall' · 'stream' · 'marimekko'

Building…
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">

<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; height: 240px">
  <div id="waterfall"></div>
  <div id="stream"></div>
  <div id="marimekko"></div>
</div>
<div id="grid" style="height: 340px; margin-top: 14px"></div>

<script type="module">
  import { createGrid } from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/modules/htmx.esm.js';
  import { createChart } from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/modules/charts.esm.min.js';

  const grid = createGrid(document.getElementById('grid'), {
    rowKey: 'id',
    columns: [
      { field: 'circuit', title: 'Circuit', layout: { width: 180 } },
      { field: 'region', title: 'Region', filter: { type: 'set' } },
      { field: 'status', title: 'Status', filter: { type: 'set' } },
      { field: 'bandwidth', title: 'Bandwidth', type: 'number' },
      { field: 'charge', title: 'Monthly charge', type: 'number',
        format: { style: 'currency', currency: 'GBP' }, total: 'sum' },
    ],
    rows,  // an array of circuit records
  });

  // Three ways to read a total across regions, each following the sort and
  // filters on the grid in place.
  createChart({ grid, container: '#waterfall', type: 'waterfall', x: 'region', y: 'charge' });
  createChart({ grid, container: '#stream',    type: 'stream',    x: 'region', y: 'charge' });
  createChart({ grid, container: '#marimekko', type: 'marimekko', x: 'region', y: 'charge' });
</script>