# JSXGraph 1.7.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

Classes

- _global_
- Angle
- Arc
- Arrow
- Arrowparallel
- Axis
- Bisector
- Bisectorlines
- Boxplot
- Button
- Cardinalspline
- Chart
- Checkbox
- Circle
- 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
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.Board.infobox
- JXG.C
- JXG.CA
- JXG.CanvasRenderer
- JXG.Chart
- JXG.Circle
- 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.PrefixParser
- JXG.Server
- JXG.Server.modules
- JXG.Surface3D
- JXG.SVGRenderer
- JXG.Text
- JXG.Ticks
- JXG.Transformation
- JXG.Turtle
- JXG.Util
- JXG.Util.Base64
- JXG.Util.Unzip
- JXG.Util.UTF8
- JXG.View3D
- JXG.VMLRenderer
- JXG.XML
- Label
- Legend
- Line
- Line3D
- Locus
- MajorArc
- MajorSector
- Measurement
- 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
- Spline
- Stepfunction
- Tangent
- Tapemeasure
- Text
- Ticks
- Tracecurve
- Transformation
- Turtle
- Vectorfield
- Vectorfield3D
- View3D

# Namespace JXG

↳ JXG

Defined in: jxg.js.

Namespace Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG JXG is the top object of JSXGraph and defines the namespace

Field Summary
Field Attributes | Field Name and Description
--- | ---
<static> | JXG.boards Store a reference to every board in this central list.
<static> | JXG.COORDS_BY_SCREEN Constant: screen coordinates in pixel relative to the upper left corner of the div element.
<static> | JXG.COORDS_BY_USER Constant: user coordinates relative to the coordinates system defined by the bounding box.
<static> | JXG.elements Associative array that keeps track of all constructable elements registered via JXG.registerElement.
<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 Constant: 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.palette Default color palette.
<static> | JXG.paletteWong Bang Wong color palette, optimized for various type of color blindness.
<static> | JXG.readers Store the available file readers in this structure.
<private> <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 Constant: 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, options) 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.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.contrast(hexColor, darkColor, lightColor, threshold) Calculate whether a light or a dark color is needed as a contrast.
<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.debugLine(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.defineConstant(object, name, value, ignoreRedefine) Set a constant `name` in `object` to `value`.
<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.exists(v, checkEmptyString) Checks if a given variable is neither undefined nor null.
<static> | JXG.extend(object, extension, onlyOwn, toLower) Copy all properties of the `extension` object to `object`.
<static> | JXG.extendConstants(object, constants, onlyOwn, toUpper) Copy all properties of the `constants` object in `object` as a constant.
<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.getNumberOfTouchPoints(evt) Determines the number of touch points in a touch event.
<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 / pointer / touch coordinates retrieval relative to the documents'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.isBoard(v) Checks if the given object is an JSXGraph board.
<static> | JXG.isDocumentOrFragment(v) Tests if the input variable is a DOM Document or DocumentFragment node
<static> | JXG.isEmpty(v) Checks if v is an empty object or empty.
<static> | JXG.isFirefoxOS() Detects if the user is using a firefoxOS powered device.
<static> | JXG.isFirstTouch(evt) Checks whether an mouse, pointer or touch event evt is the first event of a multitouch event.
<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.isMouseEvent(evt) Determines whether evt is neither a touch event nor a pointer event.
<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, acceptStringNumber, acceptNaN) 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.isPointerEvent(evt) Determines whether evt is a pointer event.
<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.isTouchEvent(evt) Determines whether evt is a touch event.
<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.LMS2rgb(l, m, s) Convert color information from LMS to RGB color space.
<static> | JXG.merge(obj1, obj2) Recursively merges obj2 into obj1 in-place.
<static> | JXG.mergeAttr(attr, special, toLower) In-place (deep) merging of attributes.
<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.providePoints3D(view, 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) Convert HTML tags to entities or use html_sanitize if the google caja html sanitizer is available.
<private> <static> | JXG.scaleJSXGraphDiv(wrap_id, inner_id, doc, scale) Scale and vertically shift a DOM element (usually a JSXGraph div) inside of a parent DOM element which is set to fullscreen.
<static> | JXG.setClassicColors() Use the color scheme of JSXGraph up to version 1.3.2.
<static> | JXG.shortcut(object, fun) Creates a shortcut to a method, e.g.
<static> | JXG.stack2jsxgraph(str) Convert a string containing a MAXIMA /STACK expression into a JSXGraph / JessieCode string or an array of JSXGraph / JessieCode strings.
<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.supportsES6() Features of ECMAScript 6+ are available.
<static> | JXG.supportsPointerEvents() Checks if the environments supports the W3C Pointer Events API https://www.w3.org/TR/pointerevents/
<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, digits) 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
JXG is the top object of JSXGraph and defines the namespace
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.

