Static addAdds accessibility elements to SVG root
SVG element to enhance
Accessibility configuration
Static addStatic addStatic addStatic calculateCalculates viewBox with padding applied
ViewBox configuration
Padding-adjusted dimensions and offsets
Static createSVGCreates a base SVG element with proper namespace and dimensions
SVG width in pixels
SVG height in pixels
Optional idPrefix: stringOptional ID prefix for the root SVG element
JSDOM Document containing the SVG
Static estimateStatic generateStatic generateGenerates self-contained pan/zoom script for SVG No external dependencies - fully embedded JavaScript
ID of the SVG group to apply transform to
Minimum zoom level (default: 0.5)
Maximum zoom level (default: 3)
Show zoom in/out/reset buttons (default: false)
Script tag with pan/zoom implementation
Private Static generateStatic getStatic roundedStatic sanitizeSVGSanitizes SVG string to remove potentially malicious content
Raw SVG XML string
Sanitized SVG string
Static sanitizeStatic seededStatic wrapStatic wrapWraps SVG string in a scrollable HTML container Useful for large visualizations that exceed viewport size
The SVG XML string to wrap
Maximum container width in pixels (default: 1200)
Maximum container height in pixels (default: 800)
Whether to show container border (default: true)
Border color (default: #ddd)
HTML string with SVG wrapped in scrollable div
Utility class for SVG operations