Configuration overrides.
OptionalDOMParser?: { prototype: DOMParser; new (): DOMParser }Constructor compatible with the WHATWG DOMParser
interface. Used as a fallback when globalThis.DOMParser is undefined.
Optionalviz?: VizEngineA ready-to-use Graphviz engine implementing
VizEngine (renderString(dot, opts)). Overrides the default
@viz-js/viz engine for all subsequent renders.
Inject runtime configuration for jssm/viz — a custom
DOMParserconstructor for the*_svg_elementfunctions, a replacement Graphviz engine for every render path, or both.Each key is handled independently. Idempotent — last call wins per key; an omitted (or
undefined) key leaves any earlier injection for that key in place, so neither injection can be un-set. No-op if called with no recognized keys.Precedence differs by key, on purpose:
DOMParseris a fallback —globalThis.DOMParser(browsers, jsdom test environments) still wins when present.vizis an override — once injected it is used for every render, and the default@viz-js/vizimport is never even attempted. This is what lets WASM-hostile environments (strict-CSP webviews such as VS Code's markdown preview) supply an asm.js Graphviz build at runtime, without bundler aliasing. See VizEngine for the exact contract.