MarkupRenderer

class Markup.MarkupRenderer()

This class provides an interface for MarkupItems to draw on the canvas.

Methods

Markup.MarkupRenderer.drawCircle()
drawCircle(circle: Circle): Element

Renders a circle to the markup layer.

Parameters

circle: Circle

the circle to draw.

Returns: Element

SVG element for the circle. This element is temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawCircles()
drawCircles(circles: CircleCollection): Element[]

Renders a collection of circles sharing the same properties to the markup layer.

Parameters

circles: CircleCollection

the collection of circle to render.

Returns: Element[]

an array containing SVG elements for each circle. These elements are temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawLine()
drawLine(line: Line): Element

Renders a line to the markup layer.

Parameters

line: Line

the line to render.

Returns: Element

SVG element for the line. This element is temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawLines()
drawLines(lines: LineCollection): Element[]

Renders a collection of lines sharing the same properties to the markup layer.

Parameters

lines: LineCollection

the collection of lines to render.

Returns: Element[]

an array containing SVG elements for each line. These elements are temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawPolygon()
drawPolygon(polygon: Polygon): Element

Renders a polygon to the markup layer.

Parameters

polygon: Polygon

the polygon to render.

Returns: Element

SVG element for the polygon. This element is temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawPolygons()
drawPolygons(polygons: PolygonCollection): Element[]

Renders a collection of polygons sharing the same properties to the markup layer.

Parameters

polygons: PolygonCollection

the collection of polygons to render.

Returns: Element[]

an array containing SVG elements for each polygon. These elements are temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawPolyline()
drawPolyline(polyline: Polyline): Element

Renders a polyline to the markup layer.

Parameters

polyline: Polyline

Returns: Element

SVG element for the line. This element is temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawPolylines()
drawPolylines(polylines: PolylineCollection): Element[]

Renders a collection of polylines sharing the same properties to the markup layer.

Parameters

Returns: Element[]

an array containing SVG elements for each line. These elements are temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawRectangle()
drawRectangle(rectangle: Rectangle): Element

Renders a rectangle to the markup layer.

Parameters

rectangle: Rectangle

the rectangle to render.

Returns: Element

SVG element for the rectangle. This element is temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawRectangles()
drawRectangles(rectangles: RectangleCollection): Element[]

Renders a collection of rectangles sharing the same properties to the markup layer.

Parameters

rectangles: RectangleCollection

the collection of rectangles to render.

Returns: Element[]

an array containing SVG elements for each rectangle. These elements are temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawText()
drawText(text: Text): Element

Renders text to the markup layer.

Parameters

text: Text

the text to render.

Returns: Element

SVG element for the text. This element is temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawTextBox()
drawTextBox(textBox: TextBox): Element[]

Renders a text box to the markup layer.

Parameters

textBox: TextBox

the text box to render.

Returns: Element[]

SVG element pair for the text. The first item in this array corresponds to the rectangle. The second item corresponds to the text. These elements are temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawTextBoxes()
drawTextBoxes(textBoxes: TextBoxCollection): Element[][]

Renders a collection of text boxes sharing the same properties to the markup layer.

Parameters

textBoxes: TextBoxCollection

the collection of text boxes to render.

Returns: Element[][]

an array containing SVG element pairs for each text box. These elements are temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.drawTexts()
drawTexts(texts: TextCollection): Element[]

Renders a collection of text sharing the same properties to the markup layer.

Parameters

texts: TextCollection

the collection of texts to render.

Returns: Element[]

an array containing SVG elements for each text. These elements are temporary and will not be preserved when the markup is redrawn.
Markup.MarkupRenderer.measureText()
measureText(str: string, markup: TextMarkupBase): Point2

Computes the width and height of a string using the given text attributes.

Parameters

str: string

the text string to measure.

markup: TextMarkupBase

Returns: Point2

a point object containing the width and height in pixels of the string.
Markup.MarkupRenderer.measureTextBox()
measureTextBox(textBox: TextBox): Point2

Computes the width and height of a text box.

Parameters

textBox: TextBox

the text box to measure.

Returns: Point2

a point object containing the width and height in pixels of the text box.