figureone
    Preparing search index...

    Equation root

    Surround an equation phrase with a radical symbol EQN_RadicalSymbol and add a custom root if needed

    Options can be an object, or an array in the property order below.

    To test examples, append them to the boilerplate

    // Simple
    figure.add({
    name: 'eqn',
    make: 'equation',
    forms: {
    1: { root: ['radical', 'a'] },
    },
    });
    figure.elements._eqn.showForm('1');
    // Example showing object and array root definitions, and custom roots
    figure.add({
    name: 'eqn',
    make: 'equation',
    elements: {
    r: { symbol: 'radical' },
    plus: ' + ',
    },
    formDefaults: { alignment: { fixTo: 'd' } },
    forms: {
    // Root object form
    1: {
    root: {
    symbol: 'r',
    content: ['a', 'plus', 'd'],
    },
    },
    // Root array form
    2: { root: ['r', 'd'] },
    // Cube root
    3: { root: { content: 'd', symbol: 'r', root: '_3' } },
    },
    formSeries: ['1', '2', '3'],
    });
    const eqn = figure.elements._eqn;
    eqn.onClick = () => eqn.nextForm();
    eqn.setTouchable();
    eqn.showForm('1');
    // Create equation object then add to figure
    const eqn = figure.collections.equation({
    elements: {
    r: { symbol: 'radical' },
    plus: ' + ',
    },
    formDefaults: {
    alignment: { fixTo: 'd' },
    },
    forms: {
    1: {
    root: {
    symbol: 'r',
    content: ['a', 'plus', 'd'],
    },
    },
    2: { root: ['r', 'd'] },
    3: { root: { content: 'd', symbol: 'r', root: '_3' } },
    },
    formSeries: ['1', '2', '3'],
    });
    figure.add('eqn', eqn);
    eqn.onClick = () => eqn.nextForm();
    eqn.setTouchable();
    eqn.showForm('1');
    @interface