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

pinsel

v0.0.15

Published

A lightweight, framework agnostic 2D drawing libary with focus on performance and developer experience.

Downloads

28

Readme

:warning: This library is still in an early stage of development and should therefore not be used productively at this point in time! Many things are either not yet implemented or not documented.

Features

  • 🖌️ Draw Rectangles, Circles, Text, Images and Paths
  • ⚡️ Optimized for Performance (efficient rerendering & caching, OffscreenCanvas, Adaptive Frame-Rate)
  • 🔗 Easy to use API with e.g. Width-Constraints (shapeA.width = shapeB.width)
  • 🙏🏽 Framework agnostic (Works with React, Vue, Svelte & Co.)
  • 🖼️ Canvas- & SVG-Support
  • 🎁 Many more little things that make developers happy

Relevant Links

Installation

# pnpm
pnpm add pinsel

# npm
npm i pinsel

There is also the possibility to use only parts of Pinsel or to write extensions yourself. If you want to know more about this, have a look at the detailed documentation: @pinsel/core & @pinsel/renderer

CDN

<script src="https://unpkg.com/@pinsel/core"></script>
<script src="https://unpkg.com/@pinsel/runner"></script>
<script src="https://unpkg.com/pinsel"></script>

This exposes Pinsel globally via window.Pinsel

Simple Usage

// Creating Pinsel Instance
const p = new Pinsel({
  coordinateSpace: 'ADAPTIVE',
});

// Adding Rectangle
const rect = rectangle({ width: 0.5, height: 0.3, x: 0.1, y: 0 });
rect.stroke = 'pink';
p.scene.add(rect);

// Adding Circle
const circ = circle({
  radius: 0.1,
  x: 0.5,
  y: 0.5,
});
circ.stroke = 'green';
p.scene.add(circ);

// Adding Text
const text = label({
  text: 'PINSEL is the best!',
  x: 0.5,
  y: 0.5,
});
text.font = font(32, 'Fira Code');
p.scene.add(text);

This code produces this output:

Motivation

We were looking for a Libary to help us draw on the HTML5 Canvas, but to our surprise we couldn't find a suitable one. Known libaries either have a strong focus on artistic use (e.g. p5.js), or are mainly designed to visualise data (e.g. D3.js). Others are only documented in fragments, are inconvenient to use or simply lack features.

This is how we came up with the idea of writing a library ourselves, with which simple little gimmicks can be implemented. One that is easy to use and designed for TypeScript.

Demo

If you want to see more examples of what Pinsel could be used for, feel free to check out our examples at demo.pinsel.xyz

Support us

Contributing

This project is still at such an early stage that it is unfortunately not possible to contribute to it. As soon as we have reached a first stable state, we will open the project and look forward to any assistance.

Sponsoring

If you like our work, we would of course be happy if you supported us with a small donation:

Crew

This project is initiated and maintained by the crew behind smunzl: a service to send unique digital greeting cards.

License

This project is licensed under the MIT license. Feel free to edit and distribute this template as you like.

See LICENSE for more information.