# JSXGraph Reference

## JavaScript must be enabled in order for you to use JSXGraph and JSXGraph reference. However, it seems JavaScript is either disabled or not supported by your browser.

Class Index | File Index

## Elements

## Classes

- _global_
- Angle
- Arc
- Arrow
- Arrowparallel
- Axis
- Bisector
- Bisectorlines
- Button
- Cardinalspline
- Checkbox
- Circle
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Conic
- Curve
- Derivative
- Ellipse
- Functiongraph
- Glider
- Grid
- Group
- Hatch
- Hyperbola
- Image
- Incenter
- Incircle
- Inequality
- Input
- Integral
- Intersection
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.C
- JXG.CA
- JXG.CanvasRenderer
- JXG.Circle
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.CoordsElement
- JXG.Curve
- JXG.Dump
- JXG.EventEmitter
- JXG.GeometryElement
- JXG.GeonextParser
- JXG.Group
- JXG.Image
- JXG.JessieCode
- JXG.JSXGraph
- JXG.Line
- JXG.Math
- JXG.Math.Geometry
- JXG.Math.Numerics
- JXG.Math.Poly
- JXG.Math.Poly.Monomial
- JXG.Math.Poly.Polynomial
- JXG.Math.Poly.Ring
- JXG.Math.Statistics
- JXG.Math.Symbolic
- JXG.NoRenderer
- JXG.Options
- JXG.Point
- JXG.Polygon
- JXG.Server
- JXG.Server.modules
- JXG.SVGRenderer
- JXG.Text
- JXG.Ticks
- JXG.Transformation
- JXG.Turtle
- JXG.Util
- JXG.Util.Base64
- JXG.Util.Unzip
- JXG.Util.UTF8
- JXG.VMLRenderer
- JXG.XML
- Label
- Line
- Locus
- MajorArc
- MajorSector
- Midpoint
- MinorArc
- MinorSector
- Mirrorelement
- Mirrorpoint
- NonReflexAngle
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelpoint
- Perpendicular
- PerpendicularPoint
- PerpendicularSegment
- Point
- PolarLine
- PolePoint
- Polygon
- Quadtree
- RadicalAxis
- Reflection
- ReflexAngle
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Slopetriangle
- Spline
- Stepfunction
- Tangent
- Tapemeasure
- Text
- Ticks
- Tracecurve
- Transformation
- Turtle

# Class JXG.CanvasRenderer

JXG.AbstractRenderer
↳ JXG.CanvasRenderer

JXG.AbstractRenderer
Defined in: canvas.js.
Extends JXG.AbstractRenderer.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG.CanvasRenderer(container, dim) Uses HTML Canvas to implement the rendering methods defined in JXG.AbstractRenderer.

Fields borrowed from class JXG.AbstractRenderer:
  container, enhancedRendering, supportsForeignObject, type, vOffsetText

Fields borrowed from class JXG.AbstractRenderer:
  container, enhancedRendering, supportsForeignObject, type, vOffsetText

Method Summary
Method Attributes | Method Name and Description
--- | ---
<private> | _drawFilledPolygon(shape) Draws a filled polygon.
<private> | _fill(el) Sets the fill color and fills an area.
<private> | _rotatePoint(angle, x, y) Rotates a point around `(0, 0)` by a given angle.
<private> | _rotateShape(shape, angle) Rotates an array of points around `(0, 0)`.
<private> | _setColor(el, type, targetType) Sets color and opacity for filling and stroking.
<private> | _stroke(el) Sets color and opacity for drawing paths and lines and draws the paths and lines.
<private> | _translateShape(shape, x, y) Translates a set of points.

Methods borrowed from class JXG.AbstractRenderer:
  _css2js, _setArrowWidth, _updateVisual, appendChildPrim, appendNodesToElement, changePointStyle, createPrim, createTouchpoints, display, displayCopyright, drawCurve, drawEllipse, drawImage, drawInternalText, drawLine, drawPoint, drawPolygon, drawText, drawTicks, drawZoomBar, dumpToCanvas, getElementById, getPositionArrowHead, hide, hideTouchpoint, highlight, joinTransforms, makeArrows, noHighlight, remove, removeDraft, removeToInsertLater, resize, screenshot, setBuffering, setDashStyle, setDraft, setGradient, setLineCap, setObjectFillColor, setObjectStrokeColor, setObjectStrokeWidth, setObjectTransition, setPropertyPrim, setShadow, show, showTouchpoint, suspendRedraw, transformImage, unsuspendRedraw, updateArrowSize, updateCurve, updateEllipse, updateEllipsePrim, updateGradient, updateImage, updateImageStyle, updateImageURL, updateInternalText, updateInternalTextStyle, updateLine, updateLineEndings, updateLinePrim, updatePathPrim, updatePathStringBezierPrim, updatePathStringPoint, updatePathStringPrim, updatePoint, updatePolygon, updatePolygonPrim, updateRectPrim, updateText, updateTextStyle, updateTicks, updateTouchpoint

Class Detail
JXG.CanvasRenderer(container, dim)
Uses HTML Canvas to implement the rendering methods defined in JXG.AbstractRenderer.

Parameters:
{Node} container
  Reference to a DOM node containing the board.
{Object} dim
  The dimensions of the board
{Number} dim.width
{Number} dim.height

See:
  JXG.AbstractRenderer

Method Detail
<private> _drawFilledPolygon(shape)
Draws a filled polygon.

Parameters:
{Array} shape
  A matrix presented by a two dimensional array of numbers.

See:
  JXG.AbstractRenderer#makeArrows

<private> _fill(el)
Sets the fill color and fills an area.

Parameters:
{JXG.GeometryElement} el
  An arbitrary JSXGraph element, preferably one with an area.

<private> {Array} _rotatePoint(angle, x, y)
Rotates a point around `(0, 0)` by a given angle.

Parameters:
{Number} angle
  An angle, given in rad.
{Number} x
  X coordinate of the point.
{Number} y
  Y coordinate of the point.

Returns:
  {Array} An array containing the x and y coordinate of the rotated point.

<private> {Array} _rotateShape(shape, angle)
Rotates an array of points around `(0, 0)`.

Parameters:
{Array} shape
  An array of array of point coordinates.
{Number} angle
  The angle in rad the points are rotated by.

Returns:
  {Array} Array of array of two dimensional point coordinates.

<private> {Boolean} _setColor(el, type, targetType)
Sets color and opacity for filling and stroking. type is the attribute from visProp and targetType the context[targetTypeStyle]. This is necessary, because the fill style of a text is set by the stroke attributes of the text element.

Parameters:
{JXG.GeometryElement} el
  Any JSXGraph element.
{String} type Optional, Default: 'stroke'
  Either fill or stroke.
{String} targetType Optional, Default: type
  (optional) Either fill or stroke.

Returns:
  {Boolean} If the color could be set, `true` is returned.

<private> _stroke(el)
Sets color and opacity for drawing paths and lines and draws the paths and lines.

Parameters:
{JXG.GeometryElement} el
  An JSXGraph element with a stroke.

<private> {Array} _translateShape(shape, x, y)
Translates a set of points.

Parameters:
{Array} shape
  An array of point coordinates.
{Number} x
  Translation in X direction.
{Number} y
  Translation in Y direction.

Returns:
  {Array} An array of translated point coordinates.