# JSXGraph Reference

## JavaScript must be enabled in order for you to use JSXGraph and JSXGraph reference. However, it seems JavaScript is either disabled or not supported by your browser.

Class Index | File Index

## Elements

## Classes

- _global_
- Angle
- Arc
- Arrow
- Arrowparallel
- Axis
- Bisector
- Bisectorlines
- Button
- Cardinalspline
- Checkbox
- Circle
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Conic
- Curve
- Derivative
- Ellipse
- Functiongraph
- Glider
- Grid
- Group
- Hatch
- Hyperbola
- Image
- Incenter
- Incircle
- Inequality
- Input
- Integral
- Intersection
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.C
- JXG.CA
- JXG.CanvasRenderer
- JXG.Circle
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.CoordsElement
- JXG.Curve
- JXG.Dump
- JXG.EventEmitter
- JXG.GeometryElement
- JXG.GeonextParser
- JXG.Group
- JXG.Image
- JXG.JessieCode
- JXG.JSXGraph
- JXG.Line
- JXG.Math
- JXG.Math.Geometry
- JXG.Math.Numerics
- JXG.Math.Poly
- JXG.Math.Poly.Monomial
- JXG.Math.Poly.Polynomial
- JXG.Math.Poly.Ring
- JXG.Math.Statistics
- JXG.Math.Symbolic
- JXG.NoRenderer
- JXG.Options
- JXG.Point
- JXG.Polygon
- JXG.Server
- JXG.Server.modules
- JXG.SVGRenderer
- JXG.Text
- JXG.Ticks
- JXG.Transformation
- JXG.Turtle
- JXG.Util
- JXG.Util.Base64
- JXG.Util.Unzip
- JXG.Util.UTF8
- JXG.VMLRenderer
- JXG.XML
- Label
- Line
- Locus
- MajorArc
- MajorSector
- Midpoint
- MinorArc
- MinorSector
- Mirrorelement
- Mirrorpoint
- NonReflexAngle
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelpoint
- Perpendicular
- PerpendicularPoint
- PerpendicularSegment
- Point
- PolarLine
- PolePoint
- Polygon
- Quadtree
- RadicalAxis
- Reflection
- ReflexAngle
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Slopetriangle
- Spline
- Stepfunction
- Tangent
- Tapemeasure
- Text
- Ticks
- Tracecurve
- Transformation
- Turtle

# Class JXG.Composition

↳ JXG.Composition

JXG.Composition
Defined in: composition.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG.Composition(elements) A composition is a simple container that manages none or more JXG.GeometryElements.

Method Summary
Method Attributes | Method Name and Description
--- | ---
| add(what, element) Adds an element to the composition container.
| highlight() Invokes highlight for every stored element with a highlight method and hands over the given arguments.
| noHighlight() Invokes noHighlight for every stored element with a noHighlight method and hands over the given arguments.
| prepareUpdate() Invokes prepareUpdate for every stored element with a prepareUpdate method and hands over the given arguments.
| remove(what) Remove an element from the composition container.
| setAttribute() Invokes setAttribute for every stored element with a setAttribute method and hands over the given arguments.
| update() Invokes update for every stored element with a update method and hands over the given arguments.
| updateRenderer() Invokes updateRenderer for every stored element with a updateRenderer method and hands over the given arguments.

Class Detail
JXG.Composition(elements)
A composition is a simple container that manages none or more JXG.GeometryElements.

Parameters:
{Object} elements
  A list of elements with a descriptive name for the element as the key and a reference to the element as the value of every list entry. The name is used to access the element later on.

Examples:

    var p1 = board.create('point', [1, 2]),
        p2 = board.create('point', [2, 3]),
        c = new JXG.Composition({
            start: p1,
            end: p2
        });

    // moves p1 to [3, 3]
    c.start.moveTo([3, 3]);

Method Detail
{Boolean} add(what, element)
Adds an element to the composition container.

Parameters:
{String} what
  Descriptive name for the element, e.g. startpoint or area. This is used to access the element later on. There are some reserved names: elements, add, remove, update, prepareUpdate, updateRenderer, highlight, noHighlight, and all names that would form invalid object property names in JavaScript.
{JXG.GeometryElement|JXG.Composition} element
  A reference to the element that is to be added. This can be another composition, too.

Returns:
  {Boolean} True, if the element was added successfully. Reasons why adding the element failed include using a reserved name and providing an invalid element.

highlight()
Invokes highlight for every stored element with a highlight method and hands over the given arguments. See JXG.GeometryElement#highlight for further description, valid parameters and return values.

noHighlight()
Invokes noHighlight for every stored element with a noHighlight method and hands over the given arguments. See JXG.GeometryElement#noHighlight for further description, valid parameters and return values.

prepareUpdate()
Invokes prepareUpdate for every stored element with a prepareUpdate method and hands over the given arguments. See JXG.GeometryElement#prepareUpdate for further description, valid parameters and return values.

{Boolean} remove(what)
Remove an element from the composition container.

Parameters:
{String} what
  The name used to access the element.

Returns:
  {Boolean} True, if the element has been removed successfully.

setAttribute()
Invokes setAttribute for every stored element with a setAttribute method and hands over the given arguments. See JXG.GeometryElement#setAttribute for further description, valid parameters and return values.

update()
Invokes update for every stored element with a update method and hands over the given arguments. See JXG.GeometryElement#update for further description, valid parameters and return values.

updateRenderer()
Invokes updateRenderer for every stored element with a updateRenderer method and hands over the given arguments. See JXG.GeometryElement#updateRenderer for further description, valid parameters and return values.