Lattice Grid Buy a licence

demo D211

Analytical chemistry in Angular

Molarity, ppb and dose types, with a contaminated batch the rules find

type: molarity · ppb · doseRate

This is an analytical chemistry sheet with molarity, parts-per-billion and dose-rate types, and a contaminated batch that the rules find. It shows domain units and inline rules catching a real problem in scientific data.

Building…
Loading a live grid…

This is the Angular version. A standalone component takes the whole configuration through one config input, surfaces grid events as outputs, and exposes the live grid on a getter for anything the inputs do not cover.

The configuration

import { Component } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import { createGrid } from '@toclocoinc/lattice-grid';
import '@toclocoinc/lattice-grid/css';
import { LatticeGridComponent, provideLattice } from '@toclocoinc/lattice-grid/angular';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [LatticeGridComponent],
  template: '<lattice-grid [config]="grid" style="display:block;height:480px"></lattice-grid>',
})
export class AppComponent {
  grid = {
    rowKey: 'id',
    columnDefaults: { filter: true },
    toolPanel: { side: 'left', panels: ['columns', 'filters', 'statistics'] },
    columns: [
      { field: 'sample', title: 'Sample', layout: { pin: 'start', width: 120 } },
      { field: 'batch', title: 'Batch', filter: { type: 'set' } },
      { field: 'concentration', title: 'Concentration', type: 'molarity', total: 'median' },
      { field: 'contaminant', title: 'Contaminant', type: 'ppb', total: 'p95' },
      { field: 'temperature', title: 'Temp', type: 'celsius', total: 'avg' },
      { field: 'activity', title: 'Activity', type: 'radioactivity' },
      { field: 'doseRate', title: 'Dose rate', type: 'doseRate', total: 'max' },
    ],
    formatting: {
      contaminant: [
        { id: 'c-z', when: { op: 'zAbove', value: 3 }, style: { background: '#fbeceb', color: '#a4262c' } },
        { id: 'c-out', when: { op: 'outlier' }, style: { background: '#fff4e5' } },
      ],
    },
    rows: [/* lab samples: sample, batch, concentration, contaminant, temperature, activity, doseRate */],
  };
}

bootstrapApplication(AppComponent, {
  providers: [provideLattice({ createGrid })],
});