Class Index | File Index

Elements

Classes


Element Text

JXG.GeometryElement
      ↳ Text

This element is used to provide a constructor for text, which is just a wrapper for element Text.

Defined in: text.js.
Extends JXG.GeometryElement.

Element Summary
Constructor Attributes Constructor Name and Description
 
Attributes Summary
Field Attributes Field Name and Description
 
The horizontal alignment of the text.
 
The vertical alignment of the text.
 
The precision of the slider value displayed in the optional text.
 
Used to round texts given by a number.
 
Determines the rendering method of the text.
 
The font size in pixels.
 
The precision of the slider value displayed in the optional text.
 
If enabled, the text will be handled as label.
 
If set to
 
If true the input will be given to ASCIIMathML before rendering.
 
If set to true and caja's sanitizeHTML function can be found it will be used to sanitize text output.
 
If true MathJax will be used to render the input string.
Methods borrowed from class JXG.GeometryElement:
_set, addChild, addDescendants, addRotation, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getTextAnchor, getType, hasPoint, hideElement, labelColor, noHighlight, normalize, off, on, prepareUpdate, remove, removeChild, removeDescendants, resolveShortcuts, setArrow, setAttribute, setDash, setLabelText, showElement, triggerEventHandlers, update, updateRenderer
Events borrowed from class JXG.GeometryElement:
attribute, attribute:<attribute><attribute>, down, drag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, touchdown, touchdrag, touchup, up
Element Detail
Text
This element has no direct constructor. To create an instance of this element you have to call JXG.Board#create with type "text".

Possible parent array combinations are:
{number|function} x
{number|function} y
{String|function} str

Parent elements for text elements.

x and y are the coordinates of the lower left corner of the text box. The position of the text is fixed, x and y are numbers. The position is variable if x or y are functions.

The text to display may be given as string or as function returning a string. There is the attribute 'display' which takes the values 'html' or 'internal'. In case of 'html' a HTML division tag is created to display the text. In this case it is also possible to use ASCIIMathML. Incase of 'internal', a SVG or VML text element is used to display the text.



See:
JXG.Text
Examples:
// Create a fixed text at position [0,1].
  var t1 = board.create('text',[0,1,"Hello World"]);
0
5
0
5
Hello World

				
				
// Create a variable text at a variable position.
  var s = board.create('slider',[[0,4],[3,4],[-2,0,2]]);
  var graph = board.create('text',
                       [function(x){ return s.Value();}, 1,
                        function(){return "The value of s is"+s.Value().toFixed(2);}
                       ]
                    );
0
5
0
5
0.00
The value of s is 0.00

				
                
Attribute Detail
{String} anchorX
The horizontal alignment of the text. Possible values include 'left', 'middle', and 'right'.
Defined in: options.js.
Default Value:
'left'

{String} anchorY
The vertical alignment of the text. Possible values include 'top', 'middle', and 'bottom'.
Defined in: options.js.
Default Value:
'middle'

{String} cssClass
The precision of the slider value displayed in the optional text.
Defined in: options.js.

{Number} digits
Used to round texts given by a number.
Defined in: options.js.
Default Value:
2

{String} display
Determines the rendering method of the text. Possible values include 'html' and 'internal.
Defined in: options.js.
Default Value:
'html'

{Number} fontSize
The font size in pixels.
Defined in: options.js.
Default Value:
12

{String} highlightCssClass
The precision of the slider value displayed in the optional text.
Defined in: options.js.

{Boolean} isLabel
If enabled, the text will be handled as label. Intended for internal use.
Defined in: options.js.
Default Value:
false

{Boolean} parse
If set to
Defined in: options.js.
Default Value:
true

{Boolean} useASCIIMathML
If true the input will be given to ASCIIMathML before rendering.
Defined in: options.js.
Default Value:
false

{Boolean} useCaja
If set to true and caja's sanitizeHTML function can be found it will be used to sanitize text output.
Defined in: options.js.
Default Value:
false

{Boolean} useMathJax
If true MathJax will be used to render the input string..
Defined in: options.js.
Default Value:
false

Attributes borrowed from other Elements
Attributes borrowed from class JXG.GeometryElement:
dash, draft, fillColor, fillOpacity, fixed, frozen, highlight, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, needsRegularUpdate, scalable, shadow, snapToGrid, strokeColor, strokeOpacity, strokeWidth, trace, traceAttributes, visible, withLabel

Fields borrowed from other Elements
Fields borrowed from class JXG.GeometryElement:
_pos, addEvent, ancestors, baseElement, board, childElements, descendants, dump, elementClass, elType, eventHandlers, getProperty, hasLabel, highlighted, id, isDraggable, isReal, lastDragTime, methodMap, mouseover, name, needsUpdate, notExistingParents, numTraces, quadraticform, removeEvent, rendNode, setProperty, stdform, subs, symbolic, traces, transformations, type, visProp

Methods borrowed from other Elements
Methods borrowed from class JXG.GeometryElement:
_set, addChild, addDescendants, addRotation, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getTextAnchor, getType, hasPoint, hideElement, labelColor, noHighlight, normalize, off, on, prepareUpdate, remove, removeChild, removeDescendants, resolveShortcuts, setArrow, setAttribute, setDash, setLabelText, showElement, triggerEventHandlers, update, updateRenderer

Events borrowed from other Elements
Events borrowed from class JXG.GeometryElement:
attribute, attribute:<attribute><attribute>, down, drag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, touchdown, touchdrag, touchup, up
Documentation generated by JsDoc Toolkit 2.4.0 on Fri Sep 27 2013 11:32:45 GMT+0200 (CEST)