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

crude-charts

v1.0.0

Published

a crude charts component

Readme

crude-charts

一个简陋(单)的图表组件,提供了基础的数据展示,动画,和基础的配置项。

学习自:

项目:https://github.com/sutianbinde/charts

博客:https://www.cnblogs.com/chengduxiaoc/category/1094155.html

支持以下组件

  • 柱状图
  • 饼图
  • 折线图

快速上手

// 以饼图为例
import {Pie} from 'curde-charts';

const charts = new Pie({
  cHeight: 200,
  cWidth: 500,
  data: [
    {
      color: '#60b794',
      value: 10,
      text: '苹果'
    },
    {
      color: '#616afb',
      value: 30,
      text: '梨子'
    },
    {
      color: 'black',
      value: 250,
      text: '西瓜'
    }
  ]
});

文档

通用属性 (Common properties)

长,宽,高等属性,单位均为 px

| 属性名 | 默认值 | 备注 | | ------------------------- | ------ | ---------------------- | | canvasId string | canvas | canvas 容器 | | cHeight number | 必须 | canvas 容器的高度 | | cWidth number | 必须 | canvas 容器的宽度 | | cPadding number | 10 | canvas 容器的内边距 | | cBackgroundColor string | #fff | canvas 容器的背景色 | | animDuration number | 1000 | 动画执行时间,单位毫秒 | | data any | 必须 | 详见具体组件 |

饼图

| 属性名 | 默认值 | 备注 | | ------------------------- | ------ | ---------------------- | | tagX number | 0 | 标签起始位置 X | | tagY number | 0 | 标签起始位置 Y | | tagW number | 60 | 标签宽度 | | tagH number | 20 | 标签高度 | | tagFont string | | 标签文本样式 | | pieRadius number | canvas 容器的高度 1/3 | 饼图半径v | | pieX number | canvas 容器的宽度 1/2 | 饼图圆心 X | | pieY number | canvas 容器的高度 1/2 | 饼图圆心 Y | | tipLine number | 10 | 饼图的边到转折点的距离 | | tipLineW number | 1 | 横线的宽度 | | tipFont string | | 横线文字样式 | | tipPadding number | 10 | 横线文字距离转折点的距离 | | toFix number | 2 | 百分比的位数 | | isShowTag boolean | true | 是否展示 tag |

图例

| 饼图 | | ------------------------------------------------------------ | | |