MarkupRenderer
- class Communicator.Markup.MarkupRenderer()
This class provides an interface for MarkupItems to draw on the canvas.
Methods
Methods
drawCircle
drawCircles
- MarkupRenderer.drawCircles(circles)
Renders a collection of circles sharing the same properties to the markup layer.
- Arguments
circles (
CircleCollection()
) – the collection of circle to render.
- 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
drawLines
- MarkupRenderer.drawLines(lines)
Renders a collection of lines sharing the same properties to the markup layer.
- Arguments
lines (
LineCollection()
) – the collection of lines to render.
- 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
drawPolygons
- MarkupRenderer.drawPolygons(polygons)
Renders a collection of polygons sharing the same properties to the markup layer.
- Arguments
polygons (
PolygonCollection()
) – the collection of polygons to render.
- 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
polyline (
Polyline()
) –
- 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
polylines (
PolylineCollection()
) –
- 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
rectangle (
Rectangle()
) – the rectangle to render.
- 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
rectangles (
RectangleCollection()
) – the collection of rectangles to render.
- 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
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
textBoxes (
TextBoxCollection()
) – the collection of text boxes to render.
- 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
texts (
TextCollection()
) – the collection of texts to render.
- 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
str (
string()
) – the text string to measure.markup (
TextMarkupBase()
) –
- Return type
- Returns
a point object containing the width and height in pixels of the string.