<static> {Number} JXG.COORDS_BY_SCREEN
Constant: screen coordinates in pixel relative to the upper left corner of the div element.
Defined in: constants.js.

<static> {Number} JXG.COORDS_BY_USER
Constant: user coordinates relative to the coordinates system defined by the bounding box.
Defined in: constants.js.

<static> {Object} JXG.elements
Associative array that keeps track of all constructable elements registered via JXG.registerElement.

<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
Constant: 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.palette
Default color palette. Contains at least color values for

- black
- blue
- green
- purple
- red
- white
- yellow

Defined in: color.js.

    var p = board.create('line', [[-1, 1], [2, -3]], {strokeColor: JXG.palette.yellow});

See:
  JXG.paletteWong

Default Value:
  JXG.paletteWong

<static> {Object} JXG.paletteWong
Bang Wong color palette, optimized for various type of color blindness. It contains values for

- 'black'
- 'orange'
- 'skyblue'
- 'bluishgreen'
- 'yellow'
- 'darkblue'
- 'vermillion'
- 'reddishpurple'

As substitutes for standard colors, it contains the following aliases:

- black (= #000000)
- blue (= darkblue)
- green (= bluishgreen)
- purple (= reddishpurple)
- red (= vermillion)
- white (= #ffffff)

See Bang Wong: "Points of view: Color blindness" and https://davidmathlogic.com/colorblind/.
Defined in: color.js.

    var p = board.create('line', [[-1, 1], [2, -3]], {strokeColor: JXG.paletteWong.yellow});

See:
  JXG.palette

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

<private> <static> {String} 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> {String} JXG.version
Constant: 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, options)
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.
{Object|Boolean} options Optional, Default: false
  This parameter is passed as the third parameter to the method addEventListener. Depending on the data type it is either an options object or the useCapture Boolean.

<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> {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> {String} JXG.contrast(hexColor, darkColor, lightColor, threshold)
Calculate whether a light or a dark color is needed as a contrast. Especially useful to determine whether white or black font goes better with a given background color.
Defined in: color.js.

Parameters:
{String} hexColor
  HEX value of color.
{String} darkColor Optional, Default: "#000000"
  HEX string for a dark color.
{String} lightColor Optional, Default: "#ffffff"
  HEX string for a light color.
{Number} threshold Optional, Default: 8

Returns:
  {String} Returns darkColor or lightColor.

<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 JessieCode 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 JessieCode/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 function is supplied as JessieCode string or evalGeonext is set to true. Describes the variable name of the variable in a JessieCode/GEONEXT string given as term.
{Boolean} evalGeonext Optional, Default: false
  Obsolete and ignored! Set this true if term should be treated as a GEONEXT string.

Returns:
  {Function} A function evaluating 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.

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.

Parameters:
s
  An arbitrary number of parameters.

See:
  JXG#debugWST

<static> JXG.debugLine(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 line of the stack trace (if available).

Parameters:
s
  An arbitrary number of parameters.

See:
  JXG#debug

<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).

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.defineConstant(object, name, value, ignoreRedefine)
Set a constant `name` in `object` to `value`. The value can't be changed after declaration.

Parameters:
{Object} object
{String} name
{Number|String|Boolean} value
{Boolean} ignoreRedefine
  This should be left at its default: false.

<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.

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> {Boolean} JXG.exists(v, checkEmptyString)
Checks if a given variable is neither undefined nor null. You should not use this together with global variables!
Defined in: type.js.

Parameters:
v
  A variable of any type.
{Boolean} checkEmptyString Optional, Default: false
  If set to true, it is also checked whether v is not equal to ''.

Returns:
  {Boolean} True, if v is neither undefined nor null.

<static> JXG.extend(object, extension, onlyOwn, toLower)
Copy all properties of the `extension` object to `object`.

Parameters:
{Object} object
{Object} extension
{Boolean} onlyOwn Optional, Default: false
  Only consider properties that belong to extension itself, not any inherited properties.
{Boolean} toLower Optional, Default: false
  If true the keys are convert to lower case. This is needed for visProp, see JXG#copyAttributes

<static> JXG.extendConstants(object, constants, onlyOwn, toUpper)
Copy all properties of the `constants` object in `object` as a constant.

Parameters:
{Object} object
{Object} constants
{Boolean} onlyOwn Optional, Default: false
  Only consider properties that belong to extension itself, not any inherited properties.
{Boolean} toUpper Optional, Default: false
  If true the keys are convert to lower case. This is needed for visProp, see JXG#copyAttributes

<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.

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|Object} elementId
  id of or reference to an HTML DOM node.
doc

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

<static> {Number} JXG.getNumberOfTouchPoints(evt)
Determines the number of touch points in a touch event. For other events, -1 is returned.
Defined in: env.js.

Parameters:
evt
  {Event}

Returns:
  {Number}

<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 / pointer / touch coordinates retrieval relative to the documents's top left corner. This method might be a bit outdated today, since pointer events and clientX/Y are omnipresent.
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.

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.

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 https://www.had2know.org/technology/hsv-rgb-conversion-formula-calculator.html
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.isBoard(v)
Checks if the given object is an JSXGraph board.
Defined in: type.js.

Parameters:
{Object} v

Returns:
  {Boolean}

<static> JXG.isDocumentOrFragment(v)
Tests if the input variable is a DOM Document or DocumentFragment node
Defined in: type.js.

Parameters:
v
  A variable of any type

<static> {boolean} JXG.isEmpty(v)
Checks if v is an empty object or empty.
Defined in: type.js.

Parameters:
v
  {Object|Array}

Returns:
  {boolean} True, if v is an empty object or array.

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

Returns:
  {Boolean}

<static> {boolean} JXG.isFirstTouch(evt)
Checks whether an mouse, pointer or touch event evt is the first event of a multitouch event. Attention: When two or more pointer device types are being used concurrently, it is only checked whether the passed event is the first one of its type!
Defined in: env.js.

Parameters:
evt
  {Event}

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.isMouseEvent(evt)
Determines whether evt is neither a touch event nor a pointer event.
Defined in: env.js.

Parameters:
evt
  {Event}

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, acceptStringNumber, acceptNaN)
Checks if the value of a given variable is of type number.
Defined in: type.js.

