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

@teachinglab/omd

v0.7.28

Published

omd

Downloads

960

Readme

OMD (Open Math Display)

A JavaScript library for creating interactive mathematical interfaces in web applications

npm version License: MIT

OMD is a comprehensive JavaScript library for building rich, interactive mathematical experiences in the browser. From simple equation displays to complex step-by-step solution systems with full visual feedback and user interaction.

OMD Demo

📖 Full Documentation

View the complete documentation →

The full documentation includes interactive examples, detailed API references, and comprehensive guides.

Quick Start

Installation

npm install @teachinglab/omd

Basic Usage

import { omdDisplay } from '@teachinglab/omd';

// Create a math display
const container = document.getElementById('math-container');
const display = new omdDisplay(container);

// Render an equation
display.render('2x + 3 = 11');

Documentation

Getting Started

Core Concepts

1. Global Context & Configuration

Learn about the foundational systems that power OMD:

2. Visualizations

Interactive visual components for teaching and learning:

Number & Ratio Visualizations
  • Number Line - omdNumberLine - Interactive number lines with dots and labels
  • Number Tiles - omdNumberTile - Visual counting tiles with dots
  • Tape Diagrams - omdTapeDiagram - Part-whole relationship diagrams
  • Ratio Charts - omdRatioChart - Pie and bar chart ratio visualizations
  • Balance Hanger - omdBalanceHanger - Balance scale visualizations
Graphing & Geometry
  • Coordinate Plane - omdCoordinatePlane - 2D graphing with functions and shapes
  • Shapes - omdShapes - Geometric shapes (circles, rectangles, polygons, triangles)
  • Spinner - omdSpinner - Interactive circular spinners
Data Display
  • Tables - omdTable - Data tables with customizable styling
  • Function Graphs - Plotting mathematical functions

3. Equations & Expressions

The heart of mathematical notation and manipulation:

Core Expression Components
Advanced Expression Types
Step-by-Step Solutions

Complete API Reference

Features

Interactive Math Rendering

  • High-quality SVG-based mathematical notation
  • Real-time expression manipulation and visualization
  • Automatic layout and alignment for complex equations

Step-by-Step Solutions

  • Visual step tracking with detailed explanations
  • Simplification engine with rule-based transformations
  • Provenance tracking for highlighting related elements

Rich UI Components

  • Built-in toolbar for common mathematical operations
  • Drag & drop interface for intuitive manipulation
  • Customizable canvas for multi-expression layouts

Educational Features

  • Interactive learning experiences
  • Progressive step revelation
  • Visual operation feedback and highlighting

Guides

By Use Case

Advanced Topics

Architecture

OMD Library Structure
├── Core Systems
│   ├── Configuration Manager (Global settings)
│   ├── Display System (Rendering engine)
│   └── Event Manager (Coordination)
│
├── Visualizations
│   ├── Number Visualizations (Number line, tiles, tape diagrams)
│   ├── Graphing (Coordinate plane, functions)
│   └── Data Display (Tables, charts)
│
└── Equations & Expressions
    ├── Node System (Expression tree)
    ├── Equation Components (Equations, terms, operators)
    ├── Advanced Expressions (Powers, rationals, functions)
    └── Step-by-Step System (Simplification, visualization)

Examples

Creating Objects from JSON (Factory Method)

import { createFromJSON } from '@teachinglab/omd';

// AI-generated or dynamic JSON data
const jsonData = {
    omdType: 'numberLine',
    min: 0,
    max: 10,
    dotValues: [2, 5, 8]
};

// Create the object - no switch statement needed!
const numberLine = createFromJSON(jsonData);

Basic Equation

import { omdDisplay, omdEquationNode } from '@teachinglab/omd';

const display = new omdDisplay(document.getElementById('container'));
const equation = omdEquationNode.fromString('2x + 3 = 11');
display.render(equation);

Step-by-Step Solution

import { omdEquationStack } from '@teachinglab/omd';

const steps = [
    '2x + 3 = 11',
    '2x = 8',
    'x = 4'
];

const stack = new omdEquationStack(steps.map(s => 
    omdEquationNode.fromString(s)
), {
    toolbar: true,
    stepVisualizer: true
});

display.render(stack);

Coordinate Plane with Function

import { omdCoordinatePlane } from '@teachinglab/omd';

const plane = new omdCoordinatePlane();
plane.loadFromJSON({
    xMin: -10, xMax: 10,
    yMin: -10, yMax: 10,
    graphEquations: [
        { equation: 'y = x^2 - 4', color: '#e11d48', strokeWidth: 2 }
    ]
});

display.render(plane);

Number Line Visualization

import { omdNumberLine } from '@teachinglab/omd';

const numberLine = new omdNumberLine();
numberLine.loadFromJSON({
    min: 0,
    max: 10,
    dotValues: [2, 5, 8],
    label: 'Number Line Example'
});

display.render(numberLine);

Dependencies

  • JSVG (@teachinglab/jsvg) - High-performance SVG rendering
  • math.js - Mathematical expression parsing
  • Modern Browser - ES6 modules, SVG support required

License

MIT License - see LICENSE for details

Contributing

We welcome contributions! See our contributing guidelines for more information.


Ready to get started? Check out the Getting Started Guide or explore the JSON Schemas for detailed component configurations.