figureone
    Preparing search index...

    Equation fraction options

    A fraction has a numerator and denominator separated by a vinculum symbol EQN_VinculumSymbol.

    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: { frac: ['a', 'vinculum', 'b'] },
    },
    });
    figure.elements._eqn.showForm('1');
    // Example showing object and array fraction definitions, and nesting
    figure.add({
    name: 'eqn',
    make: 'equation',
    elements: {
    v1: { symbol: 'vinculum' },
    v2: { symbol: 'vinculum' },
    plus: ' + ',
    },
    forms: {
    // Fraction object form
    1: {
    frac: {
    numerator: 'a',
    denominator: 'b',
    symbol: 'v1',
    },
    },
    // Fraction array form
    2: { frac: ['a', 'v1', 'd'] },
    // Nested
    3: {
    frac: {
    numerator: [{ frac: ['a', 'v1', 'd', 0.7] }, 'plus', '_1'],
    symbol: 'v2',
    denominator: 'b',
    }
    },
    },
    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: {
    v1: { symbol: 'vinculum' },
    v2: { symbol: 'vinculum' },
    plus: ' + ',
    },
    forms: {
    1: {
    frac: {
    numerator: 'a',
    denominator: 'b',
    symbol: 'v1',
    },
    },
    2: { frac: ['a', 'v1', 'd'] },
    3: {
    frac: {
    numerator: [{ frac: ['a', 'v1', 'd', 0.7] }, 'plus', '_1'],
    symbol: 'v2',
    denominator: 'b',
    }
    },
    },
    formSeries: ['1', '2', '3'],
    });
    figure.add('eqn', eqn);
    eqn.onClick = () => eqn.nextForm();
    eqn.setTouchable();
    eqn.showForm('1');
    @interface