.. role:: ts-api-decorator

#################
SVGMarkupRenderer
#################

.. js:module:: Markup.Svg
   :noindex:

.. container:: ts-api-section

   .. js:class:: SVGMarkupRenderer

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



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.constructor`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawCircle`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawCircles`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawLine`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawLines`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawPolygon`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawPolygons`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawPolyline`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawPolylines`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawRectangle`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawRectangles`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawText`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawTextBox`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawTextBoxes`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.drawTexts`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.measureText`
   * :js:meth:`~Markup.Svg.SVGMarkupRenderer.measureTextBox`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: SVGMarkupRenderer.constructor()



      :rtype: SVGMarkupRenderer



Methods
=======

.. rst-class:: ts-api-section

drawCircle
----------

.. js:method:: SVGMarkupRenderer.drawCircle( circle)

   :param circle: the circle to draw.
   :type circle: Circle


   Renders a circle to the markup layer.

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


   :rtype: Element

.. rst-class:: ts-api-section

drawCircles
-----------

.. js:method:: SVGMarkupRenderer.drawCircles( circleCollection)

   :param circleCollection: None
   :type circleCollection: CircleCollection


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

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


   :rtype: [Element]

.. rst-class:: ts-api-section

drawLine
--------

.. js:method:: SVGMarkupRenderer.drawLine( line)

   :param line: the line to render.
   :type line: Line


   Renders a line to the markup layer.

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


   :rtype: SVGLineElement

.. rst-class:: ts-api-section

drawLines
---------

.. js:method:: SVGMarkupRenderer.drawLines( lineCollection)

   :param lineCollection: None
   :type lineCollection: LineCollection


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

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


   :rtype: [Element]

.. rst-class:: ts-api-section

drawPolygon
-----------

.. js:method:: SVGMarkupRenderer.drawPolygon( polygon)

   :param polygon: the polygon to render.
   :type polygon: Polygon


   Renders a polygon to the markup layer.

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


   :rtype: Element

.. rst-class:: ts-api-section

drawPolygons
------------

.. js:method:: SVGMarkupRenderer.drawPolygons( polygonCollection)

   :param polygonCollection: None
   :type polygonCollection: PolygonCollection


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

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


   :rtype: [Element]

.. rst-class:: ts-api-section

drawPolyline
------------

.. js:method:: SVGMarkupRenderer.drawPolyline( line)

   :param line: the polyline to draw.
   :type line: Polyline


   Renders a polyline to the markup layer.

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


   :rtype: SVGPolylineElement

.. rst-class:: ts-api-section

drawPolylines
-------------

.. js:method:: SVGMarkupRenderer.drawPolylines( polylineCollection)

   :param polylineCollection: None
   :type polylineCollection: PolylineCollection


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

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


   :rtype: [Element]

.. rst-class:: ts-api-section

drawRectangle
-------------

.. js:method:: SVGMarkupRenderer.drawRectangle( rectangle)

   :param rectangle: the rectangle to render.
   :type rectangle: Rectangle


   Renders a rectangle to the markup layer.

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


   :rtype: Element

.. rst-class:: ts-api-section

drawRectangles
--------------

.. js:method:: SVGMarkupRenderer.drawRectangles( rectangleCollection)

   :param rectangleCollection: None
   :type rectangleCollection: RectangleCollection


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

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


   :rtype: [Element]

.. rst-class:: ts-api-section

drawText
--------

.. js:method:: SVGMarkupRenderer.drawText( text)

   :param text: the text to render.
   :type text: Text


   Renders text to the markup layer.

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


   :rtype: SVGTextContentElement

.. rst-class:: ts-api-section

drawTextBox
-----------

.. js:method:: SVGMarkupRenderer.drawTextBox( textBox)

   :param textBox: the text box to render.
   :type textBox: TextBox


   Renders a text box to the markup layer.

   :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.


   :rtype: [Element]

.. rst-class:: ts-api-section

drawTextBoxes
-------------

.. js:method:: SVGMarkupRenderer.drawTextBoxes( textBoxes)

   :param textBoxes: the collection of text boxes to render.
   :type textBoxes: TextBoxCollection


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

   :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.


   :rtype: [[Element]]

.. rst-class:: ts-api-section

drawTexts
---------

.. js:method:: SVGMarkupRenderer.drawTexts( texts)

   :param texts: the collection of texts to render.
   :type texts: TextCollection


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

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


   :rtype: [Element]

.. rst-class:: ts-api-section

measureText
-----------

.. js:method:: SVGMarkupRenderer.measureText( str, text)

   :param str: the text string to measure.
   :type str: string
   :param text: None
   :type text: TextMarkupBase


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

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


   :rtype: Point2

.. rst-class:: ts-api-section

measureTextBox
--------------

.. js:method:: SVGMarkupRenderer.measureTextBox( textBox)

   :param textBox: the text box to measure.
   :type textBox: TextBox


   Computes the width and height of a text box.

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


   :rtype: Point2

