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 🙏

© 2025 – Pkg Stats / Ryan Hefner

uirenderer-canvas

v1.1.1

Published

Minimal 2D UI system for the Web

Readme

UI Renderer - Canvas

Minimal 2D UI system for the Web

A shading and layout engine for 2D graphics elements, such as rectangles and images, geared towards building UIs and data viz.

Made to be used as a framework for a website's canvas, the UI Renderer is built with WebGL 2, GLSL and TS and consists of just a few files with no dependencies. Examples are provided using Vue.js, but can be adapted to other web frameworks or static websites.

Features

Based on Analytical AA, the renderer features an immediate style API to define shapes such as lines and rectangles with beautifully rounded corners.

  • Simple geometric shapes, either filled or outlined.
  • Images: standalone or bundled in a set with the same resolution, ideal for icon and thumbnail packs.
  • Clip rects and transforms for the shapes/images, which can be used to implement zooming, scrolling and panning (not rotations).

Limitations: no text support! It can be added in a second canvas overlaid on top of the WebGL canvas. Work in progress. It's coming!

Scope

UI Renderer is proven for performance as a shading engine. It can support an order of hundreds of thousand shapes with a good framerate. There is limited functionality to help layout shapes in a grid and work in progress text support, including a text box and wrapping.

It is not a tools framework. It doesn't have UI elements such as "checkbox" or "slider" and doesn't have concepts such as undo stack, UI themes or key bindings.

UI Renderer is a good choice for custom data visualizations build with shapes that zoom smoothly to any resolution. It can also be used as a rendering backend for a UI framework or a 2D game.

Usage

Originally built for Watchtower by Inês Almeida as an adaptation for the web of a Blender add-on (how hard can it be to render a couple of rectangles in a canvas? :D), UI Renderer is known to be in use by:

  • Watchtower - production tracking tool for film with timeline and thumbnail grid view - https://watchtower.blender.org
  • Dispatch - project management and gantt chart tool (WIP) - https://github.com/armadillica/dispatch
  • Dima - functional UI/UX mockup (WIP) - https://ui.blender.org/
  • 2D game jam projects - (WIP) - https://github.com/britalmeida/eggscape

Examples

See docs for code examples and how to get started.

Technical Notes

Architecturally, the renderer works with a single quad divided in tiles and a command list with all the shapes to be drawn each frame.

The TS side composes the command list with shape definitions requested from a client application and pushes them to the shader each frame.

The fragment/pixel shader is responsible for the actual rendering and compositing of shapes using their analytical definition to calculate pixel coverage. This allows for nice looking pixel based effects such as drop shadows and rounded corners without tessellating vertex lists. Each pixel will loop over all the shape commands that overlap that pixel's tile and calculate the pixel's coverage by the shape. Shade is accumulated in order, therefore it is possible to stack semi-transparent elements and have the shapes issued last to overlap the previous ones.

Special thanks to Michiel van der Leeuw for sharing ideas on this topic.

Code Structure

  • src - rendering API and backend implementation + grid layouts
  • glsl - implementation of the shape drawing in the fragment shader
  • docs - code examples and development instructions

Support & Maintenance

UI Renderer is originally developed by Inês Almeida with help from Francesco Siddi. It's an open source project, reach out if you have ideas, problems or feedback!

While this is currently a hobby project for me (Inês), it's used worldwide by film production studios as a part of Watchtower which is a Blender Studio project.
Active bugfixing can be expected for Watchtower. Improvements and further development happen whenever Inês finds the groove for it.