Represents a rendering engine that performs the basic drawing routines.
Gets or sets the value that indicates css priority. By default, it's true and the specified css class has a priority over current engine's properties like fill or stroke.
addClipRect(clipRect: Rect, id: string): void
Adds a clipping rectangle to the context.
beginRender(): void
Clears the viewport and starts the rendering cycle.
drawDonutSegment(cx: number, cy: number, radius: number, innerRadius: number, startAngle: number, sweepAngle: number, className?: string, style?: any, clipPath?: string): void
Draws a doughnut segment.
X coordinate of the segment center.
Y coordinate of the segment center.
Outer radius of the segment.
Inner radius of the segment.
Start angle of the segment, in degrees.
Sweep angle of the segment, in degrees clockwise.
Class name to be applied to the element.
Style object to be applied to the element.
Id of the path to use as a clipping path.
drawEllipse(cx: number, cy: number, rx: number, ry: number, className?: string, style?: any): void
Draws an ellipse.
X coordinate of the ellipse's center.
Y coordinate of the ellipse's center.
X radius (half of the ellipse's width).
Y radius (half of the ellipse's height).
Class name to be applied to the element.
Style object to be applied to the element.
drawImage(href: string, x: number, y: number, w: number, h: number): void
Draws an image.
Url of the image to draw.
Left coordinate of the image's bounding rectangle.
Bottom coordinate of the image's bounding rectangle.
Image width.
Image height.
drawLine(x1: number, y1: number, x2: number, y2: number, className?: string, style?: any): void
Draws a line.
X coordinate of the first point.
Y coordinate of the first point.
X coordinate of the second point.
Y coordinate of the second point.
Class name to be applied to the element.
Style object to be applied to the element.
drawLines(xs: number[], ys: number[], className?: string, style?: any, clipPath?: string, num?: number): void
Draws a series of lines.
Array of X coordinates.
Array of Y coordinates.
Class name to be applied to the element.
Style object to be applied to the element.
Id of the path to use as a clipping path.
drawPieSegment(cx: number, cy: number, radius: number, startAngle: number, sweepAngle: number, className?: string, style?: any, clipPath?: string): void
Draws a pie segment.
X coordinate of the segment center.
Y coordinate of the segment center.
Radius of the segment.
Start angle of the segment, in degrees.
Sweep angle of the segment, in degrees clockwise.
Class name to be applied to the element.
Style object to be applied to the element.
Id of the path to use as a clipping path.
drawPolygon(xs: number[], ys: number[], className?: string, style?: any, clipPath?: string): void
Draws a polygon.
Array of X coordinates.
Array of Y coordinates.
Class name to be applied to the element.
Style object to be applied to the element.
Id of the path to use as a clipping path.
drawRect(x: number, y: number, w: number, h: number, className?: string, style?: any, clipPath?: string): void
Draws a rectangle.
Left of the rectangle.
Bottom of the rectangle.
Width of the rectangle.
Height of the rectangle.
Class name to be applied to the element.
Style object to be applied to the element.
Id of the path to use as a clipping path.
drawSplines(xs: number[], ys: number[], className?: string, style?: any, clipPath?: string, num?: number): void
Draws a series of splines (smooth path).
Array of X coordinates.
Array of Y coordinates.
Class name to be applied to the element.
Style object to be applied to the element.
Id of the path to use as a clipping path.
drawString(s: string, pt: Point, className?: string, style?: any): void
Draws a string.
String to be drawn.
Reference point for the string.
Class name to be applied to the element.
Style object to be applied to the element.
drawStringRotated(s: string, pt: Point, center: Point, angle: number, className?: string, style?: any): void
Draws a rotated string.
String to be drawn.
Reference point for rendering the string.
Reference point for rotating the string.
Rotation angle, in degrees, clockwise.
Class name to be applied to the element.
Style object to be applied to the element.
endGroup(): void
Ends a group.
endRender(): void
Finishes the rendering cycle.
measureString(s: string, className?: string, groupName?: string, style?: any): Size
Measures a string.
String to be measured.
Class name to use when measuring the string.
Name of the group to use when measuring the string.
Style object to use when measuring the string.
setViewportSize(w: number, h: number): void
Sets the size of the viewport.
startGroup(className?: string, clipPath?: string, createTransform?: boolean): void
Starts a group.
Class name to apply to the new group.
Id of the path to use as a clipping path.
Whether to create a new transform for the group.