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

@edv4h/usketch-plugin-shape-freedraw

v3.2.5

Published

ホワイトボード用の「描く」体験を提供するフリーハンド(ペン)プラグイン。 4種のペン、筆圧シミュレーション、色/太さ、オブジェクト単位の消しゴム、ペン先カーソルを備える。 描画はベクター SVG なのでズームしても鮮明で、選択/移動/リサイズ・undo・同期と整合する。

Readme

@edv4h/usketch-plugin-shape-freedraw

ホワイトボード用の「描く」体験を提供するフリーハンド(ペン)プラグイン。 4種のペン、筆圧シミュレーション、色/太さ、オブジェクト単位の消しゴム、ペン先カーソルを備える。 描画はベクター SVG なのでズームしても鮮明で、選択/移動/リサイズ・undo・同期と整合する。

使い方

import { createFreedrawPlugin } from "@edv4h/usketch-plugin-shape-freedraw";

const plugins = [
  // ...
  createFreedrawPlugin({
    defaultPen: "ballpoint",
    brushDynamics: 60,     // 筆圧の効き 10..100
    cursorPreview: true,
  }),
];

ツール ID は freedraw-drawstore.setActiveToolId("freedraw-draw") でアクティブにすると、 画面下部に最小パレット(ペン種別 / 消しゴム / 色 / 太さ)が表示される。Esc で既定ツールへ戻る。

ペン(設計書 §3)

| ペン | 既定太さ | 線幅 | 不透明度 | 合成 | | --- | --- | --- | --- | --- | | ボールペン | 2.5 | 一定 | 1.0 | normal | | サインペン | 6 | 一定 | 1.0 | normal | | 筆ペン | 11 | 可変(速度→疑似筆圧) | 1.0 | normal | | 蛍光ペン | 22 | 一定 | 0.4 | multiply |

一定幅ペンは中点を通る二次ベジェで平滑化、筆ペンは perfect-freehand で塗りアウトラインを生成。 蛍光ペンは要素単位合成のため、同一ストローク内の交差は二重に濃くならず別ストローク同士は濃くなる。

消しゴム

mode: "eraser" のとき、触れた freedraw ストロークを丸ごと削除する(ピクセル消去ではない)。 1ドラッグぶんの削除は1アクションとして undo できる。

データモデル

type PenKind = "ballpoint" | "felt" | "brush" | "highlighter";
interface StrokePoint { x: number; y: number; p?: number } // p=疑似筆圧 0..1
interface FreedrawShapeData extends ShapeData {
  points: StrokePoint[];
  pen?: PenKind; // 省略時 ballpoint(旧データ後方互換)
}

色 = style.stroke / 太さ = style.strokeWidth / 不透明度 = style.opacity

外部連携イベント

ctx.events.emit で設定を操作できる(vim プラグインの ex コマンド等から): freedraw:set-pen {pen} / freedraw:set-color {color} / freedraw:set-size {size} / freedraw:toggle-eraser