Draw a graph in a container. A unit is a centimeter by default (see resolveGraphConfig).
the container, or the id of an element of the page.
Optionalconfig: IGraphConstructorConfigThe size of the drawing, its origin and the vector of a unit of each axis, in pixels. The same object until updateLayout gives another
one: the figures read it when they are drawn.
What the themes keep on the graph (the titles of the slides...), by the name of the entry. The graph does not know what the entries mean: a theme writes its own with setControl and the controllers read them here.
Make a figure of the graph: each one is in its layer and among the figures, under its name.
What the layout shows (the grid, the axes), as it was last asked for.
The figures of the graph by name, in the order they were made. An object without a prototype: any text is a name. The layout (the grid and the axes) is not in it.
The groups of the svg that the figures are in, from the back of the drawing to the front (see LayerName).
The grid of the layout (the display grid), null when the graph does not show one.
The svg of the drawing.
The converter of the text of an HTML label to HTML, undefined if the graph was made without one.
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optionaloptions: boolean | AddEventListenerOptionsAttach a controller to the graph: a module that acts on the drawing from outside (the animation, a zoom, the slides), made by
the program with new Animate(graph). The graph tells it when figures are removed (remove, clear) and when it is taken out of the page
(dispose), so that it stops what it does.
the controller.
Remove every figure of the graph, but not the layout. The attached controllers are told which figures were removed (onFiguresRemoved).
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
Take the graph out of the page: remove every figure (the ones that keep a listener let it go) and the layout, and remove from its container the element that the graph made. The attached controllers are disposed, and detached. The graph is not used afterward; calling this again does nothing.
Make a point draggable with the mouse. The figures that depend on it, and on its target, are drawn again each time it moves, and
the events dragstart, dragmove (with how many figures that reached) and dragend are emitted. It stays in the drawing.
Put a point that can be dragged where it would be if the mouse had dragged it to pixels: the rules of its drag apply (along an axis, on the
grid, in bounds, on a figure it follows), then the figures that depend on it are drawn again. No event is emitted.
A figure of the graph tells that something changed in it that the controllers may care about (see IGraphController.onFigureChanged). It is
what the figures call on their context, and it is not for a program to call.
Make a point draggable by a handle: a large pale disc, on the layer of the interactions, that follows the point and moves it when it is dragged. The user reaches a point that is small, or hidden.
the handle, which is a figure of the graph named <point>_drag.
Stop calling a handler given to on.
the graph, to chain.
Call handler each time a point of the graph is dragged: dragstart, dragmove (with how many figures that reached) and dragend.
The same handler given twice is called once.
the graph, to chain.
Remove a figure of the graph: from the svg, and from the figures. The layout (the grid and the axes) is not a figure.
Optionaloptions: { cascade?: boolean }
cascade: also remove the figures that depend on this one (a line built on a point...), which go first. Without it
a figure that others depend on is not removed.
the names of the figures that were removed, the ones that depend on others first.
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Optionaloptions: boolean | EventListenerOptionsKeep a value for a theme, or take it away with null. The attached controllers are told (onControlsChanged). The value is not checked: the
theme does it.
The graph as a whole tikzpicture: the grid and the axes, then the figures, in the order they are drawn on screen (layer by layer, and in
a layer in the order of its elements). The picture has the size of the part of the coordinate system that is drawn, which the commands are cut
to (see tikzPicture). The handles of the points
the user drags are not part of the drawing, and a figure that is hidden writes nothing. The packages it needs are in tikzPreamble.
The lines to put before \begin{document} for the tikz of a graph: the packages and the libraries its figures need.
A length, a domain or a position in pixels in units of the coordinate system: the opposite of toPixels.
Optionalaxis: "x" | "y"A length, a domain or a position of the coordinate system in pixels, with the scale of the graph as it is now. A length or a domain is
along axis ('x' by default); a domain comes back with its min below its max, even on the y axis, which points up.
Optionalaxis: "x" | "y"A length, a domain or a position of the coordinate system in pixels, with the scale of the graph as it is now. A length or a domain is
along axis ('x' by default); a domain comes back with its min below its max, even on the y axis, which points up.
Optionalaxis: "x" | "y"Draw the figures again and put their labels at their place, to follow what changed.
With changed, only the figures that depend on them, directly or not, are drawn again, each one once and after the ones it depends
on: a figure that does not depend on them is left alone. The figures of changed are not drawn again, their position is the one they
were given (a point that was dragged or animated): only their labels are. Without changed, every figure is drawn again.
A figure that the user holds (see draggable) is never drawn again, only its label. A figure that is static is left as it is
too, unless forceUpdate is true.
Optionalchanged: AbstractFigure | readonly AbstractFigure[]
the figure, or the figures, that were moved.
OptionalforceUpdate: booleanhow many figures were reached: the ones drawn again (a figure left as it is, static, is not counted) and the ones that
were moved, out of the figures of the graph.
Draw the layout again (the size of the drawing, the grid and the axes), and update every figure to follow it.
Optionalconfig: IGraphConfig
the new configuration, whole. The one of the graph stays by default.
Optionaldisplay: IGraphDisplay
what the layout shows, as it is (without the defaults of the constructor). The one of the graph stays by default.
InvalidArgumentError if config is not valid (see checkGraphConfig), or display cannot be drawn.
MathError if the position of a moved point cannot be read in the coordinate system of the graph as it is now. The graph is left as it was in case of an error.
A point that was moved (dragged, animated: see Point.isMoved) keeps its place in the coordinate system, not in pixels: it is put
where the same coordinates are in the new layout, and what depends on it is drawn again. The attached controllers are told afterward
(onLayoutChanged).
A drawing in the page: a coordinate system with its grid and its axes (the layout), and the figures that are made in it.
The figures are made by
create, drawn again byupdatewhen what they depend on moves, and written in TikZ bytikz. A point is made draggable bydraggable, and the graph tells what happens by events (on).disposetakes it out of the page.