Function
Static Public Summary | ||
public |
Find the derivative of a quadratic bezier at a given point. |
|
public |
calcBezierDistance(pointX: number, pointY: number, start: Point, control: Point, end: Point): number Function that calculates the distance between a specified point and a quadratic bezier. |
|
public |
createForm(fields: Array<InputType>): string Create an html string for a form given an array of field types. |
|
public |
Create a form with inputs for graph elements. |
|
public |
displayError(form: Element, inputName: string, showError: boolean) Add/remove the CSS class 'error' to the specified form input. |
|
public |
Get all of the data from a form. |
|
public |
getInputValue(input: Element): boolean | number | string Get the value of the given form input. |
|
public |
Get the value of a single input. |
|
public |
init() Call to initialize form functionality. |
|
public |
scrollToElement(element: Element, to: number, speed: number, easing: string) Function to scroll to an element. |
Static Public
public bezierDerivative(t: number, start: Point, control: Point, end: Point): Point source
import {bezierDerivative} from 'canvas-graph-creator/src/js/util/bezier.js'
Find the derivative of a quadratic bezier at a given point.
public calcBezierDistance(pointX: number, pointY: number, start: Point, control: Point, end: Point): number source
import {calcBezierDistance} from 'canvas-graph-creator/src/js/util/bezier.js'
Function that calculates the distance between a specified point and a quadratic bezier.
Return:
number | The distance between (pointX, pointY) and the bezier curve specified by start, control, and end. |
public createForm(fields: Array<InputType>): string source
import {createForm} from 'canvas-graph-creator/src/js/ui/form.js'
Create an html string for a form given an array of field types.
public createGraphForm(fields: Array<InputType>, canSubmit: boolean, submitText: string): string source
import {createGraphForm} from 'canvas-graph-creator/src/js/ui/form.js'
Create a form with inputs for graph elements. Also has options for a button to submit the form.
public displayError(form: Element, inputName: string, showError: boolean) source
import {displayError} from 'canvas-graph-creator/src/js/ui/form.js'
Add/remove the CSS class 'error' to the specified form input.
public getData(form: Element, graph: Graph): Object<string, *> source
import {getData} from 'canvas-graph-creator/src/js/ui/form.js'
Get all of the data from a form.
public getInputValue(input: Element): boolean | number | string source
import {getInputValue} from 'canvas-graph-creator/src/js/ui/form.js'
Get the value of the given form input.
Params:
Name | Type | Attribute | Description |
input | Element | Form input DOM element. |
public getInputValueLocal(input: Element, graph: Graph): boolean | number | string | Node | Edge source
import {getInputValueLocal} from 'canvas-graph-creator/src/js/ui/form.js'
Get the value of a single input. Used when the input could contain a reference to a Node or Edge.
public init() source
import {init} from 'canvas-graph-creator/src/js/ui/form.js'
Call to initialize form functionality.
public scrollToElement(element: Element, to: number, speed: number, easing: string) source
import scrollToElement from 'canvas-graph-creator/src/js/util/scroll-to-element.js'
Function to scroll to an element. Based on scrollToY from http://stackoverflow.com/a/16136789/1418962