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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ycanvas

v1.1.0-beta.3

Published

a framework to help you build your canvas library easily

Downloads

5

Readme

ycanvas

完成项

  • 渲染系统

  • 事件系统

待完成项

  • 生命周期

需要做拖拽移动的效果

  • 需要哪些数据

  • 当前状态(帧)四个点的坐标

  • 上一个状态(帧)四个点的坐标

  • 当前鼠标的位置

  • 是否是按下状态

  • 需要哪些事件

  • 鼠标按下

  • 鼠标按下并且移动

  • 鼠标抬起

  • 鼠标移除画布

  • 注意的点是

  • 对于边界问题的处理,比如我这个图形移动的位置不能超出整个画布的大小,超出安边界计算

  • 对于是否存在于此路径中的判断,这是前提如果都不在这里面那些事件都不触发(鼠标按下并且移动的事件),单个图形可以用isPointInPath玩,而且这个isPointInPath是拿的最新的路径进行判断的

  • 清除指定的图形,而不是清除整体canvas,这就要记录上一次的图形的状态了

  • 基本思路

说白了就是拿到最新的位置,然后设置好了四个点进行重新绘制.

主要是重新绘制的时机是在鼠标按下并且移动的事件回调中执行的

然后鼠标按下进行设置按下的状态

鼠标抬起和鼠标移出画布更改按下的状态为未按下