Parent node, renderer data, and optional box settings.
Handle for the created box, updates, and cleanup.
RangeError
Propagates validation errors from renderSparkline.
import blessed from 'blessed';
import { sparkline } from 'blessed-components/sparkline/blessed';
const screen = blessed.screen({ smartCSR: true });
const downloads = sparkline({
parent: screen,
box: { top: 0, left: 0, width: 40, height: 2 },
data: {
label: 'Downloads',
values: [1, 3, 2, 8],
width: 20,
},
});
screen.render();
downloads.setData({
label: 'Downloads',
values: [2, 4, 6, 8],
width: 20,
});
screen.render();
downloads.destroy();
screen.destroy();
Creates a display-only Sparkline backed by a Blessed
BoxElement.Import from
blessed-components/sparkline/blessed. The adapter disables Blessed tags, renders through renderSparkline, and leaves terminal rendering under caller control.