Returns whether user input locked or not.
Allows listening to all the events that do not change the editor's model: neither change expression nor cursor nor selection.
the listener to add
Add listener to listen for all the editor updates.
The listener will receive two parameters: updateInfo - what exactly were updated and confirmation - what was not yet updated, but the user was asked to confirm the operation instead
Applies advice received from the getAdvices method.
Applies all the previously installed heuristics.
true if the heuristics have changed the current expression, false if not.
Blurs the editor.
Copies selected expression to the clipboard.
Cuts selected expression to the clipboard.
Makes editor readonly and creates editable cells inside.
nodeId - node id for editable cell borderVisible - whether the border of editable cell visible or not avoidParenthesesWrap - whether the wrap editable cell with parens or not
Deletes node near the current cursor position or replaces the selection. This method allows programmatically emulate pressing delete/backspace button. It requires cursor or non-empty selection inside the editor. Otherwise, it does nothing.
left for backspace button and right for delete button
whether node or ask user for confirmation
Destroys the editor.
Disables mouse interaction for the editor.
Disables undo/redo for the editor.
Drops the current selection.
whether put the cursor to the end of selection after dropping
Enables mouse interaction for the editor.
Enables undo/redo for the editor.
Focuses the editor.
Returns advices for the current cursor position. Advice is a suggestion to end user what can be inserted into the current cursor position. For example, if user enters 'in' then we can suggest him 'Indefinite integral'.
Returns description of the current expression as character-by-character text.
Returns list of {@link Element} for a given node id.
current expression as latex
Returns nearest node for a given point.
current selection as semantic tree
current expression as semantic tree with the list of semantic errors (if any)
Returns description of the current expression as human readable math text.
current expression in context free semantic language
Returns symbols located near the cursor.
include hidden symbols (such as implicit multiplication) or not
allow to post process semantic tree to omit information (eg selection, cursor, etc)
current expression as semantic tree
Returns whether selection exists or not.
Inserts character to the right of the current cursor position or replaces the selection. This method allows programmatically emulate user input. It requires cursor or non-empty selection or empty expression inside the editor. Otherwise, it does nothing.
character to insert
true if the character was successfully inserted
Inserts tree to the right of the current cursor position or replaces the selection. This method allows programmatically to insert one semantic tree into another. It requires cursor or non-empty selection or empty expression inside the editor. Otherwise, it does nothing.
semantic tree to insert
if true then overrides semantic context of the insertable tree to match current one (default) if false then throws an exception on context conflicts
true if the tree was successfully inserted
Locks user input.
Programmatically moves the selection boundary horizontally.
whether move left or right boundary
direction to move selection boundary
Programmatically moves the selection boundary vertically.
whether move top or bottom boundary
direction to move selection boundary
Programmatically moves cursor to the given direction. It requires cursor inside the editor. Otherwise, it does nothing.
direction to move cursor to
Pastes expression from the clipboard to the right of the current cursor position or replaces the selection. It requires cursor or non-empty selection or empty expression inside the editor. Otherwise, it does nothing.
true if the expression was successfully pasted
Places cursor at the left or at the right of the given symbol
identifier of the given symbol (can be found in model classes)
where to place the cursor - at the right of the symbol or at the left
Removes cursor from the editor
true if the cursor was actually in the editor
Remove the listener previously added with addOnNotify.
the listener to remove
Remove the listener previously added with addOnUpdate.
the listener to remove
Validates current expression in the editor and highlights invalid nodes.
Programmatically increases selection in a given direction. It requires cursor or non-empty selection inside the editor.
direction to increase the selection
Programmatically creates selection between given nodes using the provided horizontal and vertical direction.
start node id
end node id
horizontal direction
vertical direction
whether include start node to selection or not (default true)
Selects expression in the editor inside a given rectangle.
Enables readonly mode for the editor.
Disables readonly mode for the editor.
Updates current expression with the given semantic tree
semantic tree
updated math tree (original one can be changed by hints)
Unlocks user input.
Removes all decorations.
Clears the editor and remove all decorations.
Decorates math nodes inside the editor. For that, it creates an overlay element you can style. The decoration is dropped if the tree changed because it becomes disconnected with new tree nodes.
node ids to decorate
function to decorate the overlay element
hook that executes when the decoration is removed on math tree update
indicates if the decoration requires rendering after creation
indicates if the decoration requires redrawing
handler to remove the decoration
Returns internal editor state as JSON.
Returns internal editor state with history as JSON.
Returns ClientRect for the current cursor.
Returns internal expression representation.
Returns ClientRect for the current selection.
Navigates cursor vertically inside the editor.
true if navigation happened (there was somewhere to go)
Re-renders all decorations.
Sets internal editor state using provided JSON.
internal editor state
Sets internal editor state with history using provided JSON.
internal editor state
Sets internal expression representation. Returns an array of node ids, ordered left to right according to initial order in the math expression.
internal expression representation
Generated using TypeDoc
Extends MathEditorRenderable and uses KaTeX as renderer. Listen DOM mouse and keyboard events for expression manipulation. Includes default semantic validator.