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

fizzex

v0.1.1

Published

Fizzex - Canvas-based mathematical expression editor. Light and easy formula input.

Downloads

310

Readme

Fizzex

Canvas-based mathematical expression editor — light, fast, framework-agnostic.

Website · GitHub


Installation

npm install fizzex

Entry Points

| Import | Purpose | Peer dependencies | |---|---|---| | fizzex | Core — parser, renderer, analyzer, evaluator | – | | fizzex/headless | Framework-agnostic renderer & editor | – | | fizzex/react | React components | react, react-dom | | fizzex/tiptap | Tiptap extensions | @tiptap/core |

All peer dependencies are optional — import only what you need.

Quick Start

Headless rendering (read-only)

import { DOMRendererView } from 'fizzex/headless';

const renderer = new DOMRendererView(container, {
  baseFontSize: 20,
  theme: 'light',
});
renderer.render('\\frac{1}{2} + x^2');

Headless editor (interactive)

import { DOMEditorView } from 'fizzex/headless';

const editor = new DOMEditorView(container, { baseFontSize: 20 });
editor.setLatex('x^2 + 2x - 3 = 0');
editor.onChange((latex) => console.log(latex));

React

import { EditorView } from 'fizzex/react';

function App() {
  return (
    <EditorView
      width={400}
      height={80}
      theme="light"
      showSuggestions
      onChange={(state) => console.log(state)}
    />
  );
}

Tiptap

import { MathInline, MathBlock } from 'fizzex/tiptap';

const editor = new Editor({
  extensions: [
    StarterKit,
    MathInline.configure({ fizzexConfig: { baseFontSize: 18 } }),
    MathBlock.configure({ fizzexConfig: { baseFontSize: 24 }, editable: true }),
  ],
});

LaTeX ↔ AST

import { parseLatex, astToLatex } from 'fizzex';

const { ast } = parseLatex('\\frac{1}{2} + x^2');
const latex = astToLatex(ast);

Expression analysis

import { parseLatex, analyzeExpression } from 'fizzex';

const { ast } = parseLatex('x^2 + 2x - 3 = 0');
const analysis = analyzeExpression(ast);

analysis.primaryDomain;             // 'polynomial'
analysis.polynomial?.degree;        // 2
analysis.visualization.graphable2D; // true

Numeric evaluation

import {
  parseLatex,
  evaluateSync,
  evaluateMatrixSync,
  evaluateComplexSync,
  differentiateAt,
} from 'fizzex';

// Scalar
const { ast } = parseLatex('x^2 + 2x - 3');
evaluateSync(ast, { x: 2 });              // 5

// Automatic differentiation (forward-mode dual numbers)
differentiateAt(ast, 'x', { x: 2 });       // 6

// Complex (Euler's identity). LaTeX commands like `\pi` are normalized
// to their Unicode form, so the binding key is 'π', not '\pi'.
const euler = parseLatex('e^{i \\pi}').ast;
evaluateComplexSync(euler, { e: Math.E, 'π': Math.PI });
// { re: -1, im: ~0 }

// Matrix
const m = parseLatex('\\begin{pmatrix} 1 & 2 \\\\ 3 & 4 \\end{pmatrix}').ast;
evaluateMatrixSync(m, {});
// { rows: 2, cols: 2, data: [[1,2],[3,4]] }

Visualization

import {
  parseLatex,
  buildSemanticMap,
  getVisualizersForCatalog,
  createVisualizer,
  createVisualizerRegistry,
} from 'fizzex';

// The host hosts the visualizer assets (manifest.json + spec files) as
// static resources and points `baseUrl` at the directory URL. You can
// either reuse the bundled catalog shipped at
// `node_modules/fizzex/dist/visualizers/` (copy/proxy it to your public
// path) or publish your own catalog.
const registry = createVisualizerRegistry({
  baseUrl: '/visualizers/',
});

const { ast } = parseLatex('T^2 = \\frac{4\\pi^2}{GM} a^3');
const catalogId = buildSemanticMap(ast).get(ast.id)?.catalogId;
const refs = catalogId ? getVisualizersForCatalog(catalogId) : [];

const instance = refs[0]
  ? await createVisualizer(container, {
      registry,
      id: refs[0].id,
      width: 400,
      height: 400,
    })
  : null;

What's exported

fizzex

  • ParserparseLatex, astToLatex
  • Editor primitivesMathEditor, createInitialState, createStateFromLatex, node creators (createNumber, createFrac, createIntegral, createMatrix, …)
  • AnalyzeranalyzeExpression, analyzeBindings, analyzeEvaluability, buildSemanticMap
  • EvaluatorevaluateSync / evaluate, evaluateMatrixSync / evaluateMatrix, evaluateComplexSync / evaluateComplex, differentiateAt / differentiate
  • VisualizationcreateVisualizer, createVisualizerRegistry, getVisualizersForCatalog
  • TypesMathNode, EditorState, ExpressionAnalysis, Bindings, EvalResult, Matrix, Complex, Dual, …

fizzex/headless

  • RenderersDOMRendererView, DOMEditorView, DOMStreamView
  • ExplorerExplorerOverlay, ExplorerInlineControls, ExplorerSceneChips, ExplorerVisualizerController
  • Modification utilitiescloneAst, createModificationState, modifyNumberNode, resetNode, resetAll, hasModifications, getControlType, buildInlineControlConfig, buildConfidenceRegions, classifyConfidence

fizzex/react

  • EditorView, StreamView, SuggestionChips, SuggestionPopover, ExpressionExplorer

fizzex/tiptap

  • MathInline, MathBlock

Compatibility

  • Node.js 20+
  • React 19+ (for fizzex/react)
  • Modern browsers with Canvas 2D and ES2020 support

Links

License

MIT