API Docs for: 0.99.4
Show:

JXG.Board Class

Defined in: src/base/board.js:75
Module: JXG

Constructs a new Board object. JXG.Board controls all properties and methods used to manage a geonext board like managing geometric elements, managing mouse and touch events, etc. You probably don't want to use this constructor directly. Please use undefined to initialize a board.

Constructor

JXG.Board

(
  • container
  • renderer
  • id
  • origin
  • zoomX
  • zoomY
  • unitX
  • unitY
  • canvasWidth
  • canvasHeight
  • attributes
)

Parameters:

  • container String

    The id or reference of the HTML DOM element the board is drawn in. This is usually a HTML div.

  • renderer JXG.AbstractRenderer

    The reference of a renderer.

  • id String

    Unique identifier for the board, may be an empty string or null or even undefined.

  • origin JXG.Coords

    The coordinates where the origin is placed, in user coordinates.

  • zoomX Number

    Zoom factor in x-axis direction

  • zoomY Number

    Zoom factor in y-axis direction

  • unitX Number

    Units in x-axis direction

  • unitY Number

    Units in y-axis direction

  • canvasWidth Number

    The width of canvas

  • canvasHeight Number

    The height of canvas

  • attributes Object

    The attributes object given to {@link JXG.JSXGraph#initBoard}

Item Index

Methods

Methods

addAnimation

(
  • element
)
JXG.Board

Adds an animation. Animations are controlled by the boards, so the boards need to be aware of the animated elements. This function tells the board about new elements to animate.

Parameters:

Returns:

JXG.Board:

Reference to the board

addChild

(
  • board
)
JXG.Board

Adds a dependent board to this board.

Parameters:

  • board JXG.Board

    A reference to board which will be updated after an update of this board occured.

Returns:

JXG.Board:

Reference to the board

addConditions

(
  • str
)

Add conditional updates to the elements.

Parameters:

  • str String

    String containing coniditional update in geonext syntax

addEvent

()

Alias of undefined.

addEventHandlers

()

Add all possible event handlers to the board object

addGrid

() JXG.Board

Adds a grid to the board according to the settings given in board.options.

Returns:

JXG.Board:

Reference to the board.

addHook

(
  • hook
  • [m='update']
  • [context=board]
)
Number deprecated

Please use undefined instead.

Parameters:

  • hook Function

    A function to be called by the board after an update occured.

  • [m='update'] String optional

    When the hook is to be called. Possible values are mouseup, mousedown and update.

  • [context=board] Object optional

    Determines the execution context the hook is called. This parameter is optional, default is the board object the hook is attached to.

Returns:

Number:

Id of the hook, required to remove the hook from the board.

addMouseEventHandlers

()

Registers mouse move, down and wheel event handlers.

addPointerEventHandlers

()

Registers the MSPointer* event handlers.

addTouchEventHandlers

(
  • appleGestures
)

Register touch start and move and gesture start and change event handlers.

Parameters:

  • appleGestures Boolean

    If set to false the gesturestart and gesturechange event handlers will not be registered.

animate

() JXG.Board

General purpose animation function. This currently only supports moving points from one place to another. This is faster than managing the animation per point, especially if there is more than one animated point at the same time.

Returns:

JXG.Board:

Reference to the board

applyZoom

() JXG.Board

Apply update on all objects with the new zoom-factors. Clears all traces.

Returns:

JXG.Board:

Reference to the board.

calculateSnapSize

() JXG.Board

Calculates adequate snap sizes.

Returns:

JXG.Board:

Reference to the board.

clearTraces

() JXG.Board

Delete the elements drawn as part of a trace of an element.

Returns:

JXG.Board:

Reference to the board

clickDownArrow

() JXG.Board

Handler for click on down arrow in the navigation bar

Returns:

JXG.Board:

Reference to the board

clickLeftArrow

() JXG.Board

Handler for click on left arrow in the navigation bar

Returns:

JXG.Board:

Reference to the board

clickRightArrow

() JXG.Board

Handler for click on right arrow in the navigation bar

Returns:

JXG.Board:

Reference to the board

clickUpArrow

() JXG.Board

Handler for click on up arrow in the navigation bar

Returns:

JXG.Board:

Reference to the board

create

(
  • elementType
  • parents
  • [attributes]
)
Object

Creates a new geometric element of type elementType.

Parameters:

  • elementType String

    Type of the element to be constructed given as a string e.g. 'point' or 'circle'.

  • parents Array

    Array of parent elements needed to construct the element e.g. coordinates for a point or two points to construct a line. This highly depends on the elementType that is constructed. See the corresponding JXG.create* methods for a list of possible parameters.

  • [attributes] Object optional

    An object containing the attributes to be set. This also depends on the elementType. Common attributes are name, visible, strokeColor.

Returns:

Object:

Reference to the created element. This is usually a GeometryElement, but can be an array containing two or more elements.

createElement

() deprecated

Deprecated name for JXG.Board#create.

dehighlightAll

() JXG.Board

Remove highlighting of all elements.

Returns:

JXG.Board:

Reference to the board.

emulateColorblindness

(
  • deficiency
)
JXG.Board

Initializes color blindness simulation.

Parameters:

  • deficiency String

    Describes the color blindness deficiency which is simulated. Accepted values are 'protanopia', 'deuteranopia', and 'tritanopia'.

Returns:

JXG.Board:

Reference to the board

finalizeAdding

(
  • obj
)

After construction of the object the visibility is set and the label is constructed if necessary.

Parameters:

  • obj Object

    The object to add.

fullUpdate

() JXG.Board

Runs through all elements and calls their update() method and update the conditions. This is necessary after zooming and changing the bounding box.

Returns:

JXG.Board:

Reference to the board

generateId

() String

Generates unique id for a board. The result is randomly generated and prefixed with 'jxgBoard'.

Returns:

String:

Unique id for a board.

generateName

(
  • object
)
String

Generates an unique name for the given object. The result depends on the objects type, if the object is a JXG.Point, capital characters are used, if it is of type JXG.Line only lower case characters are used. If object is of type JXG.Polygon, a bunch of lower case characters prefixed with P_ are used. If object is of type JXG.Circle the name is generated using lower case characters. prefixed with k_ is used. In any other case, lower case chars prefixed with s_ is used.

Parameters:

  • object Object

    Reference of an JXG.GeometryElement that is to be named.

Returns:

String:

Unique name for the object.

gestureChangeListener

(
  • evt
)
Boolean

Triggered on iOS/Safari while the user inputs a gesture (e.g. pinch) and is used to zoom into the board. Only works on iOS/Safari.

Parameters:

  • evt Event

    Browser event object

Returns:

gestureStartListener

(
  • evt
)
Boolean

Called by iOS/Safari as soon as the user starts a gesture (only works on iOS/Safari).

Parameters:

Returns:

getAllObjectsUnderMouse

(
  • evt
)
Array

Collects all elements under current mouse position.

Parameters:

  • evt Event

    Event object containing the mouse coordinates.

Returns:

Array:

Array of elements at the current mouse position.

getAllUnderMouse

(
  • evt
)
Array

Collects all elements under current mouse position plus current user coordinates of mouse cursor.

Parameters:

  • evt Event

    Event object containing the mouse coordinates.

Returns:

Array:

Array of elements at the current mouse position plus current user coordinates of mouse.

getBoundingBox

() Array

Get the bounding box of the board.

Returns:

Array:

bounding box [x1,y1,x2,y2] upper left corner, lower right corner

getCoordsTopLeftCorner

() Array

Calculates mouse coordinates relative to the boards container.

Returns:

Array:

Array of coordinates relative the boards container top left corner.

getMousePosition

(
  • e
  • [i]
)
Array

Get the position of the mouse in screen coordinates, relative to the upper left corner of the host tag.

Parameters:

  • e Event

    Event object given by the browser.

  • [i] Number optional

    Only use in case of touch events. This determines which finger to use and should not be set for mouseevents.

Returns:

Array:

Contains the mouse coordinates in user coordinates, ready for {@link JXG.Coords}

getScrCoordsOfMouse

(
  • x
  • y
)
Array

Returns the input parameters in an array. This method looks pointless and it really is, but it had a purpose once.

Parameters:

  • x Number

    X coordinate in screen coordinates

  • y Number

    Y coordinate in screen coordinates

Returns:

Array:

Coordinates of the mouse in screen coordinates.

getUsrCoordsOfMouse

(
  • evt
)
Array

This method calculates the user coords of the current mouse coordinates.

Parameters:

  • evt Event

    Event object containing the mouse coordinates.

Returns:

Array:

Coordinates of the mouse in screen coordinates.

hasPoint

(
  • x
  • [y]
)
Boolean

Checks if the given point is inside the boundingbox.

Parameters:

  • x Number | JXG.Coords

    User coordinate or {@link JXG.Coords} object.

  • [y] Number optional

    User coordinate. May be omitted in case x is a {@link JXG.Coords} object.

Returns:

highlightcustomInfobox

(
  • text
  • [el]
)
JXG.Board

Changes the text of the info box to what is provided via text.

Parameters:

Returns:

JXG.Board:

Reference to the board.

highlightElements

(
  • x
  • y
  • evt
  • target
)

TODO

Parameters:

highlightInfobox

(
  • x
  • y
  • [el]
)
JXG.Board

Changes the text of the info box to show the given coordinates.

Parameters:

Returns:

JXG.Board:

Reference to the board.

initGeonextBoard

() JXG.Board

Initialize some objects which are contained in every GEONExT construction by default, but are not contained in the gxt files.

Returns:

JXG.Board:

Reference to the board

initInfobox

() JXG.Board

Initialize the info box object which is used to display the coordinates of points near the mouse pointer.

Returns:

JXG.Board:

Reference to the board

initMoveObject

(
  • x
  • y
  • evt
  • type
)
Array

Collects all elements below the current mouse pointer and fulfilling the following constraints:

  • isDraggable
  • visible
  • not fixed
  • not frozen

Parameters:

  • x Number

    Current mouse/touch coordinates

  • y Number

    current mouse/touch coordinates

  • evt Object

    An event object

  • type String

    What type of event? 'touch' or 'mouse'.

Returns:

Array:

A list of geometric elements.

initMoveOrigin

(
  • x
  • y
)

Initiate moving the origin. This is used in mouseDown and touchStart listeners.

Parameters:

  • x Number

    Current mouse/touch coordinates

  • y Number

    Current mouse/touch coordinates

migratePoint

(
  • src
  • dest
  • copyName
)
JXG.Board

Migrate the dependency properties of the point src to the point dest and delete the point src. For example, a circle around the point src receives the new center dest. The old center src will be deleted.

Parameters:

  • src JXG.Point

    Original point which will be deleted

  • dest JXG.Point

    New point with the dependencies of src.

  • copyName Boolean

    Flag which decides if the name of the src element is copied to the dest element.

Returns:

JXG.Board:

Reference to the board

mouseDownListener

(
  • evt
)
Boolean

This method is called by the browser when the mouse button is clicked.

Parameters:

  • evt Event

    The browsers event object.

Returns:

Boolean:

True if no element is found under the current mouse pointer, false otherwise.

mouseMoveListener

(
  • evt
)

This method is called by the browser when the mouse is moved.

Parameters:

  • evt Event

    The browsers event object.

mouseOriginMove

(
  • evt
)
Boolean

TODO

Parameters:

Returns:

mouseOriginMoveStart

(
  • evt
)
| Boolean

TODO

Parameters:

Returns:

| Boolean:

mouseUpListener

(
  • evt
)

This method is called by the browser when the mouse button is released.

Parameters:

mouseWheelListener

(
  • evt
)
Boolean

Handler for mouse wheel events. Used to zoom in and out of the board.

Parameters:

Returns:

moveObject

(
  • x
  • y
  • o
  • evt
  • type
)

Moves an object.

Parameters:

  • x Number

    Coordinate

  • y Number

    Coordinate

  • o Object

    The touch object that is dragged: {JXG.Board#mouse} or {JXG.Board#touches}.

  • evt Object

    The event object.

  • type String

    Mouse or touch event?

moveOrigin

(
  • x
  • y
  • [diff=false]
)
JXG.Board

Moves the origin and initializes an update of all elements.

Parameters:

Returns:

JXG.Board:

Reference to this board.

originMoveEnd

()

TODO

pointerDownListener

(
  • evt
  • object
)
Boolean

This method is called by the browser when a pointing device is pressed on the screen.

Parameters:

  • evt Event

    The browsers event object.

  • object Object

    If the object to be dragged is already known, it can be submitted via this parameter

Returns:

Boolean:

...

pointerMoveListener

(
  • evt
)
Boolean

Called periodically by the browser while the user moves a pointing device across the screen.

Parameters:

Returns:

pointerUpListener

(
  • evt
)
Boolean

Triggered as soon as the user stops touching the device with at least one finger.

Parameters:

Returns:

prepareUpdate

() JXG.Board

Sets for all objects the needsUpdate flag to "true".

Returns:

JXG.Board:

Reference to the board

removeAncestors

(
  • object
)
JXG.Board

Removes the ancestors of an object an the object itself from board and renderer.

Parameters:

Returns:

JXG.Board:

Reference to the board

removeChild

(
  • board
)
JXG.Board

Deletes a board from the list of dependent boards.

Parameters:

  • board JXG.Board

    Reference to the board which will be removed.

Returns:

JXG.Board:

Reference to the board

removeEvent

()

Alias of undefined.

removeEventHandlers

()

Remove all event handlers from the board object

removeGrids

() JXG.Board

Removes all grids assigned to this board. Warning: This method also removes all objects depending on one or more of the grids.

Returns:

JXG.Board:

Reference to the board object.

removeHook

(
  • id
)
JXG.Board deprecated

Please use undefined instead.

Parameters:

  • id Number | Function

    The number you got when you added the hook or a reference to the event handler.

Returns:

JXG.Board:

Reference to the board

removeMouseEventHandlers

()

De-register mouse event handlers.

removeObject

(
  • object
)
JXG.Board

Removes object from board and renderer.

Parameters:

Returns:

JXG.Board:

Reference to the board

removePointerEventHandlers

()

Remove MSPointer* Event handlers.

removeTouchEventHandlers

()

Remove all registered touch event handlers.

resizeContainer

(
  • canvasWidth
  • canvasHeight
  • [dontset=false]
  • [dontSetBoundingBox=false]
)
JXG.Board

Change the height and width of the board's container. After doing so, undefined is called using the actual size of the bounding box and the actual value of keepaspectratio. If setBoundingbox() should not be called automatically, call resizeContainer with dontSetBoundingBox == true.

Parameters:

  • canvasWidth Number

    New width of the container.

  • canvasHeight Number

    New height of the container.

  • [dontset=false] Boolean optional

    If true do not set the height of the DOM element.

  • [dontSetBoundingBox=false] Boolean optional

    If true do not call setBoundingBox().

Returns:

JXG.Board:

Reference to the board

Roulette

(
  • c1
  • c2
  • start_c1
  • stepsize
  • direction
  • time
  • pointlist
)

Function to animate a curve rolling on another curve.

Parameters:

  • c1 Curve

    JSXGraph curve building the floor where c2 rolls

  • c2 Curve

    JSXGraph curve which rolls on c1.

  • start_c1 Number

    The parameter t such that c1(t) touches c2. This is the start position of the rolling process

  • stepsize Number

    Increase in t in each step for the curve c1

  • direction Number
  • time Number

    Delay time for setInterval()

  • pointlist Array

    Array of points which are rolled in each step. This list should contain all points which define c2 and gliders on c2.

Example:

// Line which will be the floor to roll upon. var line = brd.create('curve', [function (t) { return t;}, function (t){ return 1;}], {strokeWidth:6}); // Center of the rolling circle var C = brd.create('point',[0,2],{name:'C'}); // Starting point of the rolling circle var P = brd.create('point',[0,1],{name:'P', trace:true}); // Circle defined as a curve. The circle "starts" at P, i.e. circle(0) = P var circle = brd.create('curve',[ function (t){var d = P.Dist(C), beta = JXG.Math.Geometry.rad([C.X()+1,C.Y()],C,P); t += beta; return C.X()+dMath.cos(t); }, function (t){var d = P.Dist(C), beta = JXG.Math.Geometry.rad([C.X()+1,C.Y()],C,P); t += beta; return C.Y()+dMath.sin(t); }, 0,2*Math.PI], {strokeWidth:6, strokeColor:'green'});

// Point on circle var B = brd.create('glider',[0,2,circle],{name:'B', color:'blue',trace:false}); var roll = brd.createRoulette(line, circle, 0, Math.PI/20, 1, 100, [C,P,B]); roll.start() // Start the rolling, to be stopped by roll.stop()

saveStartPos

(
  • obj
  • targets
)
private

Helper function which returns a reasonable starting point for the object being dragged. Formerly known as initXYstart().

Parameters:

select

(
  • str
)
JXG.GeometryElement | JXG.Composition

Select a single or multiple elements at once.

Parameters:

  • str String | Object | Function

    The name, id or a reference to a JSXGraph element on this board. An object will be used as a filter to return multiple elements at once filtered by the properties of the object.

Example:

// select the element with name A board.select('A');

// select all elements with strokecolor set to 'red' (but not '#ff0000') board.select({ strokeColor: 'red' });

// select all points on or below the x axis and make them black. board.select({ elementClass: JXG.OBJECT_CLASS_POINT, Y: function (v) { return v <= 0; } }).setAttribute({color: 'black'});

// select all elements board.select(function (el) { return true; });

setBoundingBox

(
  • bbox
  • [keepaspectratio=false]
)
JXG.Board

Set the bounding box of the board.

Parameters:

  • bbox Array

    New bounding box [x1,y1,x2,y2]

  • [keepaspectratio=false] Boolean optional

    If set to true, the aspect ratio will be 1:1, but the resulting viewport may be larger.

Returns:

JXG.Board:

Reference to the board

setId

(
  • obj
  • type
)
String

Composes an id for an element. If the ID is empty ('' or null) a new ID is generated, depending on the object type. Additionally, the id of the label is set. As a side effect JXG.Board#numObjects is updated.

Parameters:

  • obj Object

    Reference of an geometry object that needs an id.

  • type Number

    Type of the object.

Returns:

String:

Unique id for an element.

setZoom

(
  • fX
  • fY
)
JXG.Board

Sets the zoom level to fX resp fY.

Parameters:

Returns:

JXG.Board:

Reference to the board.

showDependencies

() JXG.Board

Lists the dependencies graph in a new HTML-window.

Returns:

JXG.Board:

Reference to the board

showXML

() JXG.Board

Lists the XML code of the construction in a new HTML-window.

Returns:

JXG.Board:

Reference to the board

stopAllAnimation

() JXG.Board

Cancels all running animations.

Returns:

JXG.Board:

Reference to the board

suspendUpdate

() JXG.Board

Stop updates of the board.

Returns:

JXG.Board:

Reference to the board

touchEndListener

(
  • evt
)
Boolean

Triggered as soon as the user stops touching the device with at least one finger.

Parameters:

Returns:

touchMoveListener

(
  • evt
)
Boolean

Called periodically by the browser while the user moves his fingers across the device.

Parameters:

Returns:

touchOriginMove

(
  • evt
)
Boolean

TODO

Parameters:

Returns:

touchOriginMoveStart

(
  • evt
)
| Boolean

TODO

Parameters:

Returns:

| Boolean:

touchStartListener

(
  • evt
)
Boolean

This method is called by the browser when a finger touches the surface of the touch-device.

Parameters:

  • evt Event

    The browsers event object.

Returns:

Boolean:

...

twoFingerMove

(
  • p1
  • p2
  • o
  • evt
)

Moves elements in multitouch mode.

Parameters:

  • p1 Array

    x,y coordinates of first touch

  • p2 Array

    x,y coordinates of second touch

  • o Object

    The touch object that is dragged: {JXG.Board#touches}.

  • evt Object

    The event object that lead to this movement.

twoFingerTouchCircle

(
  • np1c
  • np2c
  • o
  • drag
)

Moves a circle with two fingers

Parameters:

  • np1c JXG.Coords

    x,y coordinates of first touch

  • np2c JXG.Coords

    x,y coordinates of second touch

  • o Object

    The touch object that is dragged: {JXG.Board#touches}.

  • drag Object

    The object that is dragged:

twoFingerTouchObject

(
  • np1c
  • np2c
  • o
  • drag
)

Moves a line or polygon with two fingers

Parameters:

  • np1c JXG.Coords

    x,y coordinates of first touch

  • np2c JXG.Coords

    x,y coordinates of second touch

  • o Object

    The touch object that is dragged: {JXG.Board#touches}.

  • drag Object

    The object that is dragged:

unsuspendUpdate

() JXG.Board

Enable updates of the board.

Returns:

JXG.Board:

Reference to the board

update

(
  • [drag]
)
JXG.Board

Runs through most elements and calls their update() method and update the conditions.

Parameters:

Returns:

JXG.Board:

Reference to the board

updateConditions

() private

Computes the commands in the conditions-section of the gxt file. It is evaluated after an update, before the unsuspendRedraw. The function is generated in addConditions.

updateCoords

() JXG.Board

Update the coords object of all elements which possess this property. This is necessary after changing the viewport.

Returns:

JXG.Board:

Reference to this board.

updateCSSTransforms

() chainable

Update CSS transformations of sclaing type. It is used to correct the mouse position in JXG.Board#getMousePosition. The inverse transformation matrix is updated on each mouseDown and touchStart event.

It is up to the user to call this method after an update of the CSS transformation in the DOM.

updateElements

(
  • drag
)
JXG.Board

Runs through all elements and calls their update() method.

Parameters:

Returns:

JXG.Board:

Reference to the board

updateHooks

() JXG.Board deprecated

Runs through all hooked functions and calls them.

Returns:

JXG.Board:

Reference to the board

updateInfobox

(
  • el
)
JXG.Board

Updates and displays a little info box to show coordinates of current selected points.

Parameters:

Returns:

JXG.Board:

Reference to the board

updateRenderer

() JXG.Board

Runs through all elements and calls their update() method.

Returns:

JXG.Board:

Reference to the board

updateRendererCanvas

() JXG.Board

Runs through all elements and calls their update() method. This is a special version for the CanvasRenderer. Here, we have to do our own layer handling.

Returns:

JXG.Board:

Reference to the board

zoom100

() JXG.Board

Resets zoom factor to 100%.

Returns:

JXG.Board:

Reference to the board

zoomAllPoints

() JXG.Board

Zooms the board so every visible point is shown. Keeps aspect ratio.

Returns:

JXG.Board:

Reference to the board

zoomElements

(
  • elements
)
JXG.Board

Reset the bounding box and the zoom level to 100% such that a given set of elements is within the board's viewport.

Parameters:

  • elements Array

    A set of elements given by id, reference, or name.

Returns:

JXG.Board:

Reference to the board.

zoomIn

(
  • [x]
  • [y]
)
JXG.Board

Zooms into the board by the factors board.attr.zoom.factorX and board.attr.zoom.factorY and applies the zoom.

Parameters:

Returns:

JXG.Board:

Reference to the board

zoomOut

(
  • [x]
  • [y]
)
JXG.Board

Zooms out of the board by the factors board.attr.zoom.factorX and board.attr.zoom.factorY and applies the zoom.

Parameters:

Returns:

JXG.Board:

Reference to the board

Properties

_drag_offset

Array private

Offset for large coords elements like images

Default: [0, 0]

animationObjects

Object

Stores all the objects that are currently running an animation.

attr

Object

TODO

BOARD_MODE_DRAG

Number final

Board is in drag mode, objects aren't highlighted on mouse over and the object referenced in {JXG.Board#mouse} is updated on mouse movement.

BOARD_MODE_MOVE_ORIGIN

Number final

In this mode a mouse move changes the origin's screen coordinates.

BOARD_MODE_NONE

Number final

Board is in no special mode, objects are highlighted on mouse over and objects may be clicked to start drag&drop.

BOARD_MODE_ZOOM

Number final

Update is made with high quality, e.g. graphs are evaluated at much more points. JXG.Board/updateQuality

BOARD_QUALITY_HIGH

Number final

Update is made with high quality, e.g. graphs are evaluated at much more points.

See also:

BOARD_QUALITY_LOW

Number final

Update is made with low quality, e.g. graphs are evaluated at a lesser amount of points.

See also:

canvasHeight

Number

Canvas Height

canvasWidth

Number

Canvas width.

container

String

The html-id of the html element containing the board.

containerObj

Object

Pointer to the html element containing the board.

cPos

Array

Cached result of getCoordsTopLeftCorner for touch/mouseMove-Events to save some DOM operations.

currentCBDef

String

The current color blindness deficiency is stored in this property. If color blindness is not emulated at the moment, it's value is 'none'.

dependentBoards

Array

An array containing all other boards that are updated after this board has been updated.

See also:

dimension

Number

Dimension of the board.

Default: 2

document

Object

Pointer to the document element containing the board.

downObjects

Array

Collects all elements that triggered a mouse down event.

drag_dx

Number

The distance from the mouse to the dragged object in x direction when the user clicked the mouse button.

See also:

drag_dy

Number

The distance from the mouse to the dragged object in y direction when the user clicked the mouse button.

See also:

drag_position

Array

The last position where a drag event has been fired.

See also:

elementsByName

Object

An associative array to store the objects of the board by name. the name of the object is the key and value is a reference to the object.

geonextCompatibilityMode

Boolean

If GEONExT constructions are displayed, then this property should be set to true. At the moment there should be no difference. But this may change. This is set in undefined.

Default: false

See also:

  • JXG.GeonextReader#readGeonext

grids

Array

Grids keeps track of all grids attached to this board.

groups

Object

An associative array containing all groups belonging to the board. Key is the id of the group and value is a reference to the object.

hasGestureHandlers

Boolean

This bool flag stores the current state of the mobile Safari specific gesture event handlers.

Default: false

hasMouseHandlers

Boolean

A flag which tells if the board registers mouse events.

Default: false

hasMouseUp

Boolean

A flag which tells if the board the JXG.Board#mouseUpListener is currently registered.

Default: false

hasPointerHandlers

Boolean

A flag which stores if the board registered pointer events.

Default: false

hasPointerUp

Boolean

A flag which tells us if the board has a pointerUp event registered at the moment.

Default: false

hasTouchEnd

Boolean

A flag which tells if the board the JXG.Board#touchEndListener is currently registered.

Default: false

hasTouchHandlers

Boolean

A flag which tells if the board registers touch events.

Default: false

highlightedObjects

Object

An associative array containing all highlighted elements belonging to the board.

inUpdate

Boolean

During the update process this is set to false to prevent an endless loop.

Default: false

isSuspendedRedraw

Boolean

If true updates are skipped.

jc

JXG.JessieCode

The board's jessie code interpreter/rte instance

keepaspectratio

Boolean

Keep aspect ratio if bounding box is set and the width/height ratio differs from the width/height ratio of the canvas.

mode

Number

The board mode the board is currently in. Possible values are

  • JXG.Board.BOARD_MODE_NONE
  • JXG.Board.BOARD_MODE_DRAG
  • JXG.Board.BOARD_MODE_MOVE_ORIGIN

mouse

@link JXG.GeometryElement.

References to the object that is dragged with the mouse on the board.

See also:

  • {JXG.Board#touches}

needsFullUpdate

Boolean

Full updates are needed after zoom and axis translates. This saves some time during an update.

Default: false

numObjects

Number

Number of objects ever created on this board. This includes every object, even invisible and deleted ones.

objects

Object

An associative array containing all geometric objects belonging to the board. Key is the id of the object and value is a reference to the object.

ObjectsList

Array

An array containing all geometric objects on the board in the order of construction.

options

JXG.Options

Some standard options

origin

Object

Coordinates of the boards origin. This a object with the two properties usrCoords and scrCoords. usrCoords always equals [1, 0, 0] and scrCoords stores the boards origin in homogeneous screen coordinates.

positionAccessLast

Number

Contains the last time (epoch, msec) since the last getCoordsTopLeftCorner call which was not thrown away.

reducedUpdate

Boolean

If reducedUpdate is set to true then only the dragged element and few (e.g. 2) following elements are updated during mouse move. On mouse up the whole construction is updated. This enables us to be fast even on very slow devices.

Default: false

renderer

JXG.AbstractRenderer

A reference to this boards renderer.

touches

Array

Keeps track on touched elements, like JXG.Board#mouse does for mouse events.

See also:

  • {JXG.Board#mouse}

touchMoveLast

Number

Contains the last time (epoch, msec) since the last touchMove event which was not thrown away or since touchStart because Android's Webkit browser fires too much of them.

unitX

Number

The number of pixels which represent one unit in user-coordinates in x direction.

unitY

Number

The number of pixels which represent one unit in user-coordinates in y direction.

updateQuality

Number

The update quality of the board. In most cases this is set to JXG.Board#BOARD_QUALITY_HIGH. If JXG.Board#mode equals JXG.Board#BOARD_MODE_DRAG this is set to JXG.Board#BOARD_QUALITY_LOW to speed up the update process by e.g. reducing the number of evaluation points when plotting functions. Possible values are

  • BOARD_QUALITY_LOW
  • BOARD_QUALITY_HIGH

See also:

xmlString

String

A string containing the XML text of the construction. This is set in undefined. Only useful if a construction is read from a GEONExT-, Intergeo-, Geogebra-, or Cinderella-File.

zoomX

Number

Zoom factor in X direction. It only stores the zoom factor to be able to get back to 100% in zoom100().

zoomY

Number

Zoom factor in Y direction. It only stores the zoom factor to be able to get back to 100% in zoom100().

Events

boundingbox

The bounding box of the board has changed.

down

Whenever the user starts to touch or click the board.

Event Payload:

  • e Event

    The browser's event object.

hit

Whenever an element is highlighted this event is fired.

Event Payload:

mousedown

Whenever the user starts to click on the board.

Event Payload:

  • e Event

    The browser's event object.

mousehit

Whenever an element is highlighted this event is fired.

Event Payload:

mousemove

This event is fired whenever the user is moving the mouse over the board.

Event Payload:

  • e Event

    The browser's event object.

  • mode Number

    The mode the board currently is in

See also:

  • {JXG.Board#mode}

mouseup

Whenever the user releases the mousebutton over the board.

Event Payload:

  • e Event

    The browser's event object.

move

This event is fired whenever the user is moving the finger or mouse pointer over the board.

Event Payload:

  • e Event

    The browser's event object.

  • mode Number

    The mode the board currently is in

See also:

  • {JXG.Board#mode}

touchend

Whenever the user stops touching the board.

Event Payload:

  • e Event

    The browser's event object.

touchmove

This event is fired whenever the user is moving the finger over the board.

Event Payload:

  • e Event

    The browser's event object.

  • mode Number

    The mode the board currently is in

See also:

  • {JXG.Board#mode}

touchstart

Whenever the user starts to touch the board.

Event Payload:

  • e Event

    The browser's event object.

up

Whenever the user stops to touch or click the board.

Event Payload:

  • e Event

    The browser's event object.

update

This board is updated.