# 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
- Boxplot
- Button
- Cardinalspline
- Chart
- Checkbox
- Circle
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Comb
- Conic
- Constants
- Curve
- CurveDifference
- CurveIntersection
- CurveUnion
- Derivative
- Ellipse
- ForeignObject
- 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.Chart
- JXG.Circle
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.CoordsElement
- JXG.Curve
- JXG.Dump
- JXG.EventEmitter
- JXG.ForeignObject
- JXG.GeometryElement
- JXG.GeonextParser
- JXG.Group
- JXG.Image
- JXG.JessieCode
- JXG.JSXGraph
- JXG.Legend
- JXG.Line
- JXG.Math
- JXG.Math.Clip
- JXG.Math.Extrapolate
- JXG.Math.Geometry
- JXG.Math.IntervalArithmetic
- JXG.Math.Metapost
- JXG.Math.Nlp
- JXG.Math.Numerics
- JXG.Math.Plot
- JXG.Math.Poly
- JXG.Math.Poly.Monomial
- JXG.Math.Poly.Polynomial
- JXG.Math.Poly.Ring
- JXG.Math.ProbFuncs
- JXG.Math.Quadtree
- 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
- Legend
- Line
- Locus
- MajorArc
- MajorSector
- Metapostspline
- Midpoint
- MinorArc
- MinorSector
- Mirrorelement
- Mirrorpoint
- NonReflexAngle
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelpoint
- Perpendicular
- PerpendicularPoint
- PerpendicularSegment
- Point
- PolarLine
- PolePoint
- Polygon
- PolygonalChain
- RadicalAxis
- Reflection
- ReflexAngle
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Slopetriangle
- Spline
- Stepfunction
- Tangent
- Tapemeasure
- Text
- Ticks
- Tracecurve
- Transformation
- Turtle

# Class JXG.JSXGraph

↳ JXG.JSXGraph

The JXG.JSXGraph singleton stores all properties required to load, save, create and free a board.
Defined in: jsxgraph.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG.JSXGraph() Constructs a new JSXGraph singleton object.

Field Summary
Field Attributes | Field Name and Description
--- | ---
<static> | JXG.JSXGraph.rendererType Stores the renderer that is used to draw the boards.

Method Summary
Method Attributes | Method Name and Description
--- | ---
<private> <static> | JXG.JSXGraph._fillBoard(board, attr, dimensions) Further initialization of the board.
<private> <static> | JXG.JSXGraph._removeARIANodes(board) Remove the two corresponding ARIA divs when freeing a board
<private> <static> | JXG.JSXGraph._setARIA(container, attr)
<private> <static> | JXG.JSXGraph._setAttributes(attributes) Merge the user supplied attributes with the attributes in options.js
<static> | JXG.JSXGraph.freeBoard(board) Delete a board and all its contents.
<static> | JXG.JSXGraph.initBoard(box, attributes) Initialise a new board.
<private> <static> | JXG.JSXGraph.initRenderer(box, dim, doc, attrRenderer) Initialize the rendering engine
<static> | JXG.JSXGraph.loadBoardFromFile(box, file, format, attributes, callback) Load a board from a file containing a construction made with either GEONExT, Intergeo, Geogebra, or Cinderella.
<static> | JXG.JSXGraph.loadBoardFromString(box, string, format, attributes, callback) Load a board from a base64 encoded string containing a construction made with either GEONExT, Intergeo, Geogebra, or Cinderella.
<static> <deprecated> | JXG.JSXGraph.registerElement(element, creator)

Class Detail
JXG.JSXGraph()
Constructs a new JSXGraph singleton object.
Field Detail
<static> {String} JXG.JSXGraph.rendererType
Stores the renderer that is used to draw the boards.
Method Detail
<private> <static> JXG.JSXGraph._fillBoard(board, attr, dimensions)
Further initialization of the board. Set some properties from attribute values.

Parameters:
{JXG.Board} board
{Object} attr
  attributes object
{Object} dimensions
  Object containing dimensions of the canvas

<private> <static> JXG.JSXGraph._removeARIANodes(board)
Remove the two corresponding ARIA divs when freeing a board

Parameters:
{JXG.Board} board

<private> <static> JXG.JSXGraph._setARIA(container, attr)

Parameters:
{String} container
  HTML-ID to the HTML-element in which the board is painted.
{*} attr
  An object that sets some of the board properties.

<private> <static> {Object} JXG.JSXGraph._setAttributes(attributes)
Merge the user supplied attributes with the attributes in options.js

Parameters:
{Object} attributes
  User supplied attributes

Returns:
  {Object} Merged attributes for the board

<static> JXG.JSXGraph.freeBoard(board)
Delete a board and all its contents.

Parameters:
{JXG.Board|String} board
  HTML-ID to the DOM-element in which the board is drawn.

