Charts / React science and statistics charts / Distribution
Histogram with density
A histogram with its kernel density, a fitted normal, quantile tails and a summary box, for judging skew and fit at a glance.
React component HistogramDensity, data through props. The shape of many values: swarms, ridges, heat. Tags: histogram, density, kde, normal-fit, quantiles, skew, distribution.
Install
npm i klar-charts
import 'klar-charts/styles.css'
import { ThemeScope, HistogramDensity } from 'klar-charts'
# or copy the source:
npx shadcn@latest add https://klar.run/r/sci-histogram-density.json
Usage
<HistogramDensity values={systolic} height={384} bins={48} domain={[80, 200]} axisLabel="Systolic BP (mmHg)" unit="mmHg" showNormal={fit === 'both'} />
Related histogram with density charts
- Deal beeswarm: Every open deal as a circle: days in stage across, stage by lane, size by amount, colour by risk.
- Tenure ridgeline: The spread of years at the company for each department, with the median marked.
- Cohort triangle: Net revenue retention for twelve monthly cohorts, month by month since signup.
- Dwell ridges: For each port, how many boxes waited each number of days between discharge and gate-out.
- Box plot: Median, quartiles and 1.5 × IQR whiskers per group, computed from the raw values, with outliers as dots, a mean marker and sample sizes.
- Spectrogram: Time–frequency power in dB on a canvas raster with harmonic callouts and annotation bands, for spotting tones, sweeps and resonances in a…