Repository navigation
Releases: Michaelliv/charts-cli
Releases · Michaelliv/charts-cli
Release list
v0.3.1
SDK: Schema access
getSchema() and listSchemaTypes() are now available on the Charts instance.
import { createCharts } from "charts-cli";
const charts = createCharts();
// List available types
const { series, components } = charts.listSchemaTypes();
// Get JSON schema for a specific chart type
const barSchema = charts.getSchema("bar");
const fullSchema = charts.getSchema("full");Pi extension
Added a pi extension (.pi/extensions/charts/) with two tools:
charts_render— render ECharts JSON to PNG, returns file pathcharts_schema— get JSON schema for any chart type or component
Internal
- Extracted shared schema type constants to
schemas/types.ts(used by both SDK and CLI)
Full Changelog: v0.3.0...v0.3.1
v0.3.0
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 aChartsinstance.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.jsonnow hasmain+exportsfor library consumers- CLI render command uses SDK internally
- Cleaned up unused output helpers
v0.2.0
v0.1.0
Full Changelog: https://github.com/Michaelliv/charts-cli/commits/v0.1.0