Architecture

One format engine, one shared rendering path, and a small lifecycle boundary for every host framework.

Separate format from presentation

01 / FORMAT

ooxml-core/visio

Package intake, XML, document model, inheritance, cached geometry and diagnostics.

02 / VIEW

One shared viewer

Controller, SVG rendering, selection, page navigation, zoom and compatibility notes.

03 / HOST

Your application

A lifecycle adapter or custom element forwards properties and events.

The viewer imports the public ooxml-core/visio entry point. Parsing and document semantics stay in the sibling engine, so a future renderer or headless consumer does not need a UI dependency.

Document flow

  1. A local File or byte buffer enters the viewer.
  2. The core checks package structure and resource limits, then resolves the relevant parts.
  3. Shapes, styles and cached geometry normalize into a typed model with diagnostics.
  4. The shared SVG renderer draws a selected page, including supported background content.
  5. The controller owns navigation, zoom, loading, selection and events.
Cached geometry is not formula evaluation

The current engine uses cached ShapeSheet values. It does not recalculate the full Visio formula language, routing behavior, constraints, or editing dependencies.

Framework contract

mountViewer(host, options) creates the custom element and manages common event forwarding. Framework integrations should own only mount/update/unmount wiring. The same properties and events are declared in src/contract.ts.

The six native adapters in packages/bindings delegate to this surface. A behavior fixed in one wrapper must be checked across the others. Successful compilation alone does not verify a framework's runtime lifecycle.

Shared appearance

All framework hosts use the same custom element styling. Set --vv-background, --vv-surface, --vv-secondary, --vv-ink, --vv-muted, --vv-border, --vv-accent, and --vv-accent-soft on the host to fit your application. Keep text and control contrast accessible.

The playground and documentation share one local light/dark preference. An embedded live demo follows the containing page without replacing the document or resetting edits.

Safety boundaries

Testing layers

Layer What to verify What it does not prove
Core unit/fixture tests Package limits, relationships, model values, geometry math Comprehensive Visio rendering fidelity
Viewer unit tests Lifecycle, event forwarding, input handling, rendering decisions Real browser interaction or framework wiring
Browser tests Open, pages, zoom, selection, errors, cleanup and no unexpected upload Untested commands or real Visio round-trip
Reference corpus Compare genuine documents with Visio output Features absent from the corpus

Site architecture

The documentation is a lightweight static, multi-page Vite site. Relative links and bundled local assets allow it to run under a repository-prefixed path. It uses system fonts and no third-party scripts or font requests. The home embeds one same-origin playground only after you choose Load live demo. The preview illustration is distinct from the actual shared component; your files open only when you select or drop them.

The visual structure takes inspiration from pptx-viewer: warm paper and rust colors, a dot-grid hero, an embedded live playground, monospaced controls, framework quickstart, and task-oriented documentation. Light and dark modes share the same preference with the application. The local review in docs/research/pptx-pages-design-review.md records the detailed findings.

Publication is separate

The seven npm packages ship the shared viewer and native framework adapters over the released ooxml-core/visio API. The release workflow validates packed consumers and browser behavior before publishing with provenance. The GitHub Pages workflow deploys the verified demo.

Search documentation

Type to find a topic.