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

@canvas-tile-engine/renderer-canvas

v0.1.1

Published

Lightweight library for building interactive 2D grid-based maps and visualizations with Canvas

Readme

@canvas-tile-engine/renderer-canvas

npm version bundle size license

Canvas2D renderer for Canvas Tile Engine. This package provides the default rendering implementation using the HTML Canvas 2D API.

Install

npm install @canvas-tile-engine/renderer-canvas

Usage

With Core (Vanilla JS/TS)

import { CanvasTileEngine } from "@canvas-tile-engine/core";
import { RendererCanvas } from "@canvas-tile-engine/renderer-canvas";

const engine = new CanvasTileEngine(
    wrapper,
    config,
    new RendererCanvas(),
    { x: 0, y: 0 }
);

With React

import { CanvasTileEngine, useCanvasTileEngine } from "@canvas-tile-engine/react";
import { RendererCanvas } from "@canvas-tile-engine/renderer-canvas";

function App() {
    const engine = useCanvasTileEngine();

    return (
        <CanvasTileEngine
            engine={engine}
            config={config}
            renderer={new RendererCanvas()}
        >
            {/* children */}
        </CanvasTileEngine>
    );
}

Features

  • Full support for all drawing primitives (rect, circle, image, text, path, line)
  • Static caching for large datasets (offscreen canvas)
  • Layer-based rendering with configurable draw order
  • Coordinate overlay and debug HUD
  • High DPI (retina) display support

Custom Drawing

When using addDrawFunction or onDraw, cast the context to CanvasRenderingContext2D:

engine.addDrawFunction((ctx, coords, config) => {
    const context = ctx as CanvasRenderingContext2D;

    context.fillStyle = "red";
    context.fillRect(0, 0, 100, 100);
}, 2);

engine.onDraw = (ctx, info) => {
    const context = ctx as CanvasRenderingContext2D;

    context.strokeStyle = "blue";
    context.strokeRect(0, 0, info.width, info.height);
};

Architecture

This renderer implements the IRenderer interface from @canvas-tile-engine/core:

@canvas-tile-engine/core
        │
        ▼
   IRenderer ◄─── Interface
        │
        ▼
┌─────────────────┐
│ RendererCanvas  │ ◄─── This package
│   (Canvas2D)    │
└─────────────────┘

Documentation

Full documentation: canvastileengine.dev

License

MIT