Klar

Charts / React science and statistics charts / Part-to-whole

Ternary plot

Three-part compositions on an equilateral triangle with a full ternary grid, named classification regions such as USDA soil texture, and density shading.

React component TernaryPlot, data through props. How a total splits into its pieces. Tags: ternary, composition, simplex, soil-texture, usda, triangle, geochemistry.

Install

npm i klar-charts

import 'klar-charts/styles.css'
import { ThemeScope, TernaryPlot } from 'klar-charts'

# or copy the source:
npx shadcn@latest add https://klar.run/r/sci-ternary.json

Usage

<TernaryPlot
  points={soilCores}
  axes={soilAxes}
  groups={soilSites}
  regions={USDA_SOIL_CLASSES}
  showRegions={mode === 'regions'}
  density={mode === 'density'}
  valueLabel="Organic carbon (%)"
  height={480}
/>

Related ternary plot charts