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

zk-draw

v1.0.1-0

Published

canvas绘制AI数据的一个工具类

Readme

项目描述

提供一个绘制各种AI数据的一个工具函数

特性

    1. 使用UMD规范node React Vue 原生js都可以使用这个包 只是在node中无法生成canvas图表
    1. 图表的绘制抛弃Table+canvas的方式 全部采用canvas进行绘制
    1. 针对不同设备(移动端)可以根据deviceWidth Ratio等进行transform: scale(Number)进行缩放适配(canvas最小缩放不能低于0.3)

使用方法

npm install zk-draw --save 

或者使用script引入

<srcipt type="text/javascript" src="canvas_tool.js"></script>
<srcipt type="text/javascript" >
    console.log(window); //window上会暴露有canvas_tool的方法
</script>
import  zkDraw from 'zk-draw';

// 或者直接使用功能函数
import { drawReact } from 'zk-draw'
// 默认导出的是一个对象内置有
/**
 * version: String, // 版本号
 * fnList: Array, // 支持的功能函数名称 可以直接 import { fnName } from 'zk-draw'使用
 * fnName: Function // 功能函数  fnName只是代指
 * /

已经提供的功能

// 绘制矩形框体   已测试
// ctx为Canvas画笔对象 points为框体数据[1, 2, 3,4]左上右下四个点 option为画笔配置Canvas的参数
zkDraw.drawReact(ctx, points, option);
// 或者
drawReact(ctx, points, option);

// 绘制圆
drawArc(ctx, start, radius, option)

// 绘制图片
drawImage(ctx, imgsrc, option)

// 绘制直线
drawLine(ctx, start, end, option)

// 绘制骨架
drawStone(ctx, pose, option)

// 绘制文本
drawText(ctx, text, x, y, option)

Example

ST图 canvas框

计划新增内容

    1. ST的图表生成 (已经支持)
    1. 人脸特征点
    1. 面部朝向
    1. 计划增加动态图表 配合lengend动态切换图表
    1. 图表增加水印功能和单独的图片导出功能