MarkupRenderer

class Communicator.Markup.MarkupRenderer()

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


Methods

drawCircle

MarkupRenderer.drawCircle(circle)

Renders a circle to the markup layer.

Arguments
  • circle (Circle()) – the circle to draw.

Return type

Element

Returns

SVG element for the circle. This element is temporary and will not be preserved when the markup is redrawn.

drawCircles

MarkupRenderer.drawCircles(circles)

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

Arguments
Return type

[Element]

Returns

an array containing SVG elements for each circle. These elements are temporary and will not be preserved when the markup is redrawn.

drawLine

MarkupRenderer.drawLine(line)

Renders a line to the markup layer.

Arguments
  • line (Line()) – the line to render.

Return type

Element

Returns

SVG element for the line. This element is temporary and will not be preserved when the markup is redrawn.

drawLines

MarkupRenderer.drawLines(lines)

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

Arguments
Return type

[Element]

Returns

an array containing SVG elements for each line. These elements are temporary and will not be preserved when the markup is redrawn.

drawPolygon

MarkupRenderer.drawPolygon(polygon)

Renders a polygon to the markup layer.

Arguments
  • polygon (Polygon()) – the polygon to render.

Return type

Element

Returns

SVG element for the polygon. This element is temporary and will not be preserved when the markup is redrawn.

drawPolygons

MarkupRenderer.drawPolygons(polygons)

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

Arguments
Return type

[Element]

Returns

an array containing SVG elements for each polygon. These elements are temporary and will not be preserved when the markup is redrawn.

drawPolyline

MarkupRenderer.drawPolyline(polyline)

Renders a polyline to the markup layer.

Arguments
Return type

Element

Returns

SVG element for the line. This element is temporary and will not be preserved when the markup is redrawn.

drawPolylines

MarkupRenderer.drawPolylines(polylines)

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

Arguments
Return type

[Element]

Returns

an array containing SVG elements for each line. These elements are temporary and will not be preserved when the markup is redrawn.

drawRectangle

MarkupRenderer.drawRectangle(rectangle)

Renders a rectangle to the markup layer.

Arguments
Return type

Element

Returns

SVG element for the rectangle. This element is temporary and will not be preserved when the markup is redrawn.

drawRectangles

MarkupRenderer.drawRectangles(rectangles)

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

Arguments
Return type

[Element]

Returns

an array containing SVG elements for each rectangle. These elements are temporary and will not be preserved when the markup is redrawn.

drawText

MarkupRenderer.drawText(text)

Renders text to the markup layer.

Arguments
  • text (Text()) – the text to render.

Return type

Element

Returns

SVG element for the text. This element is temporary and will not be preserved when the markup is redrawn.

drawTextBox

MarkupRenderer.drawTextBox(textBox)

Renders a text box to the markup layer.

Arguments
  • textBox (TextBox()) – the text box to render.

Return type

[Element]

Returns

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.

drawTextBoxes

MarkupRenderer.drawTextBoxes(textBoxes)

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

Arguments
Return type

[[Element]]

Returns

an array containing SVG element pairs for each text box. These elements are temporary and will not be preserved when the markup is redrawn.

drawTexts

MarkupRenderer.drawTexts(texts)

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

Arguments
Return type

[Element]

Returns

an array containing SVG elements for each text. These elements are temporary and will not be preserved when the markup is redrawn.

measureText

MarkupRenderer.measureText(str, markup)

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

Arguments
Return type

Point2()

Returns

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

measureTextBox

MarkupRenderer.measureTextBox(textBox)

Computes the width and height of a text box.

Arguments
  • textBox (TextBox()) – the text box to measure.

Return type

Point2()

Returns

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