Overview
omdDisplay is the main entry point for rendering content in OMD. It attaches to a DOM element and manages the rendering loop, event handling, and updates for any OMD node passed to it.
Basic Usage
import { omdDisplay, omdEquationNode } from '@teachinglab/omd';
// 1. Create the display instance
const container = document.getElementById('math-root');
const display = new omdDisplay(container);
// 2. Create content
const equation = omdEquationNode.fromString('2x + 5 = 15');
// 3. Render
display.render(equation);
Key Features
- Automatic Layout: Handles spacing and alignment of mathematical terms.
- Interactivity: Supports drag-and-drop, clicking, and other gestures.
- Animation: Smoothly transitions between states.