Lattice Grid Buy a licence

demo D184

Shadow columns: what changed

Delta, percent change and a move count against the value at page load

shadow: { of, kind: 'delta' }

Building…
Loading a live grid…

The configuration

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.28.0/lattice-grid.min.css">
<style>
  #grid > div { height: 460px; }
</style>
<div id="grid"></div>

<script type="module">
  import * as Vue from 'https://esm.sh/vue@3';
  import { createGrid } from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.28.0/lattice-grid.esm.min.js';
  import createLatticeGrid from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.28.0/modules/vue.esm.min.js';

  const LatticeGrid = createLatticeGrid({ vue: Vue, createGrid });

  Vue.createApp({
    components: { LatticeGrid },
    data() {
      return {
        config: {
          rowKey: 'id',
          highlightOnChange: { duration: 500 },
          columns: [
            { field: 'symbol', title: 'Symbol', layout: { pin: 'start', width: 120 } },
            { field: 'price', title: 'Price', type: 'number' },
            // A shadow column is declared against another and maintained by the grid.
            { id: 'delta',  title: 'Change',  shadow: { of: 'price', kind: 'delta' }, type: 'number', format: { signed: true } },
            { id: 'pct',    title: 'Change %', shadow: { of: 'price', kind: 'deltaPercent' }, type: 'number', format: { style: 'percent', signed: true } },
            { id: 'moves',  title: 'Moves',   shadow: { of: 'price', kind: 'updates' }, type: 'number' },
            { id: 'streak', title: 'Streak',  shadow: { of: 'price', kind: 'streak' }, type: 'number', format: { signed: true } },
          ],
          rows,  // one symbol per row
        },
      };
    },
    template: '<lattice-grid v-bind="config" />',
  }).mount('#grid');
</script>