Bioinformatics · katucharts.js/bio

Volcano

type: 'volcano'

Volcano plot — fold change (x) vs statistical significance (−log10 p-value, y). Points are colored by significance thresholds: upregulated, downregulated, non-significant.

Edit the JSON on the right and press Run (or ⌘/Ctrl + Enter) — data, titles, categories and colors all update live.

Live
Volcano
Edit · JSON

Data format

{ x: log2FC, y: -log10pval, name?: geneName }

Data shape

The JSON you pass inside the chart — drop it straight into your series.

data: [
  { x: 2.5, y: 10.3, name: 'BRCA1' },
  { x: -1.8, y: 4.2, name: 'TP53' },
  { x: 0.8, y: 8.1, name: 'PTEN' }
]

Example

import KatuCharts from 'katucharts.js';
import 'katucharts.js/bio';

KatuCharts.chart('container', {
  series: [{
    type: 'volcano',
    data: [{ x: 2.5, y: 10.3, name: 'BRCA1' }, { x: -1.8, y: 4.2, name: 'TP53' }],
    foldChangeThreshold: 1,
    pValueThreshold: 0.01
  }]
});

Type-specific options

OptionDescription
thresholds{ foldChange, pValue } classification cutoffs.
colors{ upregulated, downregulated, nonsignificant }.
labelTopNLabel the top-N most significant genes.

Variations

Label top genes

Annotate the most significant points with labelTopN.

KatuCharts.chart('container', {
  series: [{
    type: 'volcano',
    data: genes,
    foldChangeThreshold: 1,
    pValueThreshold: 0.01,
    labelTopN: 8
  }]
});

Common errors

Why does my volcano chart render as a line chart?
The chart type was not registered. KatuCharts logs "KatuCharts: unknown series type "<type>", falling back to line" and draws a line chart rather than throwing. Import the module the type belongs to — for example `import 'katucharts.js/bio';` — before creating the chart.
Why do I get "Cannot read properties of null (reading 'appendChild')"?
The container element does not exist when the chart is created. Create the chart after the element is in the DOM: in React that means inside useEffect, not during render.
Why is the chart rendering with zero height?
The container has no height. A div with no content collapses to zero. Give it a height in CSS, or pass `chart: { height: 400 }` in the options.

FAQ

How do I create a volcano chart in JavaScript?
Install with `npm install katucharts.js`, import the module with `import 'katucharts.js/bio';`, then call KatuCharts.chart(container, { chart: { type: 'volcano' }, series: [...] }).
What data does the volcano plot expect?
Points that are already transformed: { x: log2 fold change, y: −log10(p), name }. Compute −log10 of your p-values (or adjusted p-values) before passing them in; the series does not read DESeq2, edgeR or limma result tables directly.
How are points classified as up-regulated, down-regulated or not significant?
With foldChangeThreshold (default 1) and pValueThreshold (default 0.05) on the series. Dashed threshold lines are drawn at ±foldChangeThreshold and at −log10(pValueThreshold), and the three groups are coloured with upColor, downColor and nsColor.
How do I label the most significant genes?
Set labelTopN on the series, for example labelTopN: 8. Labels use each point's name.
Why does my volcano chart render as a line chart?
The chart type was not registered. KatuCharts logs "KatuCharts: unknown series type "<type>", falling back to line" and draws a line chart rather than throwing. Import the module the type belongs to — for example `import 'katucharts.js/bio';` — before creating the chart.
Why do I get "Cannot read properties of null (reading 'appendChild')"?
The container element does not exist when the chart is created. Create the chart after the element is in the DOM: in React that means inside useEffect, not during render.
Common options (color, visible, marker, dataLabels, animation, events, zones…) apply to every type — see Configuration → series. See it rendered in the gallery.