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

@ripl/core

v1.4.0

Published

Core rendering library for Ripl: elements, scene, renderer, animation, scales, math, color, interpolation

Readme

@ripl/core

npm license size

The rendering core of Ripl: elements, scene graph, renderer, animation, scales, colour and math, drawing through a Context abstraction that Canvas, SVG, the terminal and WebGPU each implement.

Features

  • Ten built-in elementsarc, circle, ellipse, image, line, path, polygon, polyline, rect and text, each with a createX factory, an elementIsX type guard and full stroke/fill state. Polylines carry thirteen curve algorithms (linear, spline, basis, bump-x, bump-y, cardinal, catmull-rom, monotone-x, monotone-y, natural, step, step-before, step-after).
  • DOM-like scene graph — elements nest in groups that inherit presentation state, and are found with getElementById, getElementsByType, getElementsByClass, query, queryAll, matches and closest. Scene hoists the tree into a flat render buffer, so a frame costs O(n) in elements rather than in tree depth.
  • RenderercreateRenderer drives requestAnimationFrame, stops itself when nothing is animating (autoStop), and carries FPS, element-count and bounding-box debug overlays.
  • Animation — awaitable, cancelable transitions with CSS-like keyframes, per-keyframe offsets, and 31 easing functions (linear plus quad, cubic, quart, quint, sine, expo, circ, back, elastic and bounce in in/out/in-out form). See Animations.
  • Type-aware interpolation — every built-in element declares how its own state tweens, so a colour, gradient, pattern fill, rotation, point set or dash pattern animates without configuration; anything undeclared is detected from the value. The interpolators option overrides any property, on a custom element or a built-in one. Point-set morphing matches outlines of differing length by key, so a curve stays curved across the transition.
  • Events — a typed EventBus with bubbling, delegation, stopPropagation, { self: true } filtering and disposable subscriptions, plus pixel-accurate hit testing so a pointer event resolves to the element actually drawn under the cursor.
  • 14 scale types — continuous, band, point, discrete, ordinal, diverging, logarithmic, power, symlog, quantile, quantize, threshold, radial and time. See Scales.
  • Colour — parsing and serialisation for hex, rgb()/rgba(), hsl()/hsla(), hsv()/hsva() and the 148 CSS colour keywords, conversion between spaces, alpha manipulation, sequential colour scales and 8 built-in schemes (viridis, plasma, inferno, magma, cividis, turbo, RdBu, BrBG).
  • Gradients and patterns — linear, radial and conic gradients (including repeating variants) parsed from CSS gradient strings, and five pattern tiles (diagonal, cross-hatch, dots, horizontal, vertical). Both are ordinary paint strings, so they inherit and interpolate like any other style.
  • Math — points, angles, distances, bounding boxes, matrices and polar conversion, plus a Navigator that pans, zooms and brushes by rescaling scale domains rather than scaling geometry, keeping strokes and text crisp.
  • Strict TypeScript, tree-shakable, no third-party runtime dependencies — the only dependency is @ripl/utilities, a sibling in this repository.

Installation

Browser projects should install @ripl/web instead — it re-exports every symbol below alongside the Canvas 2D context, and registers the browser platform bindings that @ripl/core needs to measure text and schedule frames.

# npm
npm install @ripl/core

# yarn
yarn add @ripl/core

# pnpm
pnpm add @ripl/core

Quick start

import {
    createCircle,
    createContext,
    createRenderer,
    createScene,
    easeOutCubic,
} from '@ripl/web';

const context = createContext('.mount-element');

const circle = createCircle({
    fill: 'rgb(30, 105, 120)',
    cx: context.width / 2,
    cy: context.height / 2,
    radius: 50,
});

const scene = createScene(context, {
    children: [circle],
});

const renderer = createRenderer(scene, {
    autoStart: true,
    autoStop: true,
});

await renderer.transition(circle, {
    duration: 1000,
    ease: easeOutCubic,
    state: {
        radius: 100,
        fill: '#ff0000',
    },
});

To render the same scene as SVG, import createContext from @ripl/svg. Nothing else changes.

Key API

| Export | What it does | | --- | --- | | Context | The rendering abstraction every backend implements | | Element / Shape | Base classes for renderable state, transforms and hit testing | | createGroup | Container with inheritance, querying and event bubbling | | createScene | Top-level group bound to a context, with a hoisted render buffer | | createRenderer | Animation loop and transition manager | | scaleContinuousscaleTime | The 14 scale constructors | | interpolateColor / ElementInterpolators | Built-in interpolators and the per-property override map | | parseGradient / parsePattern | Paint-string parsing for gradients and pattern tiles | | Navigator | Pan, zoom and brush over a viewport by rescaling domains |

Related packages

Documentation

Guides, live demos and the full API reference are at ripl.run/docs/core.

License

MIT