For variables, the type of accent shown over the variable, if any. Note that while vector variables may have an arrow accent, this is generated automatically based on the data type. If a variable has no user-specified accent, this will be null.
A more general description of the node type. For example, the "plus"
type has base type "operator"
.
A description of the mathematical category of the node type, such as "Arithmetic"
or "Calculus"
. This generally matches the name of the section where the corresponding command would be found in a generated help table.
For nodes whose parent is a tabular node, this is an array of two numbers indicating the row and column of the table cell in the parent.
For variables and identifiers, the data type.
For operators, the effective placement after context is considered. If an operator's placement is contextual
, this property will specify its effective placement after taking context into account.
If this node is a tabular node, returns whether it automatically inserts a new row when content is placed in the last row. The size of a tabular node does not include such rows.
If there is an implicit operation between this node and the node after it, this describes the node type of that operator. For example, there is an implied multiplication between 2 and x in the expression 2x. In this case, in the node for the digit 2 would, this property would be equal to "timesDot"
.
Returns the number of fields in the node. This will be 0 if the node is a leaf that cannot contain child nodes.
This node's parent node, or null if it does not have a parent. A child node occurs exactly once in one of the fields of its parent.
For operators, the operator's placement relative to its operand(s).
For nodes that have a parent, this is a description of the position of the node relative to its parent, consisting of the parent node, the field in which this node is found in the parent, and the offset from the start of that field at which the node is found.
The ancestor of this node that has no parent. This is normally a node of type "documentRoot"
unless the node is no longer in a document. If the node has no parent, then the root is the node itself.
If this node is a tabular node, returns the table size as an array giving the number of rows and columns respectively. Note that special columns or rows that expand the node's size are not counted. For example, a 2 × 4 matrix will return a size of [2,4]
and not [3,5]
.
For operators, variables, identifiers, or chars, the letter(s) and/or mathematical symbol(s) that represent the object.
Some operators consist of a vertical stack of symbols. For such operators, this is the symbol that appears above the primary symbol.
For text, identifiers, and string literals, returns the character nodes in the child field combined into a single string for convenience.
The specific node type. Where possible, this matches the relevant API name.
If this node is a tabular node, returns whether it automatically inserts a new column when content is placed in the last column. The size of a tabular node does not include such columns.
If this node is a tabular node, returns the field that represents the specified row and column of the table.
The table row to get the field of.
The table column to get the field of.
The field of the specified row and column, or null if the node is not tabular or no such cell exists.
Returns the node at the specified index in the specified field. This is equivalent to field(fieldNum).nodeAt(index)
.
The number of the field to retrieve.
The index of the desired child node in the field.
The requested node, or null if no such node exists.
Returns the specified field of the node. Fields are numbered from 0 to numFields
-1. The order of fields in a node corresponds to the order in which they are visited by moving through the node with the forwardEnter
command.
The number of the field to retrieve.
The requested field, or null if no such field exists.
If the target node is an immediate child of this node, returns a number array containing the field number containing the target, and the index of the target within that field. Otherwise, returns null if the node is not an immediate child.
The node to search for.
The location of the target in this node's fields, or null.
This API is still under development and is subject to change. Copyright © Math I Can Do Solutions Incorporated and/or its licensors.
A node represents a single mathematical object in the document structure, such as a variable, a digit, or parentheses.
Complex nodes have one or more Fields, which are lists of child nodes. Each field represents a contiguous semantic subpart of the object. For example, a node representing a fraction would have two fields: one representing the numerator, and one representing the denominator. (The order of fields matches the order that the caret would move through them in the editor when repeatedly pressing the Enter key.)
Nodes are read-only reflections of the underlying content: modifying them has no effect on the document. To modify the document, use the Walker to insert, delete, and apply commands.
Example: Print the type of node under the caret