Namespace JXG
↳ JXG
Defined in: loadjsxgraph.js.
Constructor Attributes | Constructor Name and Description |
---|---|
JSXGraph namespace.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
JXG.elements
Contains pointers to the various subelements of the chart.
|
<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.getRef
This is just a shortcut to JXG.getReference.
|
<static> |
JXG.ieVersion
Internet Explorer version.
|
<static> |
JXG.Options
Options Namespace
These are the default options of the board and of all geometry elements.
|
<static> |
JXG.Validator
Holds all possible properties and the according validators for geometry elements.
|
Method Attributes | Method Name and Description |
---|---|
<private> <static> |
JXG._board(box, attributes)
Shortcut for JXG.JSXGraph.initBoard.
|
<static> |
JXG.addEvent(obj, type, fn, owner)
Adds an event listener to a DOM element.
|
<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> <deprecated> |
JXG.checkAttributes(attributes, defaults)
Checks an attributes object and fills it with default values if there are properties missing.
|
<static> |
JXG.checkParents(element, parents, expects)
Checks given parents array against several expectations.
|
<static> |
JXG.clearVisPropOld(el)
Resets visPropOld of el
|
<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.copyAttributes(attributes, options, %)
Generates an attributes object that is filled with default values from the Options object
and overwritten by the user speciified attributes.
|
<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.createGroup(board, parents, attributes)
Groups points.
|
<static> |
JXG.createSpline(board, parents, attributes)
TODO
Create a dynamic spline interpolated curve given by sample points p_1 to p_n.
|
<static> |
JXG.createTurtle(board, parents, attributs)
Creates a new turtle
|
<static> |
JXG.debug(An)
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.eliminateDuplicates(a)
Eliminates duplicate entries in an array.
|
<static> |
JXG.escapeHTML(str)
Replaces all occurences of & by &, > by >, and < by <.
|
<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.extend(object, extension, onlyOwn, toLower)
Copy all properties of the extension object to object.
|
<static> |
JXG.getDimensions(elementId)
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)
Cross browser mouse / touch coordinates retrieval relative to the board's top left corner.
|
<static> |
JXG.getReference(board, s)
s may be a string containing the name or id of an element or even a reference
to the element itself.
|
<static> |
JXG.getStyle(obj, stylename)
Access CSS style sheets.
|
<static> |
JXG.hsv2rgb(H, S, V)
Converts HSV color to RGB color.
|
<static> |
JXG.indexOf(array, value)
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.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.isName(board, s)
Checks if the given string is a name within the given board.
|
<static> |
JXG.isNumber(v)
Checks if the value of a given variable is of type number.
|
<static> |
JXG.isPoint(v)
Checks if a given variable is a reference of a JSXGraph Point element.
|
<static> |
JXG.isString(v)
Checks if the value of a given variable is of type string.
|
<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.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.readOption(options, element, key)
Reads the configuration parameter of an attribute of an element from a JXG.Options object
|
<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()
Returns output of JXG.rgbParser as a CSS styled rgb() string.
|
<static> |
JXG.rgb2hex()
Returns array returned by JXG.rgbParser as a HTML rgb string.
|
<static> |
JXG.rgb2hsv(r, g, b)
Converts r, g, b color to h, s, v.
|
<static> |
JXG.rgb2LMS(r, g, b)
Convert RGB color information to LMS color 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()
Converts a valid HTML/CSS color string into a rgb value array.
|
<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.supportsSVG()
Detect browser support for SVG.
|
<static> |
JXG.supportsVML()
Detect browser support for VML.
|
<static> |
JXG.timedChunk(items, process, context, callback)
Process data in timed chunks.
|
<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
& by &, > by >, and < by <.
|
<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.
|
Namespace Detail
JXG
JSXGraph namespace. Holds all classes, objects, functions and variables belonging to JSXGraph
to reduce the risc of interfering with other JavaScript code.
Field Detail
<static>
JXG.elements
Contains pointers to the various subelements of the chart.
Defined in: Chart.js.
Defined in: Chart.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: JXG.js.
Defined in: JXG.js.
<static>
JXG.FileReader
The FileReader object bundles the file input capabilities of JSXGraph.
Defined in: FileReader.js.
Defined in: FileReader.js.
<static>
JXG.getRef
<static>
{Number}
JXG.ieVersion
Internet Explorer version. Works only for IE > 4.
Defined in: JXG.js.
Defined in: JXG.js.
<static>
JXG.Options
Options Namespace
These are the default options of the board and of all geometry elements.
Defined in: Options.js.
Defined in: Options.js.
<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.
Defined in: Options.js.
Method Detail
<private> <static>
JXG._board(box, attributes)
- Parameters:
- box
- attributes
<static>
JXG.addEvent(obj, type, fn, owner)
Adds an event listener to a DOM element.
Defined in: JXG.js.
Defined in: JXG.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>
{Function}
JXG.bind(fn, owner)
Generates a function which calls the function fn in the scope of owner.
Defined in: JXG.js.
Defined in: JXG.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: JXG.js.
Defined in: JXG.js.
- Parameters:
- {String} str
- Arbitrary string
- Returns:
- {String} The capitalized string.
<static>
JXG.Chart(board, parents, attributes)
Chart plotting
Defined in: Chart.js.
Defined in: Chart.js.
- Parameters:
- board
- parents
- attributes
<static>
{Object}
JXG.checkAttributes(attributes, defaults)
Checks an attributes object and fills it with default values if there are properties missing.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {Object} attributes
- {Object} defaults
- Deprecated:
- replaced by JXG#copyAttributes
- Returns:
- {Object} The given attributes object with missing properties added via the defaults object.
<static>
{Array}
JXG.checkParents(element, parents, expects)
Checks given parents array against several expectations.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {String} element
- The name of the element to be created
- {Array} parents
- A parents array
- {Array} expects
- Each possible parents array types combination is given as an array of element type constants containing the types or names of elements that are accepted and in what order they are accepted. Strings can be given for basic data types are number, string, array, function, object. We accept non element JSXGraph types like coords, too.
- Returns:
- {Array} A new parents array prepared for the use within a create* method
<static>
JXG.clearVisPropOld(el)
Resets visPropOld of el
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {JXG.GeometryElement} el
<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: JXG.js.
Defined in: JXG.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: JXG.js.
Defined in: JXG.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: JXG.js.
Defined in: JXG.js.
- Parameters:
- {Array} a1
- {Array} a2
- Returns:
- {Boolean} true, if the arrays coefficients are of same type and value.
<static>
{Object}
JXG.copyAttributes(attributes, options, %)
Generates an attributes object that is filled with default values from the Options object
and overwritten by the user speciified attributes.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {Object} attributes
- user specified attributes
- {Object} options
- defaults options
- {String} %
- variable number of strings, e.g. 'slider', subtype 'point1'.
- Returns:
- {Object} The resulting attributes object
<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: JXG.js.
Defined in: JXG.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: JXG.js.
Defined in: JXG.js.
- Parameters:
- 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
- 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.Group}
JXG.createGroup(board, parents, attributes)
Groups points.
Defined in: Group.js.
Defined in: Group.js.
- Parameters:
- {JXG.Board} board
- The board the points are on.
- {Array} parents
- Array of points to group.
- {Object} attributes
- Visual properties.
- Returns:
- An object of type JXG.Group.
<static>
{JXG.Curve}
JXG.createSpline(board, parents, attributes)
TODO
Create a dynamic spline interpolated curve given by sample points p_1 to p_n.
Defined in: Curve.js.
Defined in: Curve.js.
- Parameters:
- {JXG.Board} board
- Reference to the board the spline is drawn on.
- {Array} parents
- Array of points the spline interpolates
- {Object} attributes
- Define color, width, ... of the spline
- Returns:
- Returns reference to an object of type JXG.Curve.
<static>
{JXG.Turtle}
JXG.createTurtle(board, parents, attributs)
Creates a new turtle
Defined in: Turtle.js.
Defined in: Turtle.js.
- Parameters:
- {JXG.Board} board
- The board the turtle is put on.
- {Array} parents
- {Object} attributs
- Object containing properties for the element such as stroke-color and visibility. See JXG.GeometryElement#setProperty
- Returns:
- Reference to the created turtle object.
<static>
JXG.debug(An)
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.
Defined in: JXG.js.
- Parameters:
- {%} An
- arbitrary number of parameters.
<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: JXG.js.
Defined in: JXG.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: JXG.js.
Defined in: JXG.js.
- Parameters:
- {%} v
- Given value
- {%} d
- Default value
- Returns:
- {%} d, if v is undefined or null.
<static>
{Array}
JXG.eliminateDuplicates(a)
Eliminates duplicate entries in an array.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {Array} a
- An array
- Returns:
- {Array} The array with duplicate entries eliminated.
<static>
JXG.escapeHTML(str)
Replaces all occurences of & by &, > by >, and < by <.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- str
<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: JXG.js.
Defined in: JXG.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>
JXG.extend(object, extension, onlyOwn, toLower)
Copy all properties of the extension object to object.
Defined in: JXG.js.
Defined in: JXG.js.
- 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>
{Object}
JXG.getDimensions(elementId)
Reads the width and height of an HTML element.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {String} elementId
- The HTML id of an HTML DOM node.
- 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: JXG.js.
Defined in: JXG.js.
- Parameters:
- {Object} obj
- A DOM element
- Returns:
- {Array} An array with the elements left and top offset.
<static>
{Array}
JXG.getPosition(e, index)
Cross browser mouse / touch coordinates retrieval relative to the board's top left corner.
Defined in: JXG.js.
Defined in: JXG.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.
- Returns:
- {Array} Contains the position as x,y-coordinates in the first resp. second component.
<static>
{Object}
JXG.getReference(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.
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.
- Returns:
- {Object} Reference to the object given in parameter object
<static>
JXG.getStyle(obj, stylename)
Access CSS style sheets.
Defined in: JXG.js.
Defined in: JXG.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.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: RGBColor.js.
Defined in: RGBColor.js.
- Parameters:
- {float} H
- value between 0 and 360
- {float} S
- value between 0.0 (shade of gray) to 1.0 (pure color)
- {float} V
- value between 0.0 (black) to 1.0 (white)
- Returns:
- {string} RGB color string
<static>
{Number}
JXG.indexOf(array, value)
Search an array for a given value.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {Array} array
- {%} value
- 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: JXG.js.
Defined in: JXG.js.
- Returns:
- {Boolean}
<static>
{Boolean}
JXG.isApple()
Detects if the user is using a Apple iPad / iPhone.
Defined in: JXG.js.
Defined in: JXG.js.
- Returns:
- {Boolean}
<static>
{Boolean}
JXG.isArray(v)
Checks if a given variable references an array.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- v
- A variable of any type.
- Returns:
- {Boolean} True, if v is of type array.
<static>
{Boolean}
JXG.isFunction(v)
Checks if a given variable references a function.
Defined in: JXG.js.
Defined in: JXG.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: JXG.js.
Defined in: JXG.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: JXG.js.
Defined in: JXG.js.
- Parameters:
- {JXG.Board} board
- {String} s
- Returns:
- {Boolean}
<static>
{Boolean}
JXG.isName(board, s)
Checks if the given string is a name within the given board.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {JXG.Board} board
- {String} s
- Returns:
- {Boolean}
<static>
{Boolean}
JXG.isNumber(v)
Checks if the value of a given variable is of type number.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- v
- A variable of any type.
- Returns:
- {Boolean} True, if v is of type number.
<static>
{Boolean}
JXG.isPoint(v)
Checks if a given variable is a reference of a JSXGraph Point element.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- 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: JXG.js.
Defined in: JXG.js.
- Parameters:
- v
- A variable of any type.
- Returns:
- {Boolean} True, if v is of type string.
<static>
{Boolean}
JXG.isWebkitAndroid()
Detects if the user is using the default Webkit browser on an Android powered device.
Defined in: JXG.js.
Defined in: JXG.js.
- Returns:
- {Boolean}
<static>
{Boolean}
JXG.isWebkitApple()
Detects if the user is using Safari on an Apple device.
Defined in: JXG.js.
Defined in: JXG.js.
- Returns:
- {Boolean}
<static>
{Array}
JXG.keys(object, onlyOwn)
Extracts the keys of a given object.
Defined in: JXG.js.
Defined in: JXG.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.
Defined in: Chart.js.
- Parameters:
- board
- coords
- attributes
<static>
{Object}
JXG.LMS2rgb(l, m, s)
Convert color information from LMS to RGB color space.
Defined in: RGBColor.js.
Defined in: RGBColor.js.
- Parameters:
- {number} l
- Amount of l value.
- {number} m
- Amount of m value.
- {number} s
- Amount of s value.
- Returns:
- Hashmap containing the r, g, b values.
<static>
JXG.readOption(options, element, key)
Reads the configuration parameter of an attribute of an element from a JXG.Options object
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {JXG.Options} options
- Reference to an instance of JXG.Options. You usually want to use the options property of your board.
- {String} element
- The name of the element which options you wish to read, e.g. 'point' or 'elements' for general attributes.
- {String} key
- The name of the attribute to read, e.g. 'strokeColor' or 'withLabel'
- Returns:
- The value of the selected configuration parameter.
- See:
- JXG.Options
<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: JXG.js.
Defined in: JXG.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>
JXG.removeElementFromArray(ar, el)
Removes an element from the given array
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {Array} ar
- {%} el
<static>
JXG.removeEvent(obj, type, fn, owner)
Removes an event listener from a DOM element.
Defined in: JXG.js.
Defined in: JXG.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: RGBColor.js.
Defined in: RGBColor.js.
- Parameters:
- {String} color
- HTML string containing the HTML color code.
- Returns:
- 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: RGBColor.js.
Defined in: RGBColor.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:
- Returns a HTML color string
<static>
JXG.rgb2css()
Returns output of JXG.rgbParser as a CSS styled rgb() string.
Defined in: RGBColor.js.
Defined in: RGBColor.js.
<static>
JXG.rgb2hex()
Returns array returned by JXG.rgbParser as a HTML rgb string.
Defined in: RGBColor.js.
Defined in: RGBColor.js.
<static>
{Object}
JXG.rgb2hsv(r, g, b)
Converts r, g, b color to h, s, v.
See http://zach.in.tu-clausthal.de/teaching/cg1_0708/folien/13_color_3_4up.pdf for more information.
Defined in: RGBColor.js.
Defined in: RGBColor.js.
- Parameters:
- {number} r
- Amount of red in color. Number between 0 and 255.
- {number} g
- Amount of green. Number between 0 and 255.
- {number} b
- Amount of blue. Number between 0 and 255.
- Returns:
- Hashmap containing h,s, and v field.
<static>
{Object}
JXG.rgb2LMS(r, g, b)
Convert RGB color information to LMS color space.
Defined in: RGBColor.js.
Defined in: RGBColor.js.
- Parameters:
- {number} r
- Amount of red in color. Number between 0 and 255.
- {number} g
- Amount of green. Number between 0 and 255.
- {number} b
- Amount of blue. Number between 0 and 255.
- Returns:
- Hashmap containing the L, M, S cone values.
<static>
{Array}
JXG.rgba2rgbo(rgba)
Splits a RGBA color value like #112233AA into it's RGB and opacity parts.
Defined in: RGBColor.js.
Defined in: RGBColor.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: RGBColor.js.
Defined in: RGBColor.js.
- Parameters:
- {String} rgb
- A RGB color value.
- {Float} o
- The desired opacity >=0, <=1.
- Returns:
- {String} The RGBA color value.
<static>
{Array}
JXG.rgbParser()
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: RGBColor.js.
Defined in: RGBColor.js.
- Returns:
- {Array} RGB color values as an array [r, g, b] which component's are between 0 and 255.
<static>
{Function}
JXG.shortcut(object, fun)
Creates a shortcut to a method, e.g. JXG.Board#create is a shortcut to JXG.Board#createElement.
Sometimes the target is undefined by the time you want to define the shortcut so we need this little helper.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- {Object} object
- The object the method we want to create a shortcut for belongs to.
- {Function} 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: JXG.js.
Defined in: JXG.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: JXG.js.
Defined in: JXG.js.
- Returns:
- {Boolean} True, if the browser supports HTML canvas.
<static>
{Boolean}
JXG.supportsSVG()
Detect browser support for SVG.
Defined in: JXG.js.
Defined in: JXG.js.
- Returns:
- {Boolean} True, if the browser supports SVG.
<static>
{Boolean}
JXG.supportsVML()
Detect browser support for VML.
Defined in: JXG.js.
Defined in: JXG.js.
- Returns:
- {Boolean} True, if the browser supports VML.
<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: JXG.js.
Defined in: JXG.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.toJSON(obj, noquote)
Converts a JavaScript object into a JSON string.
Defined in: JXG.js.
Defined in: JXG.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: JXG.js.
Defined in: JXG.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: JXG.js.
Defined in: JXG.js.
- Parameters:
- {String} str
- Returns:
- {String}
<static>
{Number}
JXG.trunc(n, p)
Truncate a number n after p decimals.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- n
- p
- Returns:
- {Number}
<static>
JXG.unescapeHTML(str)
Eliminates all substrings enclosed by < and > and replaces all occurences of
& by &, > by >, and < by <.
Defined in: JXG.js.
Defined in: JXG.js.
- Parameters:
- str
<static>
JXG.useBlackWhiteOptions(board)
Converts all color values to greyscale and calls useStandardOption to put them onto the board.
Defined in: Options.js.
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.
Defined in: Options.js.
- Parameters:
- {JXG.Board} board
- The board to which objects the options will be applied.