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

@spidunno/motion-canvas-graphing

v0.0.12

Published

Render expressions onto a graph (along with various other math utilities). Graphing powered by Desmos. ## Installation `npm install @spidunno/motion-canvas-graphing` ## Example All math components must be descendants of a `MathSpace` component. The `MathS

Readme

Motion Canvas Graphing

Render expressions onto a graph (along with various other math utilities). Graphing powered by Desmos.

Installation

npm install @spidunno/motion-canvas-graphing

Example

All math components must be descendants of a MathSpace component. The MathSpace provides coordinate transformations from "math space" to pixel space.

All MathExpression components must be descendants of a MathGraphingCalculator.

Here's a full example that creates a grid and adds a sine wave to it:

import { makeScene2D } from "@motion-canvas/2d";
import { Vector2 } from "@motion-canvas/core";
import {
	MathGrid,
	MathExpression,
	MathSpace,
	MathGraphingCalculator,
} from "@spidunno/motion-canvas-graphing";

export default makeScene2D(function* (view) {
	// MathGraphingCalculator is asynchronous, so it must be yielded to ensure it's loaded before rendering.
	yield view.add(
		<MathSpace
			width={() => view.width()}
			height={() => view.height()}
			/* `min` and `max` specify the domain that the `MathSpace` should span across */
			min={new Vector2(-8, -4.5)}
			max={new Vector2(8, 4.5)}
		>
			{/* Minor subdivisions */}
			<MathGrid lineWidth={1} spacing={[1 / 2, 1 / 2]} stroke="#4e5485" />

			{/* Major subdivisions */}
			<MathGrid
				lineWidth={2}
				spacing={[1, 1]}
				stroke="#919cff"
				xAxisStroke={"#f27949"}
				yAxisStroke={"#71e377"}
			/>

			<MathGraphingCalculator>
				<MathExpression
					/* equations are passed in as LaTeX, an easy way to write these is to write it in Desmos and then copy/paste it here. */
					equation={String.raw`y = \sin(x)`}
					stroke="rgb(241, 249, 12)"
				/>
			</MathGraphingCalculator>
		</MathSpace>
	);
}); 

Usage

MathSpace

The main component of this library is MathSpace. It provides all descendant components with transformations from math coordinates to pixel coordinates (for people familiar with React, think of MathSpace like a context provider.)

Specify the domain in math coordinates with the min and max props, and it'll map that to the size of the MathSpace element.

Example:

view.add(<MathSpace
	min={[
	// x,  y
		-10, 10
	]}
	max={[
	// x,  y
		-10, 10
	]}
	width={800}
	height={800}
	>
{ /* ... */ }
</MathSpace>);

MathGrid

The MathGrid component renders grid lines to a MathSpace.

API:

export interface MathGridProps extends ShapeProps {
	/** The color of the grid lines */
	stroke?: SignalValue<PossibleCanvasStyle>;

	/** The color to use for the x axis (the line where y=0) */
	xAxisStroke?: SignalValue<PossibleCanvasStyle>;

	/** The color to use for the y axis (the line where x=0) */
	yAxisStroke?: SignalValue<PossibleCanvasStyle>;

	/** Grid lines line width */
	lineWidth?: SignalValue<number>;

	/** Line width of the x and y axis lines */
	axesLineWidth?: SignalValue<number>;

	/** Spacing between grid lines */
	spacing?: SignalValue<PossibleVector2>;

	/** Start of the grid lines as percentage */
	start?: SignalValue<number>;

	/** End of the grid lines as percentage, animate this going from 0 to 1 for a nice animation */
	end?: SignalValue<number>;

	/** Opacity of the grid, use this instead of `opacity` because of weird behavior with `opacity` */
	alpha?: SignalValue<number>;
}

Credits

spidunno - main developer protowalker - helped with improving the codebase desmos - made the tool that powers this one