<static> {JXG.Board} JXG.JSXGraph.initBoard(box, attributes)
Initialise a new board.

Parameters:
{String} box
  HTML-ID to the HTML-element in which the board is painted.
{Object} attributes
  An object that sets some of the board properties. Most of these properties can be set via JXG.Options.
{Array} attributes.boundingbox Optional, Default: [-5, 5, 5, -5]
  An array containing four numbers describing the left, top, right and bottom boundary of the board in user coordinates
{Boolean} attributes.keepaspectratio Optional, Default: false
  If `true`, the bounding box is adjusted to the same aspect ratio as the aspect ratio of the div containing the board.
{Boolean} attributes.showCopyright Optional, Default: false
  Show the copyright string in the top left corner.
{Boolean} attributes.showNavigation Optional, Default: false
  Show the navigation buttons in the bottom right corner.
{Object} attributes.zoom Optional
  Allow the user to zoom with the mouse wheel or the two-fingers-zoom gesture.
{Object} attributes.pan Optional
  Allow the user to pan with shift+drag mouse or two-fingers-pan gesture.
{Object} attributes.drag Optional
  Allow the user to drag objects with a pointer device.
{Object} attributes.keyboard Optional
  Allow the user to drag objects with arrow keys on keyboard.
{Boolean} attributes.axis Optional, Default: false
  If set to true, show the axis. Can also be set to an object that is given to both axes as an attribute object.
{Boolean|Object} attributes.grid Optional
  If set to true, shows the grid. Can also be set to an object that is given to the grid as its attribute object.
{Boolean} attributes.registerEvents Optional, Default: true
  Register mouse / touch events.

Returns:
  {JXG.Board} Reference to the created board.

<private> <static> {Object} JXG.JSXGraph.initRenderer(box, dim, doc, attrRenderer)
Initialize the rendering engine

Parameters:
{String} box
  HTML id of the div-element which hosts the JSXGraph construction
{Object} dim
  The dimensions of the board
{Object} doc
  Usually, this is document object of the browser window. If false or null, this defaults to the document object of the browser.
{Object} attrRenderer
  Attribute 'renderer', speficies the rendering engine. Possible values are 'auto', 'svg', 'canvas', 'no', and 'vml'.

Returns:
  {Object} Reference to the rendering engine object.

<static> {JXG.Board} JXG.JSXGraph.loadBoardFromFile(box, file, format, attributes, callback)
Load a board from a file containing a construction made with either GEONExT, Intergeo, Geogebra, or Cinderella.

Parameters:
{String} box
  HTML-ID to the HTML-element in which the board is painted.
{String} file
  base64 encoded string.
{String} format
  containing the file format: 'Geonext' or 'Intergeo'.
{Object} attributes
  Attributes for the board and 'encoding'. Compressed files need encoding 'iso-8859-1'. Otherwise it probably is 'utf-8'.
{Function} callback

Returns:
  {JXG.Board} Reference to the created board.

See:
  JXG.FileReader
  JXG.GeonextReader
  JXG.GeogebraReader
  JXG.IntergeoReader
  JXG.CinderellaReader

Examples:

    // Uncompressed file
    var board = JXG.JSXGraph.loadBoardFromFile('jxgbox', 'filename', 'geonext',
         {encoding: 'utf-8'},
         function (board) { console.log("Done loading"); }
    );
    // Compressed file
    var board = JXG.JSXGraph.loadBoardFromFile('jxgbox', 'filename', 'geonext',
         {encoding: 'iso-8859-1'},
         function (board) { console.log("Done loading"); }
    );

    // From
    var file = document.getElementById('localfile').files[0];
    JXG.JSXGraph.loadBoardFromFile('jxgbox', file, 'geonext',
         {encoding: 'utf-8'},
         function (board) { console.log("Done loading"); }
    );

<static> {JXG.Board} JXG.JSXGraph.loadBoardFromString(box, string, format, attributes, callback)
Load a board from a base64 encoded string containing a construction made with either GEONExT, Intergeo, Geogebra, or Cinderella.

Parameters:
{String} box
  HTML-ID to the HTML-element in which the board is painted.
{String} string
  base64 encoded string.
{String} format
  containing the file format: 'Geonext', 'Intergeo', 'Geogebra'.
{Object} attributes
  Attributes for the board and 'encoding'. Compressed files need encoding 'iso-8859-1'. Otherwise it probably is 'utf-8'.
{Function} callback

Returns:
  {JXG.Board} Reference to the created board.

See:
  JXG.FileReader
  JXG.GeonextReader
  JXG.GeogebraReader
  JXG.IntergeoReader
  JXG.CinderellaReader

<static> JXG.JSXGraph.registerElement(element, creator)

Parameters:
element
creator

Deprecated:
Use JXG#registerElement