# JSXGraph 1.10.0 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
- Axes3D
- Axis
- Axis3D
- Bisector
- Bisectorlines
- Boxplot
- Button
- Cardinalspline
- Chart
- Checkbox
- Circle
- Circle3D
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Comb
- Conic
- Curve
- Curve3D
- CurveDifference
- CurveIntersection
- CurveUnion
- Derivative
- Ellipse
- ForeignObject
- Functiongraph
- Functiongraph3D
- Glider
- Grid
- Group
- Hatch
- Hyperbola
- Image
- ImplicitCurve
- Incenter
- Incircle
- Inequality
- Input
- Integral
- Intersection
- IntersectionCircle3D
- IntersectionLine3D
- Label
- Legend
- Line
- Line3D
- Locus
- MajorArc
- MajorSector
- Measurement
- Mesh3D
- Metapostspline
- Midpoint
- MinorArc
- MinorSector
- mirrorelement
- Mirrorpoint
- NonReflexAngle
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelogram
- Parallelpoint
- ParametricSurface3D
- Perpendicular
- PerpendicularPoint
- PerpendicularSegment
- Point
- Point3D
- PolarLine
- PolePoint
- Polygon
- PolygonalChain
- RadicalAxis
- Reflection
- ReflexAngle
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Slopefield
- Slopetriangle
- Smartlabel
- Sphere3D
- Spline
- Stepfunction
- Tangent
- TangentTo
- Tapemeasure
- Text
- Text3D
- Ticks
- Ticks3D
- Tracecurve
- Transformation
- Turtle
- Vectorfield
- Vectorfield3D
- View3D

Classes

- _global_
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.Board.infobox
- JXG.C
- JXG.CA
- JXG.CanvasRenderer
- JXG.Chart
- JXG.Circle
- JXG.Circle3D
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.CoordsElement
- JXG.Curve
- JXG.Curve3D
- JXG.Dump
- JXG.EventEmitter
- JXG.Expect
- JXG.ForeignObject
- JXG.GeometryElement
- JXG.GeometryElement3D
- JXG.GeonextParser
- JXG.Group
- JXG.Image
- JXG.JessieCode
- JXG.JSXGraph
- JXG.Legend
- JXG.Line
- JXG.Line3D
- JXG.Math
- JXG.Math.BoxQuadtree
- JXG.Math.Clip
- JXG.Math.Extrapolate
- JXG.Math.Geometry
- JXG.Math.ImplicitPlot
- 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.Plane3D
- JXG.Point
- JXG.Point3D
- JXG.Polygon
- JXG.Polygon3D
- JXG.PrefixParser
- JXG.Server
- JXG.Server.modules
- JXG.Sphere3D
- JXG.Surface3D
- JXG.SVGRenderer
- JXG.Text
- JXG.Text3D
- JXG.Ticks
- JXG.Transformation
- JXG.Turtle
- JXG.Util
- JXG.Util.Base64
- JXG.Util.Unzip
- JXG.Util.UTF8
- JXG.View3D
- JXG.VMLRenderer
- JXG.XML

# 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, options) 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) Initialize 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|Object} container
  id of or reference to the HTML element in which the board is painted.
{Object} attr
  An object that sets some of the board properties.

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

Parameters:
{Object} attributes
  User supplied attributes
options

Returns:
  {Object} Merged attributes for the board

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

Parameters:
{JXG.Board|String} board
  id of or reference to the DOM element in which the board is drawn.

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

Parameters:
{String|Object} box
  id of or reference 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.

See:
  JXG.AbstractRenderer#drawNavigationBar

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

Parameters:
{String} box
  id of or reference to 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', specifies 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|Object} box
  id of or reference 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|Object} box
  id of or reference 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

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Oct 02 2024 09:14:35 GMT+0200 (Mitteleuropäische Sommerzeit)