A plot of the graph of a function.
Class attribute for the root element.
A display circle to display input and output
Represents the path taken by the function.
A group containing the grid lines
Invisible element for registering events
This static group gets translated along witht he viewPort, but elements retain their original sizing.
Style for the root element.
The update function describes how this element should update itself
This view port is a coordinate system where things are scaled using svg's internal representatino of scaling.
A line to represent the x-axis of this graph
A line to represent the y-axis of this graph
The controller manages the dependencies between elements. Every element is added to this controller upon creation.
This number uniquely identifes elements
Allows for the events attatched to elements to be disabled.
Sets the internal function to the provided function Returns the internal function
Returns the height of this svg element. Sets the height of this svg element to the provided value.
Returns the unique generated identifier associated with this element.
Return the width of this svg element. Set the width of this svg element.
Constructs and appends an 'a' (link) element within this element.
Declares this element dependent on the provided element(s).
Appends the element as a child within this element.
Returns the result of calling the internal function with the provided function scaling both the input and the output.
Removes all child elements from this element.
Constructs and appends a 'clipPath' element within this element.
Returns true if this element contains the argument element.
Draws the internal function over the interval [startX, endX]. The default interval is [ minX - width, maxX + width ] so that when a user drags the graph there is enough drawn so that a translate may be applied instead of having to call draw again.
Formats the input number to be displayed within the graph.
Returns the bounding box of this element. Note, this is different from the getBoundingClientRect method since the bounding box is affected by the current viewPort.
If this element's root is not a SVGGraphics element as is the case for the marker, title, and more element, then null is returned instead of a DOMRect.
When a user mouses down over this graph a drag is active.
When the user's mouse leaves the graph deactivates any concurrent drag.
Handle when a mouse moves over this graph. If a drag event is active then translates the position of the graph to the new location.
Deactivates the current drag event.
Zooms in and out on this graph. TODO: There is some jarring wheel action where an active wheel event on the page will stop dead when the mouse goes over the graph. Also it seems as if the scroll has pre-existing "momentum" that it can also affect the graph.
Constructs and appends a 'marker' element within this element.
Inserts the element before the first child within this element.
Removes this element from the DOM and from the Element controller.
Constructs and appends a 'script' element within this element.
This moves the origin of the plot to the location (x,y) relative to the size of the plot. For example, if the plot is 600 wide and 300 tall, placing the origin at (100,100) move the origin to the point 100 units in the x direction and 100 units in the y direction from the top left corner of the plot.
Updates the position of the static group and sets the viewbox on the viewPort element.
Updates all of the elements that depend on this element.
Updates the display circle based on its current cx position, also updates the display text elements to represent the position of the display circle.
Constructs and returns a SVG object within the DOM. If the provided argument is an HTMLElement appends the interactive within that element. If the provided a value is a string, appends the interactive within the HTML element with the corresponding ID. If no element is found throws an error.
Clears the static data structures holding elements and resets the count.
Generated using TypeDoc