StaticaddStaticAddAdds accessibility elements to SVG root
SVG element to enhance
Accessibility configuration
StaticaddUse AddArrowMarker.
StaticAddAdds an arrowhead marker definition to SVG
SVG element
Marker ID
Arrow color
Marker ID for use in marker-end attribute
StaticaddStaticAddInjects inline CSS styles into SVG
SVG element
CSS string to inject
StaticaddStaticAddGenerates 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
StaticcalculateUse CalculateViewBox.
StaticCalculateCalculates viewBox with padding applied
ViewBox configuration
Padding-adjusted dimensions and offsets
StaticcreateOptionalidPrefix: stringUse CreateSVG.
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
StaticestimateStaticEstimateCalculates 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
StaticgenerateStaticGenerateGenerates a unique ID with prefix and timestamp
ID prefix (e.g., 'flow', 'node')
Index or identifier
Unique ID string
StaticgenerateStaticGenerateGenerates 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
StaticgetStaticGetCreates a
SVG element
The defs element (existing or newly created)
StaticroundedUse RoundedRectPath.
StaticRoundedCreates a rounded rectangle path
X coordinate
Y coordinate
Width
Height
Corner radius
SVG path data string
StaticsanitizeStaticSanitizeSanitizes SVG string to remove potentially malicious content
Raw SVG XML string
Sanitized SVG string
StaticsanitizeStaticSanitizeSanitizes text content to prevent XSS attacks
Raw text content
HTML-safe text
StaticseededStaticSeededCreates 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
StaticwrapStaticWrapWraps text to fit within a specified width
Text to wrap
Maximum width in characters (approximate)
Array of text lines
StaticwrapStaticWrapWraps 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