Bioinformática · katucharts.js/bio
Volcán
type: 'volcano'Gráfico volcán — cambio de pliegue (x) frente a significación estadística (−log10 valor p, y). Los puntos están coloreados por umbrales de significación: regulado positivamente, regulado negativamente, no significativo.
Edita el JSON a la derecha y presiona Ejecutar (o ⌘/Ctrl + Intro) — los datos, títulos, categorías y colores se actualizan en vivo.
En Vivo
Volcán
Editar · JSON
Formato de datos
{ x: log2FC, y: -log10pval, name?: geneName }
Estructura de datos
El JSON que pasas dentro del gráfico — colócalo directamente en tu 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' }
]Ejemplo
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
}]
});Opciones específicas del tipo
| Opción | Descripción |
|---|---|
thresholds | umbrales de clasificación { foldChange, pValue }. |
colors | { upregulated, downregulated, nonsignificant }. |
labelTopN | Etiqueta los N genes más significativos. |
Variaciones
Etiquetar genes principales
Anota los puntos más significativos con labelTopN.
KatuCharts.chart('container', {
series: [{
type: 'volcano',
data: genes,
foldChangeThreshold: 1,
pValueThreshold: 0.01,
labelTopN: 8
}]
});Common errors
- Why does my volcán 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 volcán 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 volcán 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.
Las opciones comunes (color, visible, marker, dataLabels, animation, events, zones…) se aplican a todos los tipos — véase Configuración → series. Míralo renderizado en la galería.