StaticaddAdds accessibility elements to SVG root
SVG element to enhance
Accessibility configuration
StaticaddAdds an arrowhead marker definition to SVG
SVG element
Marker ID
Arrow color
Marker ID for use in marker-end attribute
StaticaddInjects inline CSS styles into SVG
SVG element
CSS string to inject
StaticaddGenerates interactive tooltip script for SVG elements Elements must have data-tooltip attribute
SVG element to add tooltip to
Document to create elements in
Script tag with tooltip implementation
StaticcalculateCalculates viewBox with padding applied
ViewBox configuration
Padding-adjusted dimensions and offsets
StaticcreateCreates a base SVG element with proper namespace and dimensions
SVG width in pixels
SVG height in pixels
OptionalidPrefix: stringOptional ID prefix for the root SVG element
JSDOM Document containing the SVG
StaticestimateCalculates text width (approximate based on character count and font size) More accurate measurement would require actual rendering
Text content
Font size in pixels
Estimated width in pixels
StaticgenerateGenerates a unique ID with prefix and timestamp
ID prefix (e.g., 'flow', 'node')
Index or identifier
Unique ID string
StaticgenerateGenerates 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
StaticgetCreates a
SVG element
The defs element (existing or newly created)
StaticroundedCreates a rounded rectangle path
X coordinate
Y coordinate
Width
Height
Corner radius
SVG path data string
StaticsanitizeSanitizes SVG string to remove potentially malicious content
Raw SVG XML string
Sanitized SVG string
StaticsanitizeSanitizes text content to prevent XSS attacks
Raw text content
HTML-safe text
StaticseededCreates a seeded pseudo-random number generator Uses simple Linear Congruential Generator for deterministic output
Random seed
Function that returns random numbers between 0 and 1
StaticwrapWraps text to fit within a specified width
Text to wrap
Maximum width in characters (approximate)
Array of text lines
StaticwrapWraps 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