API Docs for: 1.0.0
Show:

MathFunction.Value Class

Constant value

Constructor

MathFunction.Value

(
  • value
)

Parameters:

Methods

evaluate

(
  • var_list
)

Inherited from MathFunction but overwritten in src/gallery-mathcanvas/js/Value.js:39

Parameters:

  • var_list Object

    map of variable names to values or MathFunctions

Returns:

the value of the function

getParent

() MathFunction

Returns:

MathFunction:

parent function or null

handleKeyPress

(
  • canvas
  • code
  • c
)

Overridden by Input.

Parameters:

  • canvas MathCanvas
  • code Int

    character code

  • c String

    character

Returns:

true if function changed

layout

(
  • context
  • top_left
  • font_size
  • rect_list
)
Int

Add the layout information for this object and its descendants to rect_list.

Parameters:

  • context Object

    the drawing context

  • top_left Point

    x,y coordinates of the top left of the bounding box

  • font_size Float

    percentage of the base font size

  • rect_list RectList

    layout information

Returns:

Int:

index of this items info in rect_list

parenthesizeForPrint

(
  • f
)
Boolean protected

Parameters:

Returns:

Boolean:

true if f needs to parenthesize us

parenthesizeForRender

(
  • f
)
Boolean protected

Parameters:

Returns:

Boolean:

true if f needs to parenthesize us

render

(
  • context
  • rect_list
)

Draw this object and its descendants.

Parameters:

  • context Object

    the drawing context

  • rect_list RectList

    layout information

toString

()

Inherited from MathFunction but overwritten in src/gallery-mathcanvas/js/Value.js:49

Returns:

text representation of the function