Recent Changes - Search:

Information

Installation

Documentation

HtmlViewElementsFunction

This element lets you write an analytic expression for a function and use it to evaluate the function on given arguments.

The expressions are parsed to make the computations. Check here for the right syntax.

The expressions may contain any number of variables. To make the computation, you need to invoke the element evaluate() function with a JavaScript object with all these variables as properties.

For instance, if your function element is called myFunction and the expression it contains is x+y, you can evaluate the function as in: var result = _view.myFunction.evaluate( { x : 3 , y : 2 } ); result should be 5.

If your expression contains many parameters (variables which rarely change their value), as in a*x^3+b*x^2+c*x+d, you can save the effort of passing each time the values of the parameters a,b,c,d, by setting: _view.myFunction.setParameters( { a : 1 , b : 3 , c : -1, d : -2 } ); and then evaluate the function by simply invoking: var result = _view.myFunction.evaluate( { x : 3 } ); The parameters do not change until you call setParameter again.

If you invoke once: var result = _view.myFunction.evaluate( { a : 0, x : 3 } ); then this value of a will be called for this particular evaluation. But the next time, the value of the parameter a will still be 1.

Main
NameDescriptionValues acceptedDefault
ValueThe value displayed by the element.A constant or variable of type double or int.-
EditableWhether the element is editable.A constant or variable.-
OnChangeThe action to invoke when the element is pressed.The JavaScript code to invoke for the action.-
OnErrorThe action to invoke when on error.The JavaScript code to invoke for the action.-
NameDescriptionValues AcceptedDefault
VisibilityThe visibility of the element.Boolean variable or constants true or false.true
DisplayDisplay style, can use "none," "inline-block," etc.Boolean variable or constants true or false."block"
WidthWidth in pixels (e.g., 400px) or percentage (e.g., 100%).-400px
HeightHeight in pixels (e.g., 300px) or viewport height (e.g., 90vh).-300px
BackgroundThe background color for the element. Use the editor provided or read about colors.--
ForegroundThe color to use when drawing or writing in the element. Use the editor provided or read about colors.--
FontThe font used to display text in the element. Use the editor provided to select name, style, and size of the font.-"normal normal 10px "
TooltipText displayed when the mouse is over the element.String constant or variable.-
ClassNameClass name.String constant or variable.-
CSSCSS.String constant or variable.-
TransformTransform.String constant or variable.-
Edit - History - Print - Recent Changes - Search
Page last modified on October 23, 2023, at 06:43 AM