
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Render uPlot charts in the terminal with truecolor Unicode block art via React Ink and chafa-wasm
Render uPlot charts in the terminal using React Ink. Reuse your existing browser uPlot configuration objects — series, axes, scales — and get high-fidelity terminal charts with truecolor support via chafa-wasm.

pnpm add ink-uplot uplot canvas ink react
Note:
canvas(node-canvas) requires system dependencies (Cairo, Pango). See node-canvas installation for platform-specific instructions. On macOS:brew install pkg-config cairo pango.
import React from 'react';
import { render } from 'ink';
import { InkUPlot } from 'ink-uplot';
const opts = {
series: [
{},
{ stroke: 'cyan', label: 'Price', width: 2 },
],
axes: [
{ stroke: '#555', grid: { stroke: '#333' } },
{ stroke: '#555', grid: { stroke: '#333' } },
],
};
const data = [
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], // x values
[10, 25, 15, 30, 20, 35, 25, 40, 30, 45], // y values
];
function App() {
return <InkUPlot opts={opts} data={data} width={80} height={24} />;
}
render(<App />);
document/window globals so uPlot can initialize in Node.jsgetImageData()<Text> components<Box> / <Text> layout| Prop | Type | Default | Description |
|---|---|---|---|
opts | uPlot.Options | required | Standard uPlot options. Interactive options (cursor, select, legend) are automatically stripped. |
data | uPlot.AlignedData | required | uPlot data array — same format as browser uPlot. |
width | number | stdout.columns or 80 | Chart width in terminal columns. |
height | number | 24 | Chart height in terminal rows. |
threshold | number | 128 | Luminance threshold (0-255) for pixel-to-dot conversion. Lower = more dots. |
showAxes | boolean | true | Show text axes around the chart. Set to false for a borderless chart. |
color | boolean | true | Enable truecolor ANSI output. |
background | 'dark' | 'light' | 'dark' | Terminal background. 'dark' renders light-on-dark; 'light' inverts. |
scale and side axis configvalues on axes to control tick label formatting (e.g., mm:ss)data prop to animate; the component re-renders on prop changeswidth is not fixedRun any example with npx tsx examples/<name>.tsx. Press q to quit.
| Example | Description |
|---|---|
basic-line.tsx | Simple sine wave with axes |
multi-series.tsx | Three overlapping series |
dual-y-axis.tsx | Price (left) + Volume (right) Y-axis |
shaded-area.tsx | Area charts with translucent fill |
timestamps.tsx | 90-day time series with date X-axis |
live-trading.tsx | Streaming data at 100ms, mm:ss X-axis, highlighted last value |
no-axes.tsx | Minimal borderless chart (showAxes={false}) |
line-width-test.tsx | Interactive line width comparison (arrow keys to adjust) |


For custom pipelines, the internal functions are exported:
import { renderToImageData, pixelsToTerminal, pixelsToBraille, sampleCellColors } from 'ink-uplot';
// Render uPlot to a pixel buffer
const imageData = await renderToImageData(opts, data, 640, 384);
// Convert to truecolor terminal output via chafa
const ansi = await pixelsToTerminal(imageData, {
width: 80,
height: 24,
colors: 'truecolor',
});
console.log(ansi);
// Or convert to Braille (lower fidelity, no deps)
const braille = pixelsToBraille(imageData, { threshold: 100 });
console.log(braille.text);
'cyan', '#ff0000', '#00ff88') for best visibility.width x height in terminal cells. Wrap in an Ink <Box> to embed in larger layouts.fill on series with alpha >= 0.3 (e.g., 'rgba(0, 200, 255, 0.4)'). Very low alpha values may not be visible.showAxes={false} to hide text axes entirely, or configure individual axes via uPlot's axes config.ISC
FAQs
Render uPlot charts in the terminal with truecolor Unicode block art via React Ink and chafa-wasm
The npm package ink-uplot receives a total of 7 weekly downloads. As such, ink-uplot popularity was classified as not popular.
We found that ink-uplot demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.