
##############
MarkupRenderer
##############

.. js:class:: Markup.MarkupRenderer

   This class provides an interface for MarkupItems to draw on the canvas.
   
   
   Index
   =====
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~Markup.MarkupRenderer.drawCircle`
   * :js:meth:`~Markup.MarkupRenderer.drawCircles`
   * :js:meth:`~Markup.MarkupRenderer.drawLine`
   * :js:meth:`~Markup.MarkupRenderer.drawLines`
   * :js:meth:`~Markup.MarkupRenderer.drawPolygon`
   * :js:meth:`~Markup.MarkupRenderer.drawPolygons`
   * :js:meth:`~Markup.MarkupRenderer.drawPolyline`
   * :js:meth:`~Markup.MarkupRenderer.drawPolylines`
   * :js:meth:`~Markup.MarkupRenderer.drawRectangle`
   * :js:meth:`~Markup.MarkupRenderer.drawRectangles`
   * :js:meth:`~Markup.MarkupRenderer.drawText`
   * :js:meth:`~Markup.MarkupRenderer.drawTextBox`
   * :js:meth:`~Markup.MarkupRenderer.drawTextBoxes`
   * :js:meth:`~Markup.MarkupRenderer.drawTexts`
   * :js:meth:`~Markup.MarkupRenderer.measureText`
   * :js:meth:`~Markup.MarkupRenderer.measureTextBox`
   
   




Methods
=======

.. js:method:: Markup.MarkupRenderer.drawCircle

   .. rst-class:: sig-pretty-signature
   
      | drawCircle(**circle**\ : :js:class:`Circle <Markup.Shapes.Circle>`\ ): *Element*
   
   Renders a circle to the markup layer.
   
   **Parameters**
   
      **circle**\ : :js:class:`Circle <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawCircles

   .. rst-class:: sig-pretty-signature
   
      | drawCircles(**circles**\ : :js:class:`CircleCollection <Markup.Shapes.CircleCollection>`\ ): *Element*\ []
   
   Renders a collection of circles sharing the same properties to the markup layer.
   
   **Parameters**
   
      **circles**\ : :js:class:`CircleCollection <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawLine

   .. rst-class:: sig-pretty-signature
   
      | drawLine(**line**\ : :js:class:`Line <Markup.Shapes.Line>`\ ): *Element*
   
   Renders a line to the markup layer.
   
   **Parameters**
   
      **line**\ : :js:class:`Line <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawLines

   .. rst-class:: sig-pretty-signature
   
      | drawLines(**lines**\ : :js:class:`LineCollection <Markup.Shapes.LineCollection>`\ ): *Element*\ []
   
   Renders a collection of lines sharing the same properties to the markup layer.
   
   **Parameters**
   
      **lines**\ : :js:class:`LineCollection <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawPolygon

   .. rst-class:: sig-pretty-signature
   
      | drawPolygon(**polygon**\ : :js:class:`Polygon <Markup.Shapes.Polygon>`\ ): *Element*
   
   Renders a polygon to the markup layer.
   
   **Parameters**
   
      **polygon**\ : :js:class:`Polygon <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawPolygons

   .. rst-class:: sig-pretty-signature
   
      | drawPolygons(**polygons**\ : :js:class:`PolygonCollection <Markup.Shapes.PolygonCollection>`\ ): *Element*\ []
   
   Renders a collection of polygons sharing the same properties to the markup layer.
   
   **Parameters**
   
      **polygons**\ : :js:class:`PolygonCollection <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawPolyline

   .. rst-class:: sig-pretty-signature
   
      | drawPolyline(**polyline**\ : :js:class:`Polyline <Markup.Shapes.Polyline>`\ ): *Element*
   
   Renders a polyline to the markup layer.
   
   **Parameters**
   
      **polyline**\ : :js:class:`Polyline <Markup.Shapes.Polyline>`
   
   
   **Returns**\ : *Element*
   
      SVG element for the line. This element is temporary and will not be preserved when the markup is redrawn.
   
   



.. js:method:: Markup.MarkupRenderer.drawPolylines

   .. rst-class:: sig-pretty-signature
   
      | drawPolylines(**polylines**\ : :js:class:`PolylineCollection <Markup.Shapes.PolylineCollection>`\ ): *Element*\ []
   
   Renders a collection of polylines sharing the same properties to the markup layer.
   
   **Parameters**
   
      **polylines**\ : :js:class:`PolylineCollection <Markup.Shapes.PolylineCollection>`
   
   
   **Returns**\ : *Element*\ []
   
      an array containing SVG elements for each line. These elements are temporary and will not be preserved when the markup is redrawn.
   
   



.. js:method:: Markup.MarkupRenderer.drawRectangle

   .. rst-class:: sig-pretty-signature
   
      | drawRectangle(**rectangle**\ : :js:class:`Rectangle <Markup.Shapes.Rectangle>`\ ): *Element*
   
   Renders a rectangle to the markup layer.
   
   **Parameters**
   
      **rectangle**\ : :js:class:`Rectangle <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawRectangles

   .. rst-class:: sig-pretty-signature
   
      | drawRectangles(**rectangles**\ : :js:class:`RectangleCollection <Markup.Shapes.RectangleCollection>`\ ): *Element*\ []
   
   Renders a collection of rectangles sharing the same properties to the markup layer.
   
   **Parameters**
   
      **rectangles**\ : :js:class:`RectangleCollection <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawText

   .. rst-class:: sig-pretty-signature
   
      | drawText(**text**\ : :js:class:`Text <Markup.Shapes.Text>`\ ): *Element*
   
   Renders text to the markup layer.
   
   **Parameters**
   
      **text**\ : :js:class:`Text <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawTextBox

   .. rst-class:: sig-pretty-signature
   
      | drawTextBox(**textBox**\ : :js:class:`TextBox <Markup.Shapes.TextBox>`\ ): *Element*\ []
   
   Renders a text box to the markup layer.
   
   **Parameters**
   
      **textBox**\ : :js:class:`TextBox <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawTextBoxes

   .. rst-class:: sig-pretty-signature
   
      | drawTextBoxes(**textBoxes**\ : :js:class:`TextBoxCollection <Markup.Shapes.TextBoxCollection>`\ ): *Element*\ [][]
   
   Renders a collection of text boxes sharing the same properties to the markup layer.
   
   **Parameters**
   
      **textBoxes**\ : :js:class:`TextBoxCollection <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.drawTexts

   .. rst-class:: sig-pretty-signature
   
      | drawTexts(**texts**\ : :js:class:`TextCollection <Markup.Shapes.TextCollection>`\ ): *Element*\ []
   
   Renders a collection of text sharing the same properties to the markup layer.
   
   **Parameters**
   
      **texts**\ : :js:class:`TextCollection <Markup.Shapes.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.
   
   



.. js:method:: Markup.MarkupRenderer.measureText

   .. rst-class:: sig-pretty-signature
   
      | measureText(**str**\ : *string*\ , **markup**\ : :js:class:`TextMarkupBase <Markup.Shapes.TextMarkupBase>`\ ): :js:class:`~Point2`
   
   Computes the width and height of a string using the given text attributes.
   
   **Parameters**
   
      **str**\ : *string*
   
         the text string to measure.
   
   
      **markup**\ : :js:class:`TextMarkupBase <Markup.Shapes.TextMarkupBase>`
   
   
   **Returns**\ : :js:class:`~Point2`
   
      a point object containing the width and height in pixels of the string.
   
   



.. js:method:: Markup.MarkupRenderer.measureTextBox

   .. rst-class:: sig-pretty-signature
   
      | measureTextBox(**textBox**\ : :js:class:`TextBox <Markup.Shapes.TextBox>`\ ): :js:class:`~Point2`
   
   Computes the width and height of a text box.
   
   **Parameters**
   
      **textBox**\ : :js:class:`TextBox <Markup.Shapes.TextBox>`
   
         the text box to measure.
   
   
   
   **Returns**\ : :js:class:`~Point2`
   
      a point object containing the width and height in pixels of the text box.
   
   





