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

@ganttkit/canvas

v0.1.2

Published

Plain HTML/CSS/JS canvas renderer plugin for GanttKit draws the scene into a 2D canvas.

Downloads

344

Readme

@ganttkit/canvas

A plain HTML/CSS/JS renderer for GanttKit that draws the chart into a single 2D <canvas> the third sibling of @ganttkit/svg (primitive → SVG element) and @ganttkit/html (primitive → <div>).

All three consume the exact same renderer-agnostic scene of vector primitives (rect, line, path, polygon, text), so every feature plugin (columns, tree, dependencies, markers, tooltip, selection, …) works unchanged.

Usage

import { createGantt } from '@ganttkit/canvas'
import '@ganttkit/canvas/styles.css'

const gantt = createGantt({
  target: '#app',
  rows,
  viewMode: 'Week',
  highlightToday: true,
})

Or attach it as a plugin to an existing engine:

import { GanttEngine } from '@ganttkit/core'
import { canvasRenderer } from '@ganttkit/canvas'

const engine = new GanttEngine({ rows })
engine.use(canvasRenderer({ target: '#app' }))

How it differs from the DOM renderers

Canvas is immediate-mode, so two things work differently behind the same API:

  • Viewport-sized canvas. A canvas can't be millions of pixels tall, so it is kept the size of the visible viewport and pinned over a full-size spacer that drives the scrollbars. On every scroll the engine re-windows the scene and the renderer redraws with the scroll offset applied cost stays bounded by what's visible, no matter the dataset size.
  • No CSS cascade. There are no per-shape DOM nodes, so the renderer resolves colours itself from the theme's --gk-* CSS variables (light/dark and your overrides still apply). Pointer gestures are resolved through the engine's shared engine.hitTest(x, y) the renderer maps the pointer into scene coordinates and lets the engine say what's under it, rather than re-inventing hit geometry. The stylesheet still ships the variables and the chrome (header, sidebar, toolbar/overlay slots).

Interactions

  • Drag a bar to move it; drag its edges to resize.
  • Ctrl/⌘ + wheel changes the view mode (disable with enableZoom: false).
  • Drag empty space to pan (disable with enablePan: false).

Examples

  • examples/basic pnpm --filter @ganttkit/example-canvas dev
  • examples/stress large-dataset benchmark with a live metrics panel: pnpm --filter @ganttkit/example-canvas-stress dev

License

MIT