Lattice Grid Buy a licence

demo D204

Statistical process control

Control limits against spec limits, which are not the same thing

type: 'control', y, baseline

Building…
Loading a live grid…

The configuration

import * as ng from '@angular/core';
import { Component, ViewChild, AfterViewInit } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import { createGrid } from '@toclocoinc/lattice-grid';
import '@toclocoinc/lattice-grid/css';
import { createChart } from '@toclocoinc/lattice-grid/modules/charts';
import createLatticeGrid from '@toclocoinc/lattice-grid/modules/angular';

const { LatticeGridComponent } = createLatticeGrid({ ng, createGrid });

const columns = [
  { field: 'part', title: 'Part', layout: { width: 110 } },
  // The spec declares the tolerance; the control chart reads it.
  { field: 'bore', title: 'Bore', type: 'number', spec: { lower: 9.5, upper: 10.8, target: 10 } },
];

const rows = [/* machined bore measurements */];



@Component({
  selector: 'app-root',
  standalone: true,
  imports: [LatticeGridComponent],
  template:
    '<div id="chart" style="height:340px"></div>' +
    '<lattice-grid [config]="grid" style="display:block;height:320px;margin-top:14px"></lattice-grid>',
})
export class AppComponent implements AfterViewInit {
  @ViewChild(LatticeGridComponent) gridRef!: LatticeGridComponent;

  grid = {
    rowKey: 'id',
    columns: columns,
    rows: rows,
  };

  ngAfterViewInit() {
    const grid = this.gridRef.grid;
    // baseline sets the control limits over the first readings. The chart reads
    // the live grid, handed back through the ref, so it follows every filter.
    createChart({ grid, container: '#chart', type: 'control', y: 'bore', baseline: 20 });
  }
}

bootstrapApplication(AppComponent);