Do a search for ".numeratorOptions = _.extend". Note the default options for numeratorOptions and denominatorOptions are often identical, or at least have significant overlap. Factor these out into constants.
Example in DoubleNumberLine, line 45:
// @public (read-only) options for the numerator (top) number line
this.numeratorOptions = _.extend( {
axisLabel: '', // {string} label for the axis
maxDecimals: 1, // {number} maximum number of decimal places
trimZeros: false // {boolean} whether to trim trailing zeros from decimal places
}, options.numeratorOptions );
// @public (read-only) options for the denominator (bottom) number line
this.denominatorOptions = _.extend( {
axisLabel: '', // {string} label for the axis
maxDecimals: 1, // {number} maximum number of decimal places
trimZeros: false // {boolean} whether to trim trailing zeros from decimal places
}, options.denominatorOptions );
The above would change to something like:
var SHARED_OPTIONS = {
axisLabel: '', // {string} label for the axis
maxDecimals: 1, // {number} maximum number of decimal places
trimZeros: false // {boolean} whether to trim trailing zeros from decimal places
};
// @public (read-only) options for the numerator (top) number line
this.numeratorOptions = _.extend( {}, SHARED_OPTIONS, options.numeratorOptions );
// @public (read-only) options for the denominator (bottom) number line
this.denominatorOptions = _.extend( {}, SHARED_OPTIONS, options.denominatorOptions );
Noted by @samreid in 3/15/18 dev meeting...
Do a search for ".numeratorOptions = _.extend". Note the default options for numeratorOptions and denominatorOptions are often identical, or at least have significant overlap. Factor these out into constants.
Example in DoubleNumberLine, line 45:
The above would change to something like: