Architecture
Ownership
src/core/visio(theooxml-core/visioentry): package intake, XML, model, inheritance, cached geometry, ShapeSheet evaluation, editing commands, collaboration mapping (ooxml-core/visio/collab) and structured diagnostics. No viewer UI belongs here. The DOM-free view contract also lives in the core, insrc/core/visio/ui:contract.ts(properties and events),document-history.ts(bounded source-backed edit history and VSDX-copy export state, with XML/package mutation running through a dedicated worker),document-text-search.ts(bounded literal matching over normalized visible shape text, with immutable page-scoped results) the collaboration option and presence types, and the other DOM-free editing and view plans (move, resize, formatting, draw paths, guides).src/ui/src/visio(published asooxml-ui/visio): the browser viewer.controller.tsowns document/view state, selection, events, latest-load-wins behavior and transactional editing orchestration;viewer-element.tsis the shared<visio-viewer>surface;binding.tsis the client-only mount/update/load/fit/exportSvg/destroy lifecycle (reentrant newer updates supersede the remaining older patch);render-svg.tsandrender-text.tsare SVG presentation and rendering warnings;export-svg.tsis bounded, static current-page serialization through the same SVG renderer, with embedded raster resources and compatibility metadata;print-snapshot.tsproduces side-effect-free selected-page artifacts with aggregate budgets and preserved diagnostics (it does not create print frames or implement printer policy); the building blocks arebuilding-blocks-*.ts.viewers/visio/src/index.ts: a re-export ofooxml-ui/visio.src/ui/src/bindings(published asooxml-ui/bindings): the framework-neutral binding kit shared by docx, xlsx, visio and teams (deferred handle, prop picking, change-only forwarding, and the React and Vue component factories).viewers/visio/packages/bindings/src(private) holds the Visio contract (VIEWER_CONTRACT), the revision-aware forwarding ofmountFrameworkViewerand each adapter, andpackages/{react,vue,angular,svelte,solid,vanilla}are the distributions. The native building-block compositions are there too. No per-framework parser, rendering or geometry fork.
Boundaries
The engine currently uses cached ShapeSheet values. This is not comprehensive formula evaluation. Browser font metrics, wrapping, mixed paragraph spacing/indentation, RTL and bullets are implemented with bounded work; these do not establish exact Visio text fidelity.
Document XML/HTML is not injected into the DOM. SVG nodes are created through DOM APIs. No document upload, telemetry or remote-document fetch is provided. Package and relationship checks belong to the core. The browser component parses in a dedicated worker with cancellation and a 15-second parent timeout. Independent scene, metadata, text-work and decoded-raster budgets protect rendering. Image resources are shared within each render and revoked on replacement, disconnect or disposal. Font load listeners trigger text reflow and are removed on disconnect. These defenses are not a security certification.
Experimental source-backed plain-text replacement supports bounded undo/redo and explicit VSDX-copy export. Core rejects master-linked shapes, rich text, fields, signed packages and macro content. Model-only documents are read-only. Formula caches are not recalculated and native Visio reopen verification remains outstanding; this is not an edit/save round-trip guarantee. The handle methods, events and limits are in the viewer API.
Safety and limits
The core validates OPC relationships, rejects DTD/entities and suspicious ZIP paths, and bounds archive input/count/declared expansion/actual streamed output and XML complexity. The viewer checks file size before Blob allocation and validates externally supplied scenes before drawing, including actual raster structure, detected MIME and intrinsic dimensions. Raster validation checks structure/checksums, not full entropy decoding; native decoder robustness remains relevant. External relationships are never fetched, document strings are text nodes, and unsupported features are reported.
The browser custom element uses a dedicated parsing worker with cancellation and a parent-side 15-second limit. The headless controller and environments without Worker support use cooperative core limits. One page part may hold up to 1,500,000 XML nodes (about 10,000 shapes as Visio saves them) and a drawing up to 2,000,000; within them the core's ten-second cooperative deadline bounds the load, and the worker's 15-second limit ends a parse that overruns it (bounded processing). Memory is bounded separately: the heap each part takes is estimated before it is parsed, and one read or edit, with every package it opens and the model it builds, may take what the host's heap allows (480 MiB in the parsing worker, which reports no limit); past 64 MiB a read takes at most 4,096 bytes for each byte of the file, so a small file cannot expand into a large heap. A drawing over a limit is refused with the shape count of the page, and one too large to edit (more than 100,000 ShapeSheet cells, or an edit that would not fit in memory) opens read-only and says why. SVG/text rendering still runs on the main thread with separate scene, raster, metadata and text-work limits. The project is not yet security-certified or production-hardened.
Embedded metafiles
Embedded enhanced metafiles receive bounded record-level compatibility diagnostics. The checker rejects unsupported formats, styles, mapping states and resource amplification before any conversion. It does not execute embedded WMF data, fonts, images, scripts or external references. The disposable parser worker converts only a narrow admitted line/rectangle/ellipse and stock-object subset through the converter package, with document budgets and a parent-owned hard deadline. Direct core parsing remains inspection-only unless a trusted converter is explicitly supplied in an isolated host. All five previously inspected real EMF media parts remain unsupported; structural admission alone does not promise rendering or Visio fidelity.
The headless core contains a tested neutral-vector sanitizer and transport validator. The parser worker uses the converter for a bounded primitive EMF subset, which shares live, SVG export and immutable print rendering. The non-worker parser fallback remains converter-free. Generated path-only clipping tests agree with the local Skia SVG backend; the installed librsvg backend ignores nested clip-path intersections. Browser and native Visio comparisons remain required. See the detailed adoption review.
Verification
Core unit and fixture tests establish their asserted parse/model cases. Viewer tests establish lifecycle and view behavior. Browser tests establish actual interaction. Genuine Visio-authored fixtures, known reference renders and measured comparisons remain necessary for fidelity claims. Framework runtime tests are separate from wrapper compilation.
Website
VitePress documentation site (docs/): home, guide, capability ledger, architecture and a separate playground, which Vite builds from demos/visio/demo/. Links are relative and assets local. No third-party fonts or scripts. No parser bundle on the landing page.
Publication
Eight npm packages expose the headless Visio API, the shared viewer with six native framework adapters, and the MCP tools. They depend on ooxml-core and ooxml-ui, which live in this repository and are released with them (see releasing). The repository's Pages build deploys the documentation and demos under /ooxml/visio/.