Creates a renderer that renders onto elem. If sanitize, don't render potentially untrusted data.
viewport is used to determine the translation/rotation/scaling/output size of the rendered
data.
ProtectedbeginReturns true iff other can be rendered onto this without data loss.
Draws a styled path. If within an object started by startObject, the resultant path may not be visible until endObject is called.
Strokes a rectangle. Boundary lines have width [lineWidth] and are filled with [lineFill].
This is equivalent to drawPath(Path.fromRect(...).toRenderable(...)).
Allows rendering directly to the underlying SVG element. Rendered
content is added to a <g> element that's passed as parent to callback.
Note: Unlike drawSVGElem, this method can be used even if sanitize is true.
In this case, it's the responsibility of callback to ensure that everything added
to parent is safe to render.
Notes the end of an object.
OptionalloaderData: LoadSaveDataTablea map from strings to JSON-ifyable objects and contains properties attached to the object by whatever loader loaded the image. This is used to preserve attributes not supported by js-draw when loading/saving an image. Renderers may ignore this.
OptionalelemClassNames: string[]a list of labels (e.g. classNames) to be attached to the object.
Renderers may ignore this.
ProtectedendProtectedgetProtectedgetProtectedlineProtectedmoveMUST throw if other and this are not of the same base class.
ProtectedtraceProtectedtraceStaticfromCreates a new SVG element and SVGRenerer with width, height, viewBox,
and other metadata attributes set for the given Viewport.
If options is a boolean, it is interpreted as whether to sanitize (not add unknown
SVG entities to) the output.
Renders onto an
SVGElement.See
Editor.toSVG