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

.. js:class:: wv.Markup.MarkupRenderer

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



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


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

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

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

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

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

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

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

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



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

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

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

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

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

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

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

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

      .. rst-class:: sig-pretty-signature
      
         | measureText(**str**\ : *string*\ , **markup**\ : :js:class:`TextMarkupBase <wv.Markup.Shapes.TextMarkupBase>`\ ): :js:class:`Point2 <wv.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 <wv.Markup.Shapes.TextMarkupBase>`
      
      
            the properties of the text item to measure.
      
      
      
      **Returns**\ : :js:class:`Point2 <wv.Point2>`
      
      
         a point object containing the width and height in pixels of the string.
      
      



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

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