Parameters:
v
  A variable of any type.
{Boolean} acceptStringNumber Optional, Default: false
  If set to true, the function returns true for e.g. v='3.1415'.
{Boolean} acceptNaN Optional, Default: true
  If set to false, the function returns false for v=NaN.

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.isPointerEvent(evt)
Determines whether evt is a pointer event.
Defined in: env.js.

Parameters:
evt
  {Event}

Returns:
  {Boolean}

<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.isTouchEvent(evt)
Determines whether evt is a touch event.
Defined in: env.js.

Parameters:
evt
  {Event}

Returns:
  {Boolean}

<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> {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 in-place. Contrary to JXG#deepCopy this won't create a new object but instead will overwrite obj1.

In contrast to method JXG.mergeAttr, merge recurses into any kind of object, e.g. DOM object and JSXGraph objects. So, please be careful.
Defined in: type.js.

Parameters:
{Object} obj1
{Object} obj2

Returns:
  {Object}

See:
  JXG#mergeAttr

Examples:

    JXG.Options = JXG.merge(JXG.Options, {
        board: {
            showNavigation: false,
            showInfobox: true
        },
        point: {
            face: 'o',
            size: 4,
            fillColor: '#eeeeee',
            highlightFillColor: '#eeeeee',
            strokeColor: 'white',
            highlightStrokeColor: 'white',
            showInfobox: 'inherit'
        }
    });

<static> JXG.mergeAttr(attr, special, toLower)
In-place (deep) merging of attributes. Allows attributes like `{shadow: {enabled: true...}}`

In contrast to method JXG.merge, mergeAttr does not recurse into DOM objects and JSXGraph objects. Instead handles (pointers) to these objects are used.
Defined in: type.js.

Parameters:
{Object} attr
  Object with attributes - usually containing default options
{Object} special
  Special option values which overwrite (recursively) the default options
{Boolean} toLower Optional, Default: true
  If true the keys are converted to lower case.

See:
  JXG#merge

<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
circle | o
square, [] | []
plus | +
minus | -
divide | |
diamond | <>
triangleup | ^, a, A
triangledown | 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.GeometryElement#name of JXG.Point objects
  - JXG.GeometryElement#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> {Array} JXG.providePoints3D(view, 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.View3D} view
  View3D object
{Array} parents
  Array containing parent elements for a new object. This array may contain
  - JXG.Point3D objects
  - JXG.GeometryElement#name of JXG.Point3D objects
  - JXG.GeometryElement#id of JXG.Point3D objects
  - Coordinates of 3D points given as array of numbers of length three, e.g. [2, 3, 1].
  - Coordinates of 3D points given as array of functions of length three. Each function returns one coordinate, e.g. [function(){ return 2; }, function(){ return 3; }, function(){ return 1; }]
  - Function returning coordinates, e.g. function() { return [2, 3, 1]; }
  In the last three cases a new 3D point will be created.
{String} attrClass
  Main attribute class of newly created 3D points, see JXG#copyAttributes
{Array} attrArray
  List of subtype attributes for the newly created 3D points. The list of subtypes is mapped to the list of new 3D points.
attrArray

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

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

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.

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:
  https://www.had2know.org/technology/hsv-rgb-conversion-formula-calculator.html

<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)
Convert HTML tags to entities or use html_sanitize if the google caja html sanitizer is available.
Defined in: type.js.

