生物信息学 · katucharts.js/bio

Circos热力图

type: 'circosheatmap'

将矩阵热力图环绕成圆环——行成为角向扇区,列成为同心圆带。适合表达量或丰度矩阵。

编辑右侧的JSON并按Run(或⌘/Ctrl + Enter)——数据、标题、类别和颜色全部实时更新。

实时
Circos热力图
编辑 · JSON

数据格式

custom: { columns: [...]、rows: [{ id、values: [...]、color }] }

数据结构

传入图表的 JSON——可直接放进你的 series。

data: [{
  custom: {
    columns: ['Ctrl', '24h', '48h'],
    rows: [
      { id: 'IL6', values: [2.1, 8.4, 5.0] },
      { id: 'TNF', values: [3.2, 7.1, 4.8] }
    ]
  }
}]

示例

KatuCharts.chart('container', {
  series: [{ type: 'circosHeatmap', colorScale: 'Viridis', data: [{ custom: {
    columns: ['Ctrl', '24h', '48h'],
    rows: [{ id: 'IL6', values: [2.1, 8.4, 5.0] }]
  } }] }]
});

类型特定选项

选项描述
colorScale命名的顺序色阶(如 'Viridis')。
innerRadius中心镂空比例(0–1)。
min / max限定颜色域。

Common errors

Why does my circos热力图 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 circos热力图 chart in JavaScript?
Install with `npm install katucharts.js`, import the module with `import 'katucharts.js/bio';`, then call KatuCharts.chart(container, { chart: { type: 'circosheatmap' }, series: [...] }).
Why does my circos热力图 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.
通用选项(color、visible、marker、dataLabels、animation、events、zones…)适用于每个类型——请参阅配置→series。在图库中查看其渲染。