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

dxf-renderer

v1.1.1

Published

TypeScript DXF file renderer

Downloads

393

Readme

dxf-renderer npm

High-performance 2D DXF renderer and viewer component for WebGL (via Three.js), written in TypeScript with dual ESM and CommonJS support.

[!NOTE] dxf-renderer is an actively maintained TypeScript fork of dxf-viewer originally created by Artyom Lebedev / SIA SPH Engineering.

Live Demo (Client-Side Viewer)

Install

bun add dxf-renderer
# or
npm install dxf-renderer

Usage

import { DxfViewer, DxfFetcher } from "dxf-renderer";

const canvas = document.getElementById("cad-canvas") as HTMLCanvasElement;
const viewer = new DxfViewer(canvas, {
  canvasWidth: 800,
  canvasHeight: 600,
  autoResize: true,
});

await viewer.load({
  url: "sample.dxf",
  fonts: ["fonts/Roboto-Regular.ttf"],
  progressCbk: (phase, received, total) => {
    console.log(`${phase}: ${received}/${total}`);
  },
});

Web Worker Setup

File parsing and geometry generation can be delegated to a Web Worker for maximum UI responsiveness:

// worker.ts
import { SetupWorker } from "dxf-renderer/SetupWorker";

SetupWorker();
// main.ts
const viewer = new DxfViewer(canvas, {
  workerFactory: () => new Worker(new URL("./worker.ts", import.meta.url), { type: "module" }),
});

Features

  • Worker Offloading: File fetching, parsing, and buffer generation run seamlessly in a dedicated Web Worker.
  • Geometry Batching: Merges draw calls into batch buffers minimizing total WebGL draw operations.
  • Instanced Rendering: Repeated features (such as block references and inserts) utilize WebGL instanced rendering.
  • Multi-Font & Fallback Support: Lazy-loads glyphs across multiple TTF fonts as characters are encountered.
  • Layer Management: Dynamically toggle and inspect drawing layers without rebuilding geometry.
  • Paper Space & Viewports: Supports layout sheets, viewports, and model-space projections.
  • Embedded Image & OLE Rendering: Supports raster images and embedded OLE spreadsheets/EMF records.

License and Attribution

This project is licensed under the terms of the Mozilla Public License 2.0 (MPL-2.0).

  • Original Project: dxf-viewer — Copyright (c) 2024 SIA SPH Engineering and dxf-viewer contributors.
  • Modifications & TypeScript Conversion: Copyright (c) 2026 Jorge Soares and dxf-renderer contributors.
  • Embedded DXF Parser: MIT License — Copyright (c) 2015 GDS Storefront Estimating.
  • Hatch Patterns: Derived from QCAD.

To support the original creator of dxf-viewer (Artyom Lebedev): Donate