# 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

- Angle
- Arc
- Arrow
- Arrowparallel
- Axis
- Bisector
- Bisectorlines
- Circle
- Circumcenter
- Circumcircle
- CircumcircleArc
- Circumcirclesector
- Conic
- Curve
- Ellipse
- Functiongraph
- Glider
- Grid
- Hyperbola
- Image
- Incenter
- Incircle
- Integral
- Intersection
- Line
- Locus
- Midpoint
- Mirrorpoint
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelpoint
- Perpendicular
- Perpendicularpoint
- Point
- Polygon
- Reflection
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Tangent
- Text
- Ticks
- Tracecurve

## Classes

- _global_
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.C
- JXG.CanvasRenderer
- JXG.Circle
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.Curve
- JXG.Dump
- 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.Point
- JXG.Polygon
- JXG.Server
- JXG.Server.modules
- JXG.SVGRenderer
- JXG.Text
- JXG.Ticks
- JXG.Turtle
- JXG.Util
- JXG.VMLRenderer

# Class JXG.CanvasRenderer

JXG.AbstractRenderer
↳ JXG.CanvasRenderer

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

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

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

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

Method Summary
Method Attributes | Method Name and Description
--- | ---
<private> | _drawFilledPolygon(shape) Draws a filled polygon.
<private> | _fill(element) 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(element, type, targetType) Sets color and opacity for filling and stroking.
<private> | _stroke(element) 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:
  _updateVisual, appendChildPrim, appendNodesToElement, changePointStyle, createPrim, displayCopyright, drawCurve, drawEllipse, drawImage, drawInternalText, drawLine, drawPoint, drawPolygon, drawText, drawTicks, drawZoomBar, getElementById, hide, highlight, joinTransforms, makeArrows, noHighlight, remove, removeDraft, resize, setBuffering, setDashStyle, setDraft, setGradient, setObjectFillColor, setObjectStrokeColor, setObjectStrokeWidth, setPropertyPrim, setShadow, show, suspendRedraw, transformImage, unsuspendRedraw, updateCurve, updateEllipse, updateEllipsePrim, updateGradient, updateImage, updateImageURL, updateInternalText, updateLine, updateLinePrim, updatePathPrim, updatePathStringBezierPrim, updatePathStringPoint, updatePathStringPrim, updatePoint, updatePolygon, updatePolygonPrim, updateRectPrim, updateText, updateTextStyle, updateTicks

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

Parameters:
{Node} container
  Reference to a DOM node containing the board.

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(element)
Sets the fill color and fills an area.

Parameters:
{JXG.GeometryElement} element
  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(element, 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} element
  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(element)
Sets color and opacity for drawing paths and lines and draws the paths and lines.

Parameters:
{JXG.GeometryElement} element
  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.

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Apr 02 2012 17:54:06 GMT+0200 (MESZ)