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

zan-grid-charts

v0.1.0

Published

Bridge package between zan-grid and zan-charts

Readme

zan-grid-charts

zan-gridzan-charts 的桥接包,用于将网格范围数据快速映射为图表。

功能特性

  • 将网格列定义映射为图表序列标签
  • 支持 barlineareacombo 图表类型
  • 透传缩放、工具栏、图例、点击等图表能力
  • 提供统一句柄:更新数据、导出、销毁

安装

npm install zan-grid-charts

快速开始

import { createGridRangeChart } from 'zan-grid-charts'

const container = document.getElementById('chart') as HTMLElement

const handle = createGridRangeChart({
  columns: [
    { field: 'department', header: '部门' },
    { field: 'sales', header: '销售额' },
    { field: 'trend', header: '趋势' }
  ],
  categoryField: 'department',
  valueFields: ['sales', 'trend'],
  data: [
    { department: '技术', sales: 120, trend: 110 },
    { department: '人事', sales: 80, trend: 90 }
  ],
  options: {
    container,
    type: 'combo',
    title: '部门销售对比',
    chartSeriesTypes: ['bar', 'line'],
    enableZoom: true,
    toolbar: {
      enabled: true,
      showResetZoom: true,
      showExportPng: true,
      showExportSvg: true
    }
  }
})

// 更新数据
handle.update?.([
  { department: '技术', sales: 132, trend: 118 },
  { department: '人事', sales: 86, trend: 95 }
])

createGridRangeChart API

createGridRangeChart(payload) 返回 GridRangeChartHandle

  • update(data):更新图表数据
  • resetZoom():重置缩放
  • toSvgString():导出 SVG 字符串
  • toDataUrl(type?):导出 data URL
  • download(filename?, type?):下载图片
  • destroy():销毁图表

Payload 关键字段

  • columns:网格列定义(用于 label 映射)
  • categoryField:类目字段
  • valueFields:值字段列表
  • data:图表数据
  • options.container:挂载容器(必填)
  • options.type:图表类型
  • options.chartSeriesTypes:组合图各序列类型
  • options.toolbar:工具栏配置
  • options.hooks:交互钩子透传

开发

npm run test
npm run build