SVG
SVG Utility Functions.
interface ComplexSvgItem {
defs?: Array<SvgItem>
style?: SvgStyleElement
svgItem: SvgItem
}
type MaybeComplexSvgItem = SvgItem | ComplexSvgItem
type SvgElement = SVGSVGElement
type SvgFilter = SVGFEFloodElement | SVGFEOffsetElement | SVGFEBlendElement | SVGClipPathElement | SVGFEColorMatrixElement | SVGFEConvolveMatrixElement | SVGFEDisplacementMapElement | SVGFEComponentTransferElement
interface SvgFilters
extends Array<SvgFilter> {}
type SvgItem = SVGElement | ClientImage
interface SvgItemArgs {
/** Optionally apply a transparency level. */
opacity?: Scalar
/** Full output size. */
size: Size
/** Output SVG for this time. */
time: Time
/** The clip time range. */
timeRange: TimeRange
}
interface SvgItemsRecord {
defs: Array<SvgItem>
items: Array<SvgItem>
styles: Array<SvgStyleElement>
}
type SvgStyleElement = SVGStyleElement
type SvgVector = SVGTextElement | SVGPolygonElement | SVGPathElement | SVGRectElement | SVGCircleElement | SVGEllipseElement
function sizeSvgD(
size: Size
): string
function svgAddClass(
element: Element,
className?: OrArray<string>
): Element
function svgAppend<T = Element>(
element: T,
items?: SvgItem | Array<SvgItem>
): T
function svgElementDefs(
svgItems: Array<SvgItem>
): SVGDefsElement
function svgElementImage(
document: Document,
url?: string,
options?: RectOptions
): SVGImageElement
function svgElementImagePromise(
url: string,
container?: SvgElement,
options?: RectOptions,
timeout?: number
): Promise<DataOrError<SVGImageElement>>
function svgElementMask(
contentItem: SvgItem,
id: string,
transparency?: Transparency
): SVGMaskElement
function svgElementPattern(
dimensions: Size,
id: string,
items?: SvgItem | Array<SvgItem>
): SVGPatternElement
function svgElementPolygon(
document: Document,
dimensions: Size | Rect,
className?: OrArray<string>,
fill?: string,
id?: string
): SVGPolygonElement
function svgElementStyle(
document: Document,
filename: string,
family: string
): SVGStyleElement
function svgElementSvg(
document: Document,
size?: Size,
svgItems?: SvgItem | Array<SvgItem>
): SvgElement
function svgItemsAppend(
record: SvgItemsRecord,
item: OrArray<MaybeComplexSvgItem>,
dontAddToItems?: boolean
): SvgItem
function svgItemsMerged(
records: Array<SvgItemsRecord>
): SvgItemsRecord
function svgItemsSimplified(
svg: SvgElement,
record: SvgItemsRecord
): SvgItem
function svgOpacity<T = SvgItem>(
element: T,
opacity?: Scalar
): T
function svgRecord(
items: Array<MaybeComplexSvgItem>,
dontAddToItems?: boolean
): SvgItemsRecord
function svgRectPoints(
dimensions: Size | Rect
): string
function svgSet<T = Element>(
element: T,
value?: Value,
name?: string
): T
function svgSetDimensions<T = Element>(
element: T,
dimensions?: object
): T
function svgSetRectOptions<T = Element>(
element: T,
options?: RectOptions
): T
function svgSetTransformRects(
element: SvgItem,
dimensions: Rect | Size,
rect: Rect
): SvgItem
function svgStringClean(
svgString: string
): StringOrNot
function svgStringElement(
svgString: string
): SVGSVGElement | undefined
function svgStrokePolygons(
document: Document,
sizeOrRect: Rect | Size,
strokeWidth: number,
fill?: string
): Array<SvgItem>
function svgTag(
tag?: string,
outBox?: string,
dims?: string
): string
function svgUrl(
id: string
): string