g.canvas
element that holds the area where the graphs are plotted (clipped with a mask)
Element that holds the canvas where the functions are drawn
Draggable element that receives zoom and pan events
Private
generationThe number of times a function was rendered.
Private
Readonly
idPrivate
linePrivate
linkedArray of function-plot instances linked to the events of this instance, i.e. when the zoom event is dispatched on this instance it's also dispatched on all the instances of this array
Readonly
markersvg
element that holds the graph (canvas + title + axes)
Element that holds the tip
Static
cachePrivate
buildPrivate
getPrivate
getGenerated using TypeDoc
An instance can subscribe to any of the following events by doing
instance.on([eventName], callback)
, events can be triggered by doinginstance.emit([eventName][, params])
mouseover
fired whenever the mouse is over the canvasmousemove
fired whenever the mouse is moved inside the canvas, callback params: a single object{x: number, y: number}
(in canvas space coordinates)mouseout
fired whenever the mouse is moved outside the canvasbefore:draw
fired before drawing all the graphsafter:draw
fired after drawing all the graphszoom
fired whenever there's scaling/translation on the graph (x-scale and y-scale of another graph whose scales were updated)tip:update
fired whenever the tip position is updated, callback params{x, y, index}
(in canvas space coordinates,index
is the index of the graph where the tip is on top of)eval
fired whenever the sampler evaluates a function, callback paramsdata
(an array of segment/points),index
(the index of datum in thedata
array),isHelper
(true if the data is created for a helper e.g. for the derivative/secant)The following events are dispatched to all the linked graphs
all:mouseover
same asmouseover
but it's dispatched in each linked graphall:mousemove
same asmousemove
but it's dispatched in each linked graphall:mouseout
same asmouseout
but it's dispatched in each linked graphall:zoom
fired whenever there's scaling/translation on the graph, dispatched on all the linked graphs