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

ipe2tikz

v1.0.0

Published

Clean-room Ipe XML to TikZ converter for JavaScript and TypeScript.

Readme

ipe2tikz

JavaScript/TypeScript converter from Ipe XML (.ipe) documents to TikZ.

Installation

npm install ipe2tikz

CLI usage

# Convert an Ipe file and write TikZ to stdout
ipe2tikz diagram.ipe

# Write TikZ to a file
ipe2tikz diagram.ipe -o diagram.tex

# Read from stdin
cat diagram.ipe | ipe2tikz

# Select a page or view using 1-based CLI indices
ipe2tikz diagram.ipe --page 2 --view 1 -o page-2-view-1.tex

Options:

| Option | Description | |--------|-------------| | -o, --output FILE | Write TikZ output to FILE | | --page N | Convert page N; defaults to page 1 | | --view N | Convert view N on the selected page | | --no-xcolor-rgb-convert | Emit explicit {rgb,1:...} color syntax instead of xcolor mix expressions | | -h, --help | Show help |

Diagnostics are printed to stderr. Errors exit with status 1; warnings still emit TikZ and exit successfully.

Web demo

Build the package, then open or serve the static demo:

npm run build
python3 -m http.server 8123

Then visit http://localhost:8123/demo/. The demo imports dist/browser/ipe2tikz.js, runs entirely in the browser, and includes a small built-in sample.

Development

npm install
npm run check
npm test
npm run build

Public API

import { convertIpeToTikz, parseIpeXml } from "ipe2tikz";

const result = convertIpeToTikz(ipeXmlSource, { page: 0, view: 0 });

convertIpeToTikz(source, options) returns { tikz, diagnostics }. page and view are zero-based indices; omitted page defaults to the first page, and omitted view emits all page objects without view-layer filtering. RGB colors are converted to compact xcolor mix expressions with xcolor-rgb-convert by default; pass { useXcolorRgbConvert: false } to emit explicit {rgb,1:...} color syntax, or pass xcolorRgbConvertOptions through to rgbToXcolorExpression.

parseIpeXml(source) returns the typed intermediate representation plus parse diagnostics. The package exports the IR and diagnostic TypeScript types from src/ir.ts, including IpeDocument, IpeObject, IpePathCommand, and IpeToTikzDiagnostic.

Current implementation status

The converter parses Ipe XML into a typed intermediate representation before emitting TikZ. The supported subset is fixture-driven and includes:

  • document roots with preambles, pages, layers, views, groups, paths, text objects, image objects, and bitmap metadata,
  • inherited top-level object layers, view-based layer filtering, and view layer transforms,
  • group scopes, clipping paths, object matrices, and text transforms,
  • stylesheet parsing and last-stylesheet-wins resolution for colors, pens, opacities, dash styles, text sizes/styles, path styles, symbols, symbol sizes, arrow sizes, gradients, and tilings,
  • stylesheet symbols and use objects, including sym-stroke, sym-fill, sym-pen, numeric/symbolic symbol sizes, and unresolved-symbol diagnostics,
  • path operators m, l, h, cubic/quadratic Beziers, supported s/C spline forms, u closed splines, L clothoid splines with Ipe-provided Bezier approximations, e ellipses, standalone arcs, and mixed arc paths, converted to cubic Beziers where needed,
  • stroke/fill, numeric and symbolic pen widths, dash styles, line cap/join, fill rule, opacity/stroke opacity, object matrices, and approximate arrows.meta arrowheads with symbolic arrow sizes and xcolor mix expression output for RGB colors,
  • axial and radial two-color gradient shading and simple line tiling patterns,
  • label and minipage nodes with anchors, text size/style handling, opacity, width/height/depth metrics, object transforms, and raw LaTeX text content,
  • image nodes as \includegraphics when a programmatic caller supplies imagePath to map bitmap IDs to existing image files,
  • structured diagnostics for invalid XML, invalid required attributes, unsupported objects, unresolved symbolic styles, unsupported path effects, unsupported path operators, and unsupported image output.

Unsupported or approximate areas include clothoid L path operators without Ipe-provided Bezier approximations, full gradient stop/matrix/extend and focal point fidelity, exact Ipe tiling fidelity, bitmap extraction/decoding for the CLI and demo, exact Ipe arrow geometry, full text layout fidelity, and richer multi-object/special-symbol behavior. Unsupported operators and effects are preserved or diagnosed where possible and omitted from TikZ when they cannot be emitted.

Black-box comparison harness:

npm run compare:ipe -- --input test/fixtures/ipe/polyline.ipe
npm run compare:ipe -- --all

The harness converts fixtures, writes TikZ artifacts plus report.json and report.html under artifacts/compare-ipe-import, and records whether external renderers such as iperender and pdflatex are available. On macOS it also checks the standard /Applications/Ipe.app/Contents/MacOS/iperender location. When both renderers are available, it writes Ipe-rendered and TikZ-rendered PDFs, rasterizes them to PNG with pdftoppm, trims whitespace, and records an ImageMagick RMSE diff plus a diff PNG when magick is available. Open report.html to scan every fixture with the trimmed Ipe and TikZ PNGs side by side.