Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 23 Mar 17:38
· 1 commit to main since this release

SDK

charts-cli can now be used as a library. Import createCharts and render charts programmatically — no CLI needed.

import { createCharts } from "charts-cli";

const charts = createCharts();

const svg = await charts.toSVG({
  xAxis: { type: "category", data: ["Mon", "Tue", "Wed"] },
  yAxis: { type: "value" },
  series: [{ type: "bar", data: [120, 200, 150] }],
});

const png = await charts.toPNG({ ... }, { width: 1200, theme: "dark" });

API

  • createCharts() — returns a Charts instance
  • .toSVG(option, opts?) — render to SVG string
  • .toPNG(option, opts?) — render to PNG buffer
  • .themes() — list built-in themes

Options

  • width / height — pixel dimensions (default: 800×400)
  • theme — "dark", "vintage", or a custom theme object

Other changes

  • package.json now has main + exports for library consumers
  • CLI render command uses SDK internally
  • Cleaned up unused output helpers