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

@bigpuddle/dot-engine-export

v0.2.3

Published

Export utilities for dot-engine — SVG and PNG rendering from dot fields

Readme

@dot-engine/export

Static asset export for dot-engine. Outputs a dot field as an SVG or PNG file.

npm install @dot-engine/export

exportSVG(fieldRoot, options): SVGResult

Evaluates the dot field entirely on the CPU and produces an SVG string of <circle> elements. Works in any JavaScript environment — no GPU or browser required.

import { exportSVG } from '@dot-engine/export';
import { presets } from '@dot-engine/core';

const { svg, dotCount } = exportSVG(presets.organic, {
  width: 1200,
  height: 600,
  background: '#06060a',
  dotRadius: 4,
  camera: { position: [0, 0, 3], fov: 60 },
});

// Write svg string to a file, embed in HTML, etc.
console.log(`Exported ${dotCount} dots`);

ExportSVGOptions

| Option | Type | Default | Description | |---|---|---|---| | width | number | required | Output width in pixels | | height | number | required | Output height in pixels | | background | string | none | Optional background rect fill color | | dotRadius | number | 3 | Base dot radius before perspective scaling | | camera.position | [x,y,z] | [0,0,3] | Camera position looking toward origin | | camera.fov | number | 60 | Camera vertical field-of-view in degrees |

SVGResult

| Field | Type | Description | |---|---|---| | svg | string | Complete SVG markup | | dotCount | number | Number of dots rendered |

Notes

  • Only dots with SDF value < 0 (inside the shape) are included.
  • Dots are depth-sorted back-to-front using the painter's algorithm.
  • Dot color is mixed between primary and accent based on the absolute SDF value.
  • Dot size scales with perspective depth (projected.scale).
  • textureSdf, customSdf, and fromField2D nodes throw when evaluateSdf is called on them. SVG export works with all other SDF primitives, booleans, and transforms.
  • AnimateNode and DisplaceNode are ignored — the export captures a static snapshot at t = 0.

exportPNG(fieldRoot, options): Promise<Blob>

Renders the dot field to a PNG using an offscreen WebGL context. Browser-only.

import { exportPNG } from '@dot-engine/export';
import { presets } from '@dot-engine/core';

const blob = await exportPNG(presets.crystal, {
  width: 1920,
  height: 1080,
  background: '#06060a',
});

// Download in browser
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'logo.png';
a.click();

ExportPNGOptions

| Option | Type | Default | Description | |---|---|---|---| | width | number | required | Output width in pixels | | height | number | required | Output height in pixels | | background | string | '#000000' | Background color |

Notes

  • Requires a browser environment with WebGL2 support.
  • Creates and immediately disposes an offscreen THREE.WebGLRenderer.
  • Renders a single frame at uTime = 0 (no animation).
  • Returns a Blob of type image/png.
  • textureSdf nodes require the corresponding DataTexture uniforms to be bound — the current implementation does not support binding external textures. For logo/brand exports use @dot-engine/brand and capture the canvas directly.

Combining SVG export with brand

import { defineBrand, text } from '@dot-engine/brand';
import { exportSVG } from '@dot-engine/export';

const brand = await defineBrand({
  logo: text('ACME'),
  colors: { primary: '#4a9eff', accent: '#ff6b4a' },
  personality: { energy: 0.4, organic: 0.6, density: 0.6 },
  motion: { style: 'none', speed: 0 },
});

// Note: textureSdf (used by brand logos) is GPU-only.
// For SVG/CPU export, use a geometric SDF instead:
import { exportSVG } from '@dot-engine/export';
import { presets } from '@dot-engine/core';

const { svg } = exportSVG(presets.minimal, {
  width: 800,
  height: 400,
  background: '#06060a',
});