AbstractStatictoConverts an SVG element to a Base64-encoded JPEG data URL.
The SVG element to convert
A promise resolving to the Base64 data URL, or empty string on error
StaticselectSelects all SVG elements matching a query and optionally clones them.
The type of SVG element to select
CSS selector string to query elements
Whether to clone elements and insert them as hidden copies (default: true)
Array of selected (or cloned) SVG elements
StaticselectSelects a single SVG element matching a query and optionally clones it.
The type of SVG element to select
CSS selector string to query the element
Whether to clone the element and insert it as a hidden copy (default: true)
The selected (or cloned) SVG element
StaticselectSelect the Nth element matching a query, in document order.
Useful when a single CSS selector matches multiple sibling elements
(e.g. multi-series Vega-Lite line charts where each series renders as
a separate <g class="mark-line role-mark layer_0_marks"> group, all
with the same class). CSS :nth-child(N) cannot address the Nth
matching group when classes differ; this helper does it via JS.
Always returns the live DOM element (no cloning side-effects), since the indexed-selection use case is for resolving live DOM nodes that downstream code (highlight pipeline, etc.) operates on directly.
The type of SVG element to select
CSS selector string
Zero-based index into the query results
The Nth matching element, or null if no Nth match exists
StaticcreateCreates an empty, hidden, transparent SVG element of the specified type.
The SVG element type to create (default: 'rect')
The newly created SVG element
StaticcreateCreates a circle element styled to match the parent element's stroke or fill.
The x-coordinate of the circle center
The y-coordinate of the circle center
The parent SVG element to inherit styling from
The newly created circle element
StaticcreateCreates a line element along a specified edge of an SVG element's bounding box.
When the bounding box has zero width (vertical path) or zero height (horizontal path), a minimum span is used so the resulting line is visible.
The SVG element to create a line along
The edge position ('top', 'bottom', 'left', or 'right')
The newly created line element
StaticcreateCreates a highlighted clone of an SVG element with enhanced visibility.
When the element has a zero-size bounding box (e.g. a single-point
<path d="M x y"> used for median markers in violin plots), a
visible <circle> is created at that position instead.
The SVG element to highlight
Color to use if original color cannot be determined
The highlighted clone element
StaticgetCalculates a contrasting color (black or white) based on the element's fill color.
The SVG element to analyze
'#000' for light backgrounds, '#fff' for dark backgrounds
StaticsetApplies CSS outline styling to highlight a subplot element.
The SVG element to highlight
The color for the outline
StaticremoveRemoves CSS outline highlighting from a subplot element.
The SVG element to remove highlighting from
StaticsetApplies SVG stroke highlighting to a subplot with adaptive color based on background.
The SVG group element to highlight
Color to use if background color cannot be determined
OptionalfigureBgElement: SVGElementOptional background element to inherit color from
StaticremoveRemoves SVG stroke highlighting from a subplot element.
The SVG group element to remove highlighting from
Abstract utility class for SVG element manipulation, conversion, and highlighting operations.