Lattice Grid Buy a licence

demo D195

Capability against a tolerance

Cp, Cpk, Pp and Ppk from one column declaration

grid.statistics.capability(col, { baseline })

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: 440px; }
</style>
<div id="app"></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',
          columns: [
            { field: 'part', title: 'Part', layout: { pin: 'start', width: 110 } },
            // The spec declares the tolerance; capability reads it.
            { field: 'bore', title: 'Bore', type: 'number', total: 'median',
              spec: { lower: 9.5, upper: 10.8, target: 10 } },
          ],
          rows,  // machined bore measurements
        },
      };
    },
    mounted() {
      // capability reads the column's declared spec and reports Cpk and the rest.
      const grid = this.$refs.grid.grid();
      const out = document.getElementById('out');
      out.textContent = JSON.stringify(grid.statistics.capability('bore', { baseline: 20 }), null, 2);
    },
    template: `
      <div id="grid"><lattice-grid ref="grid" v-bind="config" /></div>
      <pre id="out" style="margin-top: 12px"></pre>
    `,
  }).mount('#app');
</script>