Skip to content

Releases: Michaelliv/charts-cli

v0.3.1

Choose a tag to compare

@Michaelliv Michaelliv released this 23 Mar 17:51

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 path
  • charts_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

Choose a tag to compare

@github-actions github-actions released this 23 Mar 17:38

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

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 18 Feb 23:54

Full Changelog: v0.1.0...v0.2.0

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 07 Feb 13:36