@mathjax/src
    Preparing search index...

    A visitor pattern that computes complexities within the MathML tree

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    collapse: Collapse

    The object used to handle collapsable content

    complexity: { [name: string]: number } = ...

    Values used to compute complexities

    factory: MmlFactory

    The MmlFactory for this visitor

    nodeHandlers: Map<string, VisitorFunction<MmlNode>> = ...

    Holds the mapping from node kinds to visitor funcitons

    options: OptionList

    The options for this visitor

    defaultAttributes: { [kind: string]: PropertyList } = ...

    Attributes to include on every element of a given kind

    OPTIONS: OptionList = ...

    The options for handling collapsing

    rename: PropertyList = ...

    MmlNode kinds to replace with other names

    variants: PropertyList = ...

    Translations for the internal mathvariants

    Methods

    • Parameters

      • node: MmlNode

        The node whose children complexities are to be added

      Returns number

      The sum of the complexities, plus child complexity for each one

    • Parameters

      • node: MmlNode

        The node whose complixity is being set

      • complexity: number

        The complexity for the node

      • save: boolean

        True if complexity is to be set or just reported

      Returns number

      The complexity of the node

    • Parameters

      • data: PropertyList

        The class attribute list

      • name: string

        The name for the data-mjx-name attribute

      • value: string

        The value of the attribute

      Returns void

    • Can't really measure annotations, so just use a specific value

      Parameters

      • node: MmlNode

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • Can't really measure annotations, so just use a specific value

      Parameters

      • node: MmlNode

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • For actions, use the complexity of the selected child

      Parameters

      • node: MmlMaction

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • For enclose, use sum of child complexities plus some for the enclose

      Parameters

      • node: MmlNode

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • For a fraction, add the complexities of the children and scale by script factor, then add the fraction amount

      Parameters

      • node: MmlNode

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • Can't really measure mglyph complexity, so just use a specific value

      Parameters

      • node: MmlNode

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node (if collapsable, then the collapsed complexity)

    • Parameters

      • node: MmlMover

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • Phantom complexity is 0

      Parameters

      • node: MmlNode

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • For roots, do the sqrt root computation and remove a bit for the root (since it is counted in the children sum but is smaller)

      Parameters

      • node: MmlMroot

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • For semantics, get the complexity from the first child

      Parameters

      • node: MmlNode

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • For ms, add the complexity of the quotes to that of the content, and use the length of that times the text factor as the complexity

      Parameters

      • node: MmlNode

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • For square roots, use the child complexity plus the sqrt complexity

      Parameters

      • node: MmlNode

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • Parameters

      • node: MmlMsub

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • For supscripts and superscripts use the maximum of the script complexities, multiply by the script factor, and add the base complexity. Add the child complexity for each child, and the subsup complexity.

      Parameters

      • node: MmlMsubsup

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • Parameters

      • node: MmlMsup

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • Parameters

      • node: MmlMunder

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • For under/over, get the maximum of the complexities of the under and over elements times the script factor, and that the maximum of that with the base complexity. Add child complexity for all children, and add the underover amount.

      Parameters

      • node: MmlMunderover

        The node whose complixity is being computed

      • save: boolean

        True if the complexity is to be saved or just returned

      Returns number

      The complexity of the node

    • Visitor functions are named "visitKindNode" where "Kind" is replaced by the node kind; e.g., visitTextNode for kind = text.

      Parameters

      • kind: string

        The node kind whose method name is needed

      Returns string

      The name of the visitor method for the given node kind