Parameters:
{String} str
{Boolean} caja

Returns:
  {String} Sanitized string

<private> <static> JXG.scaleJSXGraphDiv(wrap_id, inner_id, doc, scale)
Scale and vertically shift a DOM element (usually a JSXGraph div) inside of a parent DOM element which is set to fullscreen. This is realized with a CSS transformation.
Defined in: env.js.

Parameters:
{String} wrap_id
  id of the parent DOM element which is in fullscreen mode
{String} inner_id
  id of the DOM element which is scaled and shifted
{Object} doc
  document object or shadow root
{Number} scale
  Relative size of the JSXGraph board in the fullscreen window.

See:
  JXG.Board#toFullscreen
  JXG.Board#fullscreenListener

<static> JXG.setClassicColors()
Use the color scheme of JSXGraph up to version 1.3.2. This method has to be called before JXG.JSXGraph.initBoard();
Defined in: color.js.

See:
  JXG.palette
  JXG.paletteWong

Examples:

    JXG.setClassicColors();
    var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-5, 5, 5,-5]});

<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.

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> JXG.stack2jsxgraph(str)
Convert a string containing a MAXIMA /STACK expression into a JSXGraph / JessieCode string or an array of JSXGraph / JessieCode strings.
Defined in: type.js.

Parameters:
{String} str

Returns:
  String

Examples:

    console.log( JXG.stack2jsxgraph("%e**x") );
    // Output:
    //    "EULER**x"

    console.log( JXG.stack2jsxgraph("[%pi*(x**2 - 1), %phi*(x - 1), %gamma*(x+1)]") );
    // Output:
    //    [ "PI*(x**2 - 1)", "1.618033988749895*(x - 1)", "0.5772156649015329*(x+1)" ]

<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.supportsES6()
Features of ECMAScript 6+ are available.
Defined in: env.js.

<static> {Boolean} JXG.supportsPointerEvents()
Checks if the environments supports the W3C Pointer Events API https://www.w3.org/TR/pointerevents/
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, digits)
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} digits
  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.

Parameters:
{String} warning
  The warning text

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Feb 14 2024 15:53:28 GMT+0100 (heure normale d’Europe centrale)