# 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

# Namespace JXG

↳ JXG

Defined in: loadjsxgraph.js.

Namespace Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG JSXGraph namespace.

Field Summary
Field Attributes | Field Name and Description
--- | ---
<static> | JXG.boards Store a reference to every board in this central list.
<static> | JXG.elements Associative array that keeps track of all constructable elements registered via JXG.JSXGraph.registerElement.
<static> | JXG.exists Checks if a given variable is neither undefined nor null.
<static> | JXG.FileReader The FileReader object bundles the file input capabilities of JSXGraph.
<static> | JXG.ieVersion Internet Explorer version.
<static> | JXG.isBrowser A document/window environment is available.
<static> | JXG.licenseText The small gray version indicator in the top left corner of every JSXGraph board (if showCopyright is not set to false on board creation).
<static> | JXG.readers Store the available file readers in this structure.
<static> | JXG.touchProperty Determines the property that stores the relevant information in the event object.
<static> | JXG.Validator Holds all possible properties and the according validators for geometry elements.
<static> | JXG.version Represents the currently used JSXGraph version.

Method Summary
Method Attributes | Method Name and Description
--- | ---
<private> <static> | JXG._ceil10(value, exp) "Ceil" a number to given number of decimal digits.
<private> <static> | JXG._decimalAdjust(type, value, exp) Decimal adjustment of a number.
<private> <static> | JXG._floor10(value, exp) "Floor" a number to given number of decimal digits.
<private> <static> | JXG._round10(value, exp) Round a number to given number of decimal digits.
<static> | JXG.addEvent(obj, type, fn, owner) Adds an event listener to a DOM element.
<static> | JXG.autoDigits(val) Truncate a number `val` automatically.
<static> | JXG.autoHighlight(color) Determines highlight color to a given color.
<static> | JXG.bind(fn, owner) Generates a function which calls the function fn in the scope of owner.
<static> | JXG.capitalize(str) Makes a string lower case except for the first character which will be upper case.
<static> | JXG.Chart(board, parents, attributes) Chart plotting
<static> | JXG.clearVisPropOld(el) Resets visPropOld.
<static> | JXG.clone(obj) This outputs an object with a base class reference to the given object.
<static> | JXG.cloneAndCopy(obj, obj2) Embeds an existing object into another one just like #clone and copies the contents of the second object to the new one.
<static> | JXG.cmpArrays(a1, a2) Compare two arrays.
<static> | JXG.coordsArrayToMatrix(coords, split) Converts an array of JXG.Coords objects into a coordinate matrix.
<static> | JXG.copyAttributes(attributes, options, s) Generates an attributes object that is filled with default values from the Options object and overwritten by the user specified attributes.
<private> <static> | JXG.copyPrototypeMethods(subObj, superObj, constructorName) Copy all prototype methods from object "superObject" to object "subObject".
<static> | JXG.createEvalFunction(board, param, n) Convert a String, a number or a function into a function.
<static> | JXG.createFunction(term, board, variableName, evalGeonext) Convert a String, number or function into a function.
<static> | JXG.createHTMLSlider(board, parents, attributes) [[x,y], [w px, h px], [range]
<static> | JXG.debug(s) Add something to the debug log.
<static> | JXG.debugInt(s) Add something to the debug log.
<static> | JXG.debugWST(s) Add something to the debug log.
<static> | JXG.deepCopy(obj, obj2, toLower) Creates a deep copy of an existing object, i.e.
<static> | JXG.def(v, d) Handle default parameters.
<static> | JXG.deprecated(what, replacement) This method issues a warning to the developer that the given function is deprecated and, if available, offers an alternative to the deprecated function.
<static> | JXG.eliminateDuplicates(a) Eliminates duplicate entries in an array consisting of numbers and strings.
<static> | JXG.escapeHTML(str) Replaces all occurences of & by &amp;, > by &gt;, and < by &lt;.
<static> | JXG.evalSlider(s) If `s` is a slider, it returns the sliders value, otherwise it just returns the given value.
<static> | JXG.evaluate(val) If `val` is a function, it will be evaluated without giving any parameters, else the input value is just returned.
<static> | JXG.filterElements(list, filter) Filter an array of elements.
<static> | JXG.getBoardByContainerId(s) s may be the string containing the id of an HTML tag that hosts a JSXGraph board.
<static> | JXG.getCSSTransform(cPos, obj) Correct position of upper left corner in case of a CSS transformation.
<static> | JXG.getCSSTransformMatrix(obj) Scaling CSS transformations applied to the div element containing the JSXGraph constructions are determined.
<static> | JXG.getDimensions(elementId, doc) Reads the width and height of an HTML element.
<static> | JXG.getOffset(obj) Calculates recursively the offset of the DOM element in which the board is stored.
<static> | JXG.getPosition(e, index, doc) Cross browser mouse / touch coordinates retrieval relative to the board's top left corner.
<static> | JXG.getProp(el, css) Reads css style sheets of a given element.
<static> <deprecated> | JXG.getRef(board, s) s may be a string containing the name or id of an element or even a reference to the element itself.
<static> <deprecated> | JXG.getReference(board, s) This is just a shortcut to JXG.getRef.
<static> | JXG.getStyle(obj, stylename) Access CSS style sheets.
<static> <deprecated> | JXG.hex2rgb(hex) Converts a valid HTML/CSS color string from the '#rrggbb' format into the 'rgb(r, g, b)' format.
<static> | JXG.hsv2rgb(H, S, V) Converts HSV color to RGB color.
<static> | JXG.indexOf(array, value, sub) Search an array for a given value.
<static> | JXG.isAndroid() Detects if the user is using an Android powered device.
<static> | JXG.isApple() Detects if the user is using a Apple iPad / iPhone.
<static> | JXG.isArray(v) Checks if a given variable references an array.
<static> | JXG.isFirefoxOS() Detects if the user is using a firefoxOS powered device.
<static> | JXG.isFunction(v) Checks if a given variable references a function.
<static> | JXG.isGroup(board, s) Checks if the given string is a group id within the given board.
<static> | JXG.isId(board, s) Checks if the given string is an id within the given board.
<static> | JXG.isInArray(arr, val) Checks if an array contains an element equal to `val` but does not check the type!
<static> | JXG.isInObject(obj, val) Checks if an object contains a key, whose value equals to val.
<static> | JXG.isMetroApp() Returns true if the run inside a Windows 8 "Metro" App.
<static> | JXG.isMozilla() Detects if the user is using a Mozilla browser
<static> | JXG.isName(board, s) Checks if the given string is a name within the given board.
<static> | JXG.isNode() True, if run inside a node.js environment.
<static> | JXG.isNumber(v) Checks if the value of a given variable is of type number.
<static> | JXG.isObject(v) Tests if the input variable is an Object
<static> | JXG.isPoint(v) Checks if a given variable is a reference of a JSXGraph Point element.
<static> | JXG.isPointType(board, v) Checks if a given variable is a reference of a JSXGraph Point element or an array of length at least two or a function returning an array of length two or three.
<static> | JXG.isString(v) Checks if the value of a given variable is of type string.
<static> | JXG.isTouchDevice() Determine if the current browser supports touch events
<static> | JXG.isTransformationOrArray(v) Checks if a given variable is a reference of a JSXGraph transformation element or an array of JSXGraph transformation elements.
<static> | JXG.isWebkitAndroid() Detects if the user is using the default Webkit browser on an Android powered device.
<static> | JXG.isWebkitApple() Detects if the user is using Safari on an Apple device.
<static> | JXG.isWebWorker() True if run inside a webworker environment.
<static> | JXG.keys(object, onlyOwn) Extracts the keys of a given object.
<static> | JXG.Legend(board, coords, attributes) Legend for chart
<static> | JXG.LMS2rgb(l, m, s) Convert color information from LMS to RGB color space.
<static> | JXG.merge(obj1, obj2) Recursively merges obj2 into obj1.
<static> | JXG.normalizePointFace(s) All point faces can be defined with more than one name, e.g.
<static> | JXG.providePoints(board, parents, attrClass, attrArray, attrArray) Test if the parents array contains existing points.
<static> | JXG.registerElement(element, creator) This registers a new construction element to JSXGraph for the construction via the JXG.Board.create interface.
<static> | JXG.registerReader(reader, ext) Register a file reader.
<static> | JXG.removeAllEvents(obj, type, owner) Removes all events of the given type from a given DOM node; Use with caution and do not use it on a container div of a JXG.Board because this might corrupt the event handling system.
<static> | JXG.removeElementFromArray(ar, el) Removes an element from the given array
<static> | JXG.removeEvent(obj, type, fn, owner) Removes an event listener from a DOM element.
<static> | JXG.rgb2bw(color) Decolorizes the given color.
<static> | JXG.rgb2cb(color, deficiency) Converts a color into how a colorblind human approximately would see it.
<static> | JXG.rgb2css(color, ag, ab) Converts a valid HTML/CSS color string into a string of the 'rgb(r, g, b)' format.
<static> | JXG.rgb2hex(color, ag, ab) Converts a valid HTML/CSS color string into a HTML rgb string.
<static> | JXG.rgb2hsv(color, ag, ab) Converts a color from the RGB color space into the HSV space.
<static> | JXG.rgb2LMS(color, ag, ab) Converts a color from the RGB color space into the LMS space.
<static> | JXG.rgba2rgbo(rgba) Splits a RGBA color value like #112233AA into it's RGB and opacity parts.
<static> | JXG.rgbo2rgba(rgb, o) Generates a RGBA color value like #112233AA from it's RGB and opacity parts.
<static> | JXG.rgbParser(color, ag, ab) Converts a valid HTML/CSS color string into a rgb value array.
<static> | JXG.sanitizeHTML(str, caja)
<static> | JXG.shortcut(object, fun) Creates a shortcut to a method, e.g.
<static> | JXG.str2Bool(s) Converts a string containing either true or false into a boolean value.
<static> | JXG.supportsCanvas() Detect browser support for Canvas.
<static> | JXG.supportsPointerEvents() Checks if the environments supports the W3C Pointer Events API http://www.w3.org/Submission/pointer-events/
<static> | JXG.supportsSVG() Detect browser support for SVG.
<static> | JXG.supportsVML() Detect browser support for VML.
<static> | JXG.swap(arr, i, j) Swaps to array elements.
<static> | JXG.timedChunk(items, process, context, callback) Process data in timed chunks.
<static> | JXG.toFixed(num, precision) Replacement of the default toFixed() method.
<static> | JXG.toJSON(obj, noquote) Converts a JavaScript object into a JSON string.
<static> | JXG.trim(str) Remove all leading and trailing whitespaces from a given string.
<static> | JXG.trimNumber(str) Make numbers given as strings nicer by removing all unnecessary leading and trailing zeroes.
<static> | JXG.trunc(n, p) Truncate a number `n` after `p` decimals.
<static> | JXG.unescapeHTML(str) Eliminates all substrings enclosed by < and > and replaces all occurences of &amp; by &, &gt; by >, and &lt; by <.
<static> | JXG.uniqueArray(arr) Generates a copy of an array and removes the duplicate entries.
<static> | JXG.useBlackWhiteOptions(board) Converts all color values to greyscale and calls useStandardOption to put them onto the board.
<static> | JXG.useStandardOptions(board) Apply the options stored in this object to all objects on the given board.
<static> | JXG.warn(warning) Outputs a warning via console.warn(), if available.

Namespace Detail
JXG
JSXGraph namespace. Holds all classes, objects, functions and variables belonging to JSXGraph to reduce the risk of interfering with other JavaScript code.
Field Detail
<static> {Object} JXG.boards
Store a reference to every board in this central list. This will at some point replace JXG.JSXGraph.boards.
Defined in: jxg.js.

<static> {Object} JXG.elements
Associative array that keeps track of all constructable elements registered via JXG.JSXGraph.registerElement.
Defined in: jxg.js.

<static> {Boolean} JXG.exists
Checks if a given variable is neither undefined nor null. You should not use this together with global variables!
Defined in: type.js.

<static> JXG.FileReader
The FileReader object bundles the file input capabilities of JSXGraph.
Defined in: file.js.

<static> {Number} JXG.ieVersion
Internet Explorer version. Works only for IE > 4.
Defined in: env.js.

<static> {Boolean} JXG.isBrowser
A document/window environment is available.
Defined in: env.js.

Default Value:
  false

<static> {String} JXG.licenseText
The small gray version indicator in the top left corner of every JSXGraph board (if showCopyright is not set to false on board creation).
Defined in: constants.js.

<static> {Object} JXG.readers
Store the available file readers in this structure.
Defined in: jxg.js.

<static> JXG.touchProperty
Determines the property that stores the relevant information in the event object.
Defined in: env.js.

Default Value:
  'touches'

<static> JXG.Validator
Holds all possible properties and the according validators for geometry elements. A validator is either a function which takes one parameter and returns true, if the value is valid for the property, or it is false if no validator is required.
Defined in: options.js.

<static> JXG.version
Represents the currently used JSXGraph version.
Defined in: constants.js.
Method Detail
<private> <static> {Number} JXG._ceil10(value, exp)
"Ceil" a number to given number of decimal digits. Example: JXG._toFixed(3.14159, -2) gives 3.15
Defined in: type.js.

Parameters:
{Number} value
  Number to be ceiled
{Number} exp
  Number of decimal digits given as negative exponent

Returns:
  {Number} "Ceiled" number.

<private> <static> {Number} JXG._decimalAdjust(type, value, exp)
Decimal adjustment of a number. From https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Math/round
Defined in: type.js.

Parameters:
{String} type
  The type of adjustment.
{Number} value
  The number.
{Number} exp
  The exponent (the 10 logarithm of the adjustment base).

Returns:
  {Number} The adjusted value.

<private> <static> {Number} JXG._floor10(value, exp)
"Floor" a number to given number of decimal digits. Example: JXG._toFixed(3.14159, -2) gives 3.14
Defined in: type.js.

Parameters:
{Number} value
  Number to be floored
{Number} exp
  Number of decimal digits given as negative exponent

Returns:
  {Number} "Floored" number.

<private> <static> {Number} JXG._round10(value, exp)
Round a number to given number of decimal digits. Example: JXG._toFixed(3.14159, -2) gives 3.14
Defined in: type.js.

Parameters:
{Number} value
  Number to be rounded
{Number} exp
  Number of decimal digits given as negative exponent

Returns:
  {Number} Rounded number.

<static> JXG.addEvent(obj, type, fn, owner)
Adds an event listener to a DOM element.
Defined in: env.js.

Parameters:
{Object} obj
  Reference to a DOM node.
{String} type
  The event to catch, without leading 'on', e.g. 'mousemove' instead of 'onmousemove'.
{Function} fn
  The function to call when the event is triggered.
{Object} owner
  The scope in which the event trigger is called.

<static> {Number} JXG.autoDigits(val)
Truncate a number `val` automatically.
Defined in: type.js.

Parameters:
val

Returns:
  {Number}

<static> {String} JXG.autoHighlight(color)
Determines highlight color to a given color. Done by reducing (or increasing) the opacity,
Defined in: color.js.

Parameters:
{String} color
  HTML RGBA string containing the HTML color code.

Returns:
  {String} Returns a HTML RGBA color string

<static> {Function} JXG.bind(fn, owner)
Generates a function which calls the function fn in the scope of owner.
Defined in: type.js.

Parameters:
{Function} fn
  Function to call.
{Object} owner
  Scope in which fn is executed.

Returns:
  {Function} A function with the same signature as fn.

<static> {String} JXG.capitalize(str)
Makes a string lower case except for the first character which will be upper case.
Defined in: type.js.

Parameters:
{String} str
  Arbitrary string

Returns:
  {String} The capitalized string.

<static> JXG.Chart(board, parents, attributes)
Chart plotting
Defined in: chart.js.

Parameters:
board
parents
attributes

<static> {GeometryElement} JXG.clearVisPropOld(el)
Resets visPropOld.
Defined in: type.js.

Parameters:
{JXG.GeometryElement} el

Returns:
  {GeometryElement}

<static> {Object} JXG.clone(obj)
This outputs an object with a base class reference to the given object. This is useful if you need a copy of an e.g. attributes object and want to overwrite some of the attributes without changing the original object.
Defined in: type.js.

Parameters:
{Object} obj
  Object to be embedded.

Returns:
  {Object} An object with a base class reference to `obj`.

<static> {Object} JXG.cloneAndCopy(obj, obj2)
Embeds an existing object into another one just like #clone and copies the contents of the second object to the new one. Warning: The copied properties of obj2 are just flat copies.
Defined in: type.js.

Parameters:
{Object} obj
  Object to be copied.
{Object} obj2
  Object with data that is to be copied to the new one as well.

Returns:
  {Object} Copy of given object including some new/overwritten data from obj2.

<static> {Boolean} JXG.cmpArrays(a1, a2)
Compare two arrays.
Defined in: type.js.

Parameters:
{Array} a1
{Array} a2

Returns:
  {Boolean} `true`, if the arrays coefficients are of same type and value.

<static> {Array} JXG.coordsArrayToMatrix(coords, split)
Converts an array of JXG.Coords objects into a coordinate matrix.
Defined in: type.js.

Parameters:
{Array} coords
{Boolean} split

Returns:
  {Array}

<static> {Object} JXG.copyAttributes(attributes, options, s)
Generates an attributes object that is filled with default values from the Options object and overwritten by the user specified attributes.
Defined in: type.js.

Parameters:
{Object} attributes
  user specified attributes
{Object} options
  defaults options
{String} s
  variable number of strings, e.g. 'slider', subtype 'point1'.

Returns:
  {Object} The resulting attributes object

<private> <static> {String} JXG.copyPrototypeMethods(subObj, superObj, constructorName)
Copy all prototype methods from object "superObject" to object "subObject". The constructor of superObject will be available in subObject as subObject.constructor[constructorName].
Defined in: type.js.

Parameters:
{Object} subObj
  A JavaScript object which receives new methods.
{Object} superObj
  A JavaScript object which lends its prototype methods to subObject
constructorName

Returns:
  {String} constructorName Under this name the constructor of superObj will be available in subObject.

<static> {Function} JXG.createEvalFunction(board, param, n)
Convert a String, a number or a function into a function. This method is used in Transformation.js
Defined in: type.js.

Parameters:
{JXG.Board} board
  Reference to a JSXGraph board. It is required to resolve dependencies given by a GEONEXT string, thus it must be a valid reference only in case one of the param values is of type string.
{Array} param
  An array containing strings, numbers, or functions.
{Number} n
  Length of `param`.

Returns:
  {Function} A function taking one parameter k which specifies the index of the param element to evaluate.

<static> {Function} JXG.createFunction(term, board, variableName, evalGeonext)
Convert a String, number or function into a function.
Defined in: type.js.

Parameters:
{String|Number|Function} term
  A variable of type string, function or number.
{JXG.Board} board
  Reference to a JSXGraph board. It is required to resolve dependencies given by a GEONEXT string, thus it must be a valid reference only in case one of the param values is of type string.
{String} variableName
  Only required if evalGeonext is set to true. Describes the variable name of the variable in a GEONEXT string given as term.
{Boolean} evalGeonext Optional, Default: true
  Set this true, if term should be treated as a GEONEXT string.

Returns:
  {Function} A function evaluation the value given by term or null if term is not of type string, function or number.

<static> JXG.createHTMLSlider(board, parents, attributes)
[[x,y], [w px, h px], [range]
Defined in: text.js.

Parameters:
board
parents
attributes

<static> JXG.debug(s)
Add something to the debug log. If available a JavaScript debug console is used. Otherwise we're looking for a HTML div with id "debug". If this doesn't exist, too, the output is omitted.
Defined in: jxg.js.

Parameters:
s
  An arbitrary number of parameters.

See:
  JXG#debugWST
  JXG#debugLine
  JXG#debugInt

<static> JXG.debugInt(s)
Add something to the debug log. If available a JavaScript debug console is used. Otherwise we're looking for a HTML div with id "debug". If this doesn't exist, too, the output is omitted.
Defined in: jxg.js.

Parameters:
s
  An arbitrary number of parameters.

See:
  JXG#debugWST

<static> JXG.debugWST(s)
Add something to the debug log. If available a JavaScript debug console is used. Otherwise we're looking for a HTML div with id "debug". If this doesn't exist, too, the output is omitted. This method adds a stack trace (if available).
Defined in: jxg.js.

Parameters:
s
  An arbitrary number of parameters.

See:
  JXG#debug

<static> {Object} JXG.deepCopy(obj, obj2, toLower)
Creates a deep copy of an existing object, i.e. arrays or sub-objects are copied component resp. element-wise instead of just copying the reference. If a second object is supplied, the two objects are merged into one object. The properties of the second object have priority.
Defined in: type.js.

Parameters:
{Object} obj
  This object will be copied.
{Object} obj2
  This object will merged into the newly created object
{Boolean} toLower Optional, Default: false
  If true the keys are convert to lower case. This is needed for visProp, see JXG#copyAttributes

Returns:
  {Object} copy of obj or merge of obj and obj2.

<static> JXG.def(v, d)
Handle default parameters.
Defined in: type.js.

Parameters:
v
  Given value
d
  Default value

Returns:
  `d`, if `v` is undefined or null.

<static> JXG.deprecated(what, replacement)
This method issues a warning to the developer that the given function is deprecated and, if available, offers an alternative to the deprecated function.
Defined in: jxg.js.

Parameters:
{String} what
  Describes the function that is deprecated
{String} replacement Optional
  The replacement that should be used instead.

<static> {Array} JXG.eliminateDuplicates(a)
Eliminates duplicate entries in an array consisting of numbers and strings.
Defined in: type.js.

Parameters:
{Array} a
  An array of numbers and/or strings.

Returns:
  {Array} The array with duplicate entries eliminated.

<static> {String} JXG.escapeHTML(str)
Replaces all occurences of & by &amp;, > by &gt;, and < by &lt;.
Defined in: type.js.

Parameters:
{String} str

Returns:
  {String}

<static> {*} JXG.evalSlider(s)
If `s` is a slider, it returns the sliders value, otherwise it just returns the given value.
Defined in: type.js.

Parameters:
{*} s

Returns:
  {*} s.Value() if s is an element of type slider, s otherwise

<static> JXG.evaluate(val)
If `val` is a function, it will be evaluated without giving any parameters, else the input value is just returned.
Defined in: type.js.

Parameters:
val
  Could be anything. Preferably a number or a function.

Returns:
  If `val` is a function, it is evaluated and the result is returned. Otherwise `val` is returned.

<static> {Array} JXG.filterElements(list, filter)
Filter an array of elements.
Defined in: type.js.

Parameters:
{Array} list
{Object|function} filter

Returns:
  {Array}

<static> {Object} JXG.getBoardByContainerId(s)
s may be the string containing the id of an HTML tag that hosts a JSXGraph board. This function returns the reference to the board.
Defined in: jxg.js.

Parameters:
{String} s
  String of an HTML tag that hosts a JSXGraph board

Returns:
  {Object} Reference to the board or null.

<static> {Array} JXG.getCSSTransform(cPos, obj)
Correct position of upper left corner in case of a CSS transformation. Here, only translations are extracted. All scaling transformations are corrected in JXG.Board#getMousePosition.
Defined in: env.js.

Parameters:
{Array} cPos
  Previously determined position
{Object} obj
  A DOM element

Returns:
  {Array} The corrected position.

<static> {Array} JXG.getCSSTransformMatrix(obj)
Scaling CSS transformations applied to the div element containing the JSXGraph constructions are determined. In IE prior to 9, 'rotate', 'skew', 'skewX', 'skewY' are not supported.
Defined in: env.js.

Parameters:
obj

Returns:
  {Array} 3x3 transformation matrix without translation part. See JXG.Board#updateCSSTransforms.

<static> {Object} JXG.getDimensions(elementId, doc)
Reads the width and height of an HTML element.
Defined in: env.js.

Parameters:
{String} elementId
  The HTML id of an HTML DOM node.
doc

Returns:
  {Object} An object with the two properties width and height.

<static> {Array} JXG.getOffset(obj)
Calculates recursively the offset of the DOM element in which the board is stored.
Defined in: env.js.

Parameters:
{Object} obj
  A DOM element

Returns:
  {Array} An array with the elements left and top offset.

<static> {Array} JXG.getPosition(e, index, doc)
Cross browser mouse / touch coordinates retrieval relative to the board's top left corner.
Defined in: env.js.

Parameters:
{Object} e Optional
  The browsers event object. If omitted, `window.event` will be used.
{Number} index Optional
  If `e` is a touch event, this provides the index of the touch coordinates, i.e. it determines which finger.
{Object} doc Optional
  The document object.

Returns:
  {Array} Contains the position as x,y-coordinates in the first resp. second component.

<static> {number} JXG.getProp(el, css)
Reads css style sheets of a given element. This method is a getStyle wrapper and defaults the read value to `0` if it can't be parsed as an integer value.
Defined in: env.js.

Parameters:
{DOMElement} el
{string} css

Returns:
  {number}

<static> {Object} JXG.getRef(board, s)
s may be a string containing the name or id of an element or even a reference to the element itself. This function returns a reference to the element. Search order: id, name.
Defined in: jxg.js.

Parameters:
{JXG.Board} board
  Reference to the board the element belongs to.
{String} s
  String or reference to a JSXGraph element.

Deprecated:
Use JXG.Board#select

Returns:
  {Object} Reference to the object given in parameter object

<static> JXG.getReference(board, s)
This is just a shortcut to JXG.getRef.
Defined in: jxg.js.

Parameters:
board
s

Deprecated:
Use JXG.Board#select.

<static> JXG.getStyle(obj, stylename)
Access CSS style sheets.
Defined in: env.js.

Parameters:
{Object} obj
  A DOM element
{String} stylename
  The CSS property to read.

Returns:
  The value of the CSS property and `undefined` if it is not set.

<static> {String} JXG.hex2rgb(hex)
Converts a valid HTML/CSS color string from the '#rrggbb' format into the 'rgb(r, g, b)' format.
Defined in: color.js.

Parameters:
{String} hex
  A valid HTML or CSS styled color value, e.g. '#12ab21', '#abc', or 'black'

Deprecated:
Use JXG#rgb2css instead.

Returns:
  {String} A 'rgb(r, g, b)' formatted string

<static> {String} JXG.hsv2rgb(H, S, V)
Converts HSV color to RGB color. Based on C Code in "Computer Graphics -- Principles and Practice," Foley et al, 1996, p. 593. See also http://www.efg2.com/Lab/Graphics/Colors/HSV.htm
Defined in: color.js.

Parameters:
{Number} H
  value between 0 and 360
{Number} S
  value between 0.0 (shade of gray) to 1.0 (pure color)
{Number} V
  value between 0.0 (black) to 1.0 (white)

Returns:
  {String} RGB color string

<static> {Number} JXG.indexOf(array, value, sub)
Search an array for a given value.
Defined in: type.js.

Parameters:
{Array} array
value
{String} sub Optional
  Use this property if the elements of the array are objects.

Returns:
  {Number} The index of the first appearance of the given value, or `-1` if the value was not found.

<static> {Boolean} JXG.isAndroid()
Detects if the user is using an Android powered device.
Defined in: env.js.

Returns:
  {Boolean}

<static> {Boolean} JXG.isApple()
Detects if the user is using a Apple iPad / iPhone.
Defined in: env.js.

Returns:
  {Boolean}

<static> {Boolean} JXG.isArray(v)
Checks if a given variable references an array.
Defined in: type.js.

Parameters:
v
  A variable of any type.

Returns:
  {Boolean} True, if v is of type array.

<static> {Boolean} JXG.isFirefoxOS()
Detects if the user is using a firefoxOS powered device.
Defined in: env.js.

Returns:
  {Boolean}

<static> {Boolean} JXG.isFunction(v)
Checks if a given variable references a function.
Defined in: type.js.

Parameters:
v
  A variable of any type.

Returns:
  {Boolean} True, if v is a function.

<static> {Boolean} JXG.isGroup(board, s)
Checks if the given string is a group id within the given board.
Defined in: type.js.

Parameters:
{JXG.Board} board
{String} s

Returns:
  {Boolean}

<static> {Boolean} JXG.isId(board, s)
Checks if the given string is an id within the given board.
Defined in: type.js.

Parameters:
{JXG.Board} board
{String} s

Returns:
  {Boolean}

<static> {Boolean} JXG.isInArray(arr, val)
Checks if an array contains an element equal to `val` but does not check the type!
Defined in: type.js.

Parameters:
{Array} arr
val

Returns:
  {Boolean}

<static> {Boolean} JXG.isInObject(obj, val)
Checks if an object contains a key, whose value equals to val.
Defined in: type.js.

Parameters:
{Object} obj
val

Returns:
  {Boolean}

<static> {Boolean} JXG.isMetroApp()
Returns true if the run inside a Windows 8 "Metro" App.
Defined in: env.js.

Returns:
  {Boolean}

<static> {Boolean} JXG.isMozilla()
Detects if the user is using a Mozilla browser
Defined in: env.js.

Returns:
  {Boolean}

<static> {Boolean} JXG.isName(board, s)
Checks if the given string is a name within the given board.
Defined in: type.js.

Parameters:
{JXG.Board} board
{String} s

Returns:
  {Boolean}

<static> {Boolean} JXG.isNode()
True, if run inside a node.js environment.
Defined in: env.js.

Returns:
  {Boolean}

<static> {Boolean} JXG.isNumber(v)
Checks if the value of a given variable is of type number.
Defined in: type.js.

Parameters:
v
  A variable of any type.

Returns:
  {Boolean} True, if v is of type number.

<static> JXG.isObject(v)
Tests if the input variable is an Object
Defined in: type.js.

Parameters:
v

<static> {Boolean} JXG.isPoint(v)
Checks if a given variable is a reference of a JSXGraph Point element.
Defined in: type.js.

Parameters:
v
  A variable of any type.

Returns:
  {Boolean} True, if v is of type JXG.Point.

<static> {Boolean} JXG.isPointType(board, v)
Checks if a given variable is a reference of a JSXGraph Point element or an array of length at least two or a function returning an array of length two or three.
Defined in: type.js.

Parameters:
{JXG.Board} board
v
  A variable of any type.

Returns:
  {Boolean} True, if v is of type JXG.Point.

<static> {Boolean} JXG.isString(v)
Checks if the value of a given variable is of type string.
Defined in: type.js.

Parameters:
v
  A variable of any type.

Returns:
  {Boolean} True, if v is of type string.

<static> {Boolean} JXG.isTouchDevice()
Determine if the current browser supports touch events
Defined in: env.js.

Returns:
  {Boolean} True, if the browser supports touch events.

<static> {Boolean} JXG.isTransformationOrArray(v)
Checks if a given variable is a reference of a JSXGraph transformation element or an array of JSXGraph transformation elements.
Defined in: type.js.

Parameters:
v
  A variable of any type.

Returns:
  {Boolean} True, if v is of type JXG.Transformation.

<static> {Boolean} JXG.isWebkitAndroid()
Detects if the user is using the default Webkit browser on an Android powered device.
Defined in: env.js.

Returns:
  {Boolean}

<static> {Boolean} JXG.isWebkitApple()
Detects if the user is using Safari on an Apple device.
Defined in: env.js.

Returns:
  {Boolean}

<static> {Boolean} JXG.isWebWorker()
True if run inside a webworker environment.
Defined in: env.js.

Returns:
  {Boolean}

<static> {Array} JXG.keys(object, onlyOwn)
Extracts the keys of a given object.
Defined in: type.js.

Parameters:
object
  The object the keys are to be extracted
onlyOwn
  If true, hasOwnProperty() is used to verify that only keys are collected the object owns itself and not some other object in the prototype chain.

Returns:
  {Array} All keys of the given object.

<static> JXG.Legend(board, coords, attributes)
Legend for chart
Defined in: chart.js.

Parameters:
board
coords
attributes

<static> {Array} JXG.LMS2rgb(l, m, s)
Convert color information from LMS to RGB color space.
Defined in: color.js.

Parameters:
{Number} l
{Number} m
{Number} s

Returns:
  {Array} Contains the r, g, and b value in this order.

<static> {Object} JXG.merge(obj1, obj2)
Recursively merges obj2 into obj1. Contrary to JXG#deepCopy this won't create a new object but instead will overwrite obj1.
Defined in: type.js.

Parameters:
{Object} obj1
{Object} obj2

Returns:
  {Object}

<static> {String} JXG.normalizePointFace(s)
All point faces can be defined with more than one name, e.g. a cross faced point can be given by face equal to 'cross' or equal to 'x'. This method maps all possible values to fixed ones to simplify if- and switch-clauses regarding point faces. The translation table is as follows:

Input | Output
--- | ---
cross, x | x
circle, o | o
square, [] | []
plus, + | +
diamond, <> | <>
triangleup, a, ^ | A
triangledown, v | v
triangleleft, < | <
triangleright, > | >

Defined in: options.js.

Parameters:
{String} s
  A string which should determine a valid point face.

Returns:
  {String} Returns a normalized string or undefined if the given string is not a valid point face.

<static> {Array} JXG.providePoints(board, parents, attrClass, attrArray, attrArray)
Test if the parents array contains existing points. If instead parents contains coordinate arrays or function returning coordinate arrays free points with these coordinates are created.
Defined in: type.js.

Parameters:
{JXG.Board} board
  Board object
{Array} parents
  Array containing parent elements for a new object. This array may contain
  - JXG.Point objects
  - JXG.Element#name of JXG.Point objects
  - JXG.Element#id of JXG.Point objects
  - Coordinates of points given as array of numbers of length two or three, e.g. [2, 3].
  - Coordinates of points given as array of functions of length two or three. Each function returns one coordinate, e.g. [function(){ return 2; }, function(){ return 3; }]
  - Function returning coordinates, e.g. function() { return [2, 3]; }
  In the last three cases a new point will be created.
{String} attrClass
  Main attribute class of newly created points, see JXG@copyAttributes
{Array} attrArray
  List of subtype attributes for the newly created points. The list of subtypes is mapped to the list of new points.
attrArray

Returns:
  {Array} List of newly created JXG.Point elements or false if not all returned elements are points.

<static> JXG.registerElement(element, creator)
This registers a new construction element to JSXGraph for the construction via the JXG.Board.create interface.
Defined in: jxg.js.

Parameters:
{String} element
  The elements name. This is case-insensitive, existing elements with the same name will be overwritten.
{Function} creator
  A reference to a function taking three parameters: First the board, the element is to be created on, a parent element array, and an attributes object. See JXG.createPoint or any other `JXG.create...` function for an example.

<static> JXG.registerReader(reader, ext)
Register a file reader.
Defined in: jxg.js.

Parameters:
{function} reader
  A file reader. This object has to provide two methods: `prepareString()` and `read()`.
{Array} ext

<static> JXG.removeAllEvents(obj, type, owner)
Removes all events of the given type from a given DOM node; Use with caution and do not use it on a container div of a JXG.Board because this might corrupt the event handling system.
Defined in: env.js.

Parameters:
{Object} obj
  Reference to a DOM node.
{String} type
  The event to catch, without leading 'on', e.g. 'mousemove' instead of 'onmousemove'.
{Object} owner
  The scope in which the event trigger is called.

<static> {Array} JXG.removeElementFromArray(ar, el)
Removes an element from the given array
Defined in: type.js.

Parameters:
{Array} ar
el

Returns:
  {Array}

<static> JXG.removeEvent(obj, type, fn, owner)
Removes an event listener from a DOM element.
Defined in: env.js.

Parameters:
{Object} obj
  Reference to a DOM node.
{String} type
  The event to catch, without leading 'on', e.g. 'mousemove' instead of 'onmousemove'.
{Function} fn
  The function to call when the event is triggered.
{Object} owner
  The scope in which the event trigger is called.

<static> {String} JXG.rgb2bw(color)
Decolorizes the given color.
Defined in: color.js.

Parameters:
{String} color
  HTML string containing the HTML color code.

Returns:
  {String} Returns a HTML color string

<static> {String} JXG.rgb2cb(color, deficiency)
Converts a color into how a colorblind human approximately would see it.
Defined in: color.js.

Parameters:
{String} color
  HTML string containing the HTML color code.
{String} deficiency
  The type of color blindness. Possible options are protanopia, deuteranopia, and tritanopia.

Returns:
  {String} Returns a HTML color string

<static> {String} JXG.rgb2css(color, ag, ab)
Converts a valid HTML/CSS color string into a string of the 'rgb(r, g, b)' format.
Defined in: color.js.

Parameters:
{String|Array|Number} color
  A valid HTML or CSS styled color value, e.g. '#12ab21', '#abc', 'black', or 'rgb(12, 132, 233)'. This can also be an array containing three color values either from 0.0 to 1.0 or from 0 to 255. They will be interpreted as red, green, and blue values. In case this is a number this method expects the parameters ag and ab.
{Number} ag
{Number} ab

Returns:
  {String} A 'rgb(r, g, b)' formatted string

<static> {String} JXG.rgb2hex(color, ag, ab)
Converts a valid HTML/CSS color string into a HTML rgb string.
Defined in: color.js.

Parameters:
{String|Array|Number} color
  A valid HTML or CSS styled color value, e.g. '#12ab21', '#abc', 'black', or 'rgb(12, 132, 233)'. This can also be an array containing three color values either from 0.0 to 1.0 or from 0 to 255. They will be interpreted as red, green, and blue values. In case this is a number this method expects the parameters ag and ab.
{Number} ag
{Number} ab

Returns:
  {String} A '#rrggbb' formatted string

<static> {Array} JXG.rgb2hsv(color, ag, ab)
Converts a color from the RGB color space into the HSV space. Input can be any valid HTML/CSS color definition.
Defined in: color.js.

Parameters:
{String|Array|Number} color
  A valid HTML or CSS styled color value, e.g. '#12ab21', '#abc', 'black', or 'rgb(12, 132, 233)'. This can also be an array containing three color values either from 0.0 to 1.0 or from 0 to 255. They will be interpreted as red, green, and blue values. In case this is a number this method expects the parameters ag and ab.
{Number} ag
{Number} ab

Returns:
  {Array} Contains the h, s, and v value in this order.

See:
  http://zach.in.tu-clausthal.de/teaching/cg1_0708/folien/13_color_3_4up.pdf

<static> {Array} JXG.rgb2LMS(color, ag, ab)
Converts a color from the RGB color space into the LMS space. Input can be any valid HTML/CSS color definition.
Defined in: color.js.

Parameters:
{String|Array|Number} color
  A valid HTML or CSS styled color value, e.g. '#12ab21', '#abc', 'black', or 'rgb(12, 132, 233)'. This can also be an array containing three color values either from 0.0 to 1.0 or from 0 to 255. They will be interpreted as red, green, and blue values. In case this is a number this method expects the parameters ag and ab.
{Number} ag
{Number} ab

Returns:
  {Array} Contains the l, m, and s value in this order.

<static> {Array} JXG.rgba2rgbo(rgba)
Splits a RGBA color value like #112233AA into it's RGB and opacity parts.
Defined in: color.js.

Parameters:
{String} rgba
  A RGBA color value

Returns:
  {Array} An array containing the rgb color value in the first and the opacity in the second field.

<static> {String} JXG.rgbo2rgba(rgb, o)
Generates a RGBA color value like #112233AA from it's RGB and opacity parts.
Defined in: color.js.

Parameters:
{String} rgb
  A RGB color value.
{Number} o
  The desired opacity >=0, <=1.

Returns:
  {String} The RGBA color value.

<static> {Array} JXG.rgbParser(color, ag, ab)
Converts a valid HTML/CSS color string into a rgb value array. This is the base function for the following wrapper functions which only adjust the output to different flavors like an object, string or hex values.
Defined in: color.js.

Parameters:
{String|Array|Number} color
  A valid HTML or CSS styled color value, e.g. '#12ab21', '#abc', 'black', or 'rgb(12, 132, 233)'. This can also be an array containing three color values either from 0.0 to 1.0 or from 0 to 255. They will be interpreted as red, green, and blue values. In case this is a number this method expects the parameters ag and ab.
{Number} ag
{Number} ab

Returns:
  {Array} RGB color values as an array [r, g, b] with values ranging from 0 to 255.

<static> {String} JXG.sanitizeHTML(str, caja)
Defined in: type.js.

Parameters:
{String} str
{Boolean} caja

Returns:
  {String} Sanitized string

<static> {Function} JXG.shortcut(object, fun)
Creates a shortcut to a method, e.g. JXG.Board#createElement is a shortcut to JXG.Board#create. Sometimes the target is undefined by the time you want to define the shortcut so we need this little helper.
Defined in: jxg.js.

Parameters:
{Object} object
  The object the method we want to create a shortcut for belongs to.
{String} fun
  The method we want to create a shortcut for.

Returns:
  {Function} A function that calls the given method.

<static> {Boolean} JXG.str2Bool(s)
Converts a string containing either true or false into a boolean value.
Defined in: type.js.

Parameters:
{String} s
  String containing either true or false.

Returns:
  {Boolean} String typed boolean value converted to boolean.

<static> {Boolean} JXG.supportsCanvas()
Detect browser support for Canvas.
Defined in: env.js.

Returns:
  {Boolean} True, if the browser supports HTML canvas.

<static> {Boolean} JXG.supportsPointerEvents()
Checks if the environments supports the W3C Pointer Events API http://www.w3.org/Submission/pointer-events/
Defined in: env.js.

Returns:
  {Boolean}

<static> {Boolean} JXG.supportsSVG()
Detect browser support for SVG.
Defined in: env.js.

Returns:
  {Boolean} True, if the browser supports SVG.

<static> {Boolean} JXG.supportsVML()
Detect browser support for VML.
Defined in: env.js.

Returns:
  {Boolean} True, if the browser supports VML.

<static> {Array} JXG.swap(arr, i, j)
Swaps to array elements.
Defined in: type.js.

Parameters:
{Array} arr
{Number} i
{Number} j

Returns:
  {Array} Reference to the given array.

<static> JXG.timedChunk(items, process, context, callback)
Process data in timed chunks. Data which takes long to process, either because it is such a huge amount of data or the processing takes some time, causes warnings in browsers about irresponsive scripts. To prevent these warnings, the processing is split into smaller pieces called chunks which will be processed in serial order. Copyright 2009 Nicholas C. Zakas. All rights reserved. MIT Licensed
Defined in: env.js.

Parameters:
{Array} items
  to do
{Function} process
  Function that is applied for every array item
{Object} context
  The scope of function process
{Function} callback
  This function is called after the last array element has been processed.

<static> {String} JXG.toFixed(num, precision)
Replacement of the default toFixed() method. It does a correct rounding (independent of the browser) and returns "0.00" for toFixed(-0.000001, 2) instead of "-0.00" which is returned by JavaScript's toFixed()
Defined in: type.js.

Parameters:
{Number} num
  Number tp be rounded
{Number} precision
  Decimal digits

Returns:
  {String} Rounded number is returned as string

<static> {String} JXG.toJSON(obj, noquote)
Converts a JavaScript object into a JSON string.
Defined in: type.js.

Parameters:
{Object} obj
  A JavaScript object, functions will be ignored.
{Boolean} noquote Optional, Default: false
  No quotes around the name of a property.

Returns:
  {String} The given object stored in a JSON string.

<static> {String} JXG.trim(str)
Remove all leading and trailing whitespaces from a given string.
Defined in: type.js.

Parameters:
{String} str

Returns:
  {String}

<static> {String} JXG.trimNumber(str)
Make numbers given as strings nicer by removing all unnecessary leading and trailing zeroes.
Defined in: type.js.

Parameters:
{String} str

Returns:
  {String}

<static> {Number} JXG.trunc(n, p)
Truncate a number `n` after `p` decimals.
Defined in: type.js.

Parameters:
{Number} n
{Number} p

Returns:
  {Number}

<static> {String} JXG.unescapeHTML(str)
Eliminates all substrings enclosed by < and > and replaces all occurences of &amp; by &, &gt; by >, and &lt; by <.
Defined in: type.js.

Parameters:
{String} str

Returns:
  {String}

<static> {Array} JXG.uniqueArray(arr)
Generates a copy of an array and removes the duplicate entries. The original Array will be altered.
Defined in: type.js.

Parameters:
{Array} arr

Returns:
  {Array}

<static> JXG.useBlackWhiteOptions(board)
Converts all color values to greyscale and calls useStandardOption to put them onto the board.
Defined in: options.js.

Parameters:
{JXG.Board} board
  The board to which objects the options will be applied.

See:
  #useStandardOptions

<static> JXG.useStandardOptions(board)
Apply the options stored in this object to all objects on the given board.
Defined in: options.js.

Parameters:
{JXG.Board} board
  The board to which objects the options will be applied.

<static> JXG.warn(warning)
Outputs a warning via console.warn(), if available. If console.warn() is unavailable this function will look for an HTML element with the id 'warning' and append the warning to this element's innerHTML.
Defined in: jxg.js.

Parameters:
{String} warning
  The warning text