@echarts-extension/flame
v0.1.0
Published
ECharts extension chart for hierarchical flame graphs
Readme
@echarts-extension/flame
Language: English | 中文
ECharts extension chart for hierarchical flame graphs. Import this package for side effects to register series.type = 'flame'.

Install
npm install echarts @echarts-extension/flameBasic Usage
import * as echarts from 'echarts';
import '@echarts-extension/flame';
const chart = echarts.init(document.getElementById('main'));
chart.setOption({
series: [
{
type: 'flame',
data: {
name: 'root',
children: [
{ name: 'render', value: 30, children: [{ name: 'diff', value: 18 }, { name: 'patch', value: 12 }] },
{ name: 'commit', value: 20 }
]
},
orient: 'up',
rootVisible: false,
gap: 1,
label: { show: true, formatter: '{b}' }
}
]
});Data
Use one root object or an array of roots:
- Nodes use
name, optionalvalue, and optionalchildren. - If a parent omits
value, it is inferred from children. - If a parent value is greater than the sum of children, the extra value is rendered as self time.
- Set
rootVisible: falseto hide the root frame.
Options
This table is generated by scripts/sync-options-from-readmes.mjs --write-readmes. Update the English README option table, then run npm run docs:sync-options to refresh the docs page.
| Option | Description | Values |
| --- | --- | --- |
| type | Registers this package series with ECharts. | 'flame' |
| silent | Disables mouse events for the series when true. | boolean |
| width | Series box width. | number \| string (pixel or percent) |
| height | Series box height. | number \| string (pixel or percent) |
| top | Distance from the top of the chart container. | number \| string (pixel or percent) |
| right | Distance from the right of the chart container. | number \| string (pixel or percent) |
| bottom | Distance from the bottom of the chart container. | number \| string (pixel or percent) |
| left | Distance from the left of the chart container. | number \| string (pixel or percent) |
| data | Hierarchical flame graph records. | Object \| Array<object> |
| data.id | Record id. | string \| number |
| data.parentId | Parent record id. | string \| number |
| data.name | Display name. | string |
| data.value | Numeric value. | number |
| data.children | Child records. | Array<object> |
| data.children.id | Record id. | string \| number |
| data.children.parentId | Parent record id. | string \| number |
| data.children.name | Display name. | string |
| data.children.value | Numeric value. | number |
| data.children.children | Child records. | Array<object> |
| data.children.children.name | Display name. | string |
| data.children.children.value | Numeric value. | number |
| data.children.children.itemStyle | Per-record item style. | Object |
| data.children.children.itemStyle.color | Fill color. | string |
| data.children.children.itemStyle.fill | Alias for fill color. | string |
| data.children.children.itemStyle.opacity | Fill opacity. | number |
| data.children.children.itemStyle.borderColor | Border color. | string |
| data.children.children.itemStyle.borderWidth | Border width. | number |
| data.children.children.itemStyle.borderRadius | Corner radius. | number |
| data.children.children.itemStyle.shadowBlur | Shadow blur radius. | number |
| data.children.children.itemStyle.shadowColor | Shadow color. | string |
| data.children.children.itemStyle.lineWidth | Stroke width used by icon or shape styles. | number |
| data.children.children.label | Per-record label style. | Object |
| data.children.children.label.show | Shows labels when true. | boolean |
| data.children.children.label.color | Label text color. | string |
| data.children.children.label.fontSize | Label text size. | number |
| data.children.children.label.fontWeight | Label font weight. | string \| number |
| data.children.children.label.formatter | Formats label text. | string \| function |
| data.children.itemStyle | Per-record item style. | Object |
| data.children.itemStyle.color | Fill color. | string |
| data.children.itemStyle.fill | Alias for fill color. | string |
| data.children.itemStyle.opacity | Fill opacity. | number |
| data.children.itemStyle.borderColor | Border color. | string |
| data.children.itemStyle.borderWidth | Border width. | number |
| data.children.itemStyle.borderRadius | Corner radius. | number |
| data.children.itemStyle.shadowBlur | Shadow blur radius. | number |
| data.children.itemStyle.shadowColor | Shadow color. | string |
| data.children.itemStyle.lineWidth | Stroke width used by icon or shape styles. | number |
| data.children.label | Per-record label style. | Object |
| data.children.label.show | Shows labels when true. | boolean |
| data.children.label.color | Label text color. | string |
| data.children.label.fontSize | Label text size. | number |
| data.children.label.fontWeight | Label font weight. | string \| number |
| data.children.label.formatter | Formats label text. | string \| function |
| data.itemStyle | Per-record item style. | Object |
| data.itemStyle.color | Fill color. | string |
| data.itemStyle.fill | Alias for fill color. | string |
| data.itemStyle.opacity | Fill opacity. | number |
| data.itemStyle.borderColor | Border color. | string |
| data.itemStyle.borderWidth | Border width. | number |
| data.itemStyle.borderRadius | Corner radius. | number |
| data.itemStyle.shadowBlur | Shadow blur radius. | number |
| data.itemStyle.shadowColor | Shadow color. | string |
| data.itemStyle.lineWidth | Stroke width used by icon or shape styles. | number |
| data.label | Per-record label style. | Object |
| data.label.show | Shows labels when true. | boolean |
| data.label.color | Label text color. | string |
| data.label.fontSize | Label text size. | number |
| data.label.fontWeight | Label font weight. | string \| number |
| data.label.formatter | Formats label text. | string \| function |
| rootName | Display name for an implicit root node. | string |
| rootVisible | Shows the root band when true. | boolean |
| orient | Direction the flame graph grows. | 'up' \| 'down' |
| padding | Inset around the flame graph. | number |
| gap | Gap between flame graph rectangles. | number |
| sort | Sorts children before layout. | boolean \| 'none' \| 'value' \| 'name' |
| colors | Palette used by depth or groups. | string[] |
| itemStyle | Styles flame graph rectangles. | Object |
| itemStyle.color | Primary color. | string |
| itemStyle.opacity | Opacity. | number |
| itemStyle.borderColor | Border color. | string |
| itemStyle.borderWidth | Border width. | number |
| itemStyle.shadowBlur | Shadow blur radius. | number |
| itemStyle.shadowColor | Shadow color. | string |
| label | Styles rectangle labels. | Object |
| label.show | Shows labels when true. | boolean |
| label.color | Label text color. | string |
| label.fontSize | Label text size. | number |
| label.fontWeight | Label font weight. | string \| number |
| label.formatter | Formats label text. | string \| function |
| emphasis | Styles rectangles while hovered. | Object |
| emphasis.itemStyle | Nested item style option. | object |
| emphasis.itemStyle.color | Fill color. | string |
| emphasis.itemStyle.fill | Alias for fill color. | string |
| emphasis.itemStyle.opacity | Fill opacity. | number |
| emphasis.itemStyle.borderColor | Border color. | string |
| emphasis.itemStyle.borderWidth | Border width. | number |
| emphasis.itemStyle.borderRadius | Corner radius. | number |
| emphasis.itemStyle.shadowBlur | Shadow blur radius. | number |
| emphasis.itemStyle.shadowColor | Shadow color. | string |
| emphasis.itemStyle.lineWidth | Stroke width used by icon or shape styles. | number |
| emphasis.edgeStyle | Nested edgeStyle option. | object |
| emphasis.edgeStyle.color | Fill color. | string |
| emphasis.edgeStyle.fill | Alias for fill color. | string |
| emphasis.edgeStyle.opacity | Fill opacity. | number |
| emphasis.edgeStyle.borderColor | Border color. | string |
| emphasis.edgeStyle.borderWidth | Border width. | number |
| emphasis.edgeStyle.borderRadius | Corner radius. | number |
| emphasis.edgeStyle.shadowBlur | Shadow blur radius. | number |
| emphasis.edgeStyle.shadowColor | Shadow color. | string |
| emphasis.edgeStyle.lineWidth | Stroke width used by icon or shape styles. | number |
| emphasis.focus | Nested focus option. | string |
| emphasis.blurScope | Nested blurScope option. | string |
