Skip to content

ITCViewer

Isothermal titration calorimetry viewer with raw thermogram and integrated isotherm panels.

Demo

Usage

svelte
<script>
  import { ITCViewer } from '@molbiohive/hatchlings';
</script>

<ITCViewer data={itcData} width={600} height={500} />

Data Type — ITCData

FieldTypeRequiredDescription
rawThermogramITCThermogramyesRaw power vs time
isothermITCIsothermyesIntegrated heats
paramsITCParamsnoFitted parameters

ITCParams

FieldTypeDescription
NnumberStoichiometry
KanumberAssociation constant (M⁻¹)
deltaHnumberEnthalpy (kcal/mol)
deltaSnumberEntropy (cal/mol/K)
KdnumberDissociation constant (M)

Props

PropTypeDefaultDescription
dataITCDataPrimary data prop
widthnumberSVG width
heightnumberSVG height
showFitbooleanShow fitted curve
showParamsbooleanShow parameters

Example — Constructing Data

ts
import type { ITCData } from '@molbiohive/hatchlings';

const data: ITCData = {
  rawThermogram: {
    time: Array.from({ length: 300 }, (_, i) => i * 10),
    power: Array.from({ length: 300 }, (_, i) => {
      const injection = Math.floor(i / 15);
      const inPeak = i % 15 < 3;
      if (!inPeak) return 0.1 + Math.sin(i * 0.1) * 0.05;
      const decay = Math.exp(-(injection * 0.3));
      return -8 * decay + 0.1;
    }),
  },
  isotherm: {
    ratio: Array.from({ length: 20 }, (_, i) => (i + 1) * 0.15),
    heat: Array.from({ length: 20 }, (_, i) => {
      const r = (i + 1) * 0.15;
      return -12 / (1 + Math.exp((r - 1.0) * 4)) - 0.5;
    }),
    fit: {
      x: Array.from({ length: 100 }, (_, i) => i * 0.035),
      y: Array.from({ length: 100 }, (_, i) => {
        const r = i * 0.035;
        return -12 / (1 + Math.exp((r - 1.0) * 4)) - 0.5;
      }),
    },
  },
  params: { N: 1.02, Ka: 2.5e6, deltaH: -12.3, deltaS: -8.1, Kd: 4e-7 },
};

This is the data powering the demo above. See docs/data/charts.ts for the full source.