npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@visactor/vinfo-graphics

v0.0.11

Published

A simplified, LLM-friendly chart library for infographics based on VChart

Downloads

1,043

Readme

Introduction

@visactor/vinfo-graphics provides a schema-first way to describe infographic charts, and converts schema objects to VChart spec.

It is designed for:

  • AI/LLM-friendly chart generation
  • concise and readable chart schema
  • consistent validation and conversion pipeline
  • multi-format package output (ESM/CJS/UMD)

Supported chart types:

  • pie
  • bar
  • column
  • area
  • treemap
  • circlePacking

Features

  • Schema to VChart spec conversion via toVChartSpec
  • Built-in schema validation via converter rules
  • Zod runtime validation via validateWithZod
  • Theme preset system (presetThemes, resolveTheme)
  • Build outputs for ESM, CJS, and UMD

Installation

# npm
npm install @visactor/vinfo-graphics zod

# pnpm
pnpm add @visactor/vinfo-graphics zod

# yarn
yarn add @visactor/vinfo-graphics zod

Quick Start

import VChart from '@visactor/vchart';
import { toVChartSpec } from '@visactor/vinfo-graphics';

const schema = {
  chartType: 'bar',
  title: 'Monthly Sales',
  data: [
    { month: 'Jan', sales: 120 },
    { month: 'Feb', sales: 160 },
    { month: 'Mar', sales: 180 },
  ],
  categoryField: 'month',
  valueField: 'sales',
} as const;

const spec = toVChartSpec(schema);

const chart = new VChart(spec, { dom: 'chart' });
chart.renderSync();

Validation

1) Validate by converter rules

import { validate } from '@visactor/vinfo-graphics';

const result = validate({
  chartType: 'pie',
  data: [{ name: 'A', value: 30 }],
  categoryField: 'name',
  valueField: 'value',
});

console.log(result.valid, result.errors);

2) Validate by Zod schema

import { validateWithZod } from '@visactor/vinfo-graphics';

// Auto-select schema by data.chartType
const result = validateWithZod({
  chartType: 'column',
  data: [{ category: 'Q1', value: 120 }],
  categoryField: 'category',
  valueField: 'value',
});

console.log(result.success, result.errors);

You can also pass an explicit schema:

import { validateWithZod } from '@visactor/vinfo-graphics';
import { pieChartSchema } from '@visactor/vinfo-graphics/schemas';

const result = validateWithZod(pieChartSchema, {
  chartType: 'pie',
  data: [{ name: 'A', value: 30 }],
  categoryField: 'name',
  valueField: 'value',
});

API

Main exports from @visactor/vinfo-graphics:

  • toVChartSpec(schema)
  • validate(schema)
  • getDefaults(chartType)
  • validateWithZod(data) / validateWithZod(schema, data)
  • presetThemes
  • resolveTheme
  • isDarkTheme

Schemas export path:

  • @visactor/vinfo-graphics/schemas

UMD entry:

  • @visactor/vinfo-graphics/umd

Build Output

After build:

  • ESM: esm/**
  • CJS: cjs/**
  • Types: dist/**/*.d.ts
  • UMD bundle: dist/index.umd.js

Development

# install
npm install

# type check
npm run typecheck

# test
npm run test

# build all outputs (esm/cjs/types/umd)
npm run build

Related Links

  • VChart: https://www.visactor.io/vchart
  • VChart Example: https://www.visactor.io/vchart/example
  • VisActor GitHub: https://github.com/VisActor

License

MIT