Desmos is very happy to announce the release of version 1.2 of the Desmos API.
This release is part of our scheduled release cycle, and we recommend all users upgrade to this version. Benefits of upgrading include:
remaining consistent with what students see on high-stakes tests in states where Desmos is embedded in the test platform.
offering an experience for students in your product similar to the one at desmos.com.
ensuring the best interaction with the latest browsers and platforms.
We will help all of our partners upgrade to version 1.2 in a timely fashion. Please email Chris Lusto (ch...@desmos.com) or Jason Merrill (ja...@desmos.com) with any questions.
New Features:
Version 1.2 includes new keypad styling, improved visual accessibility, more flexibility in updating API options and settings, and new features for working with domains and rational numbers.
Updated keypad styling. The keypads have all been updated with a modern, flat design that includes improved colors and contrast for better visual accessibility. As a result, the calculators are aligned with WCAG 2.1 guidelines.
More flexibility in changing options and settings. In previous versions, constructor options could only be set when creating a calculator instance, and graph settings could only be updated afterward. That distinction has been removed in version 1.2. Any combination of constructor options and graph settings may be passed into the constructor at instantiation, and any combination of constructor options and graph settings may also be updated at runtime through the updateSettings method.
Dynamic bounds. Domain bounds for parametric and polar graphs, as well as bounds and step sizes for sliders, can now be defined in terms of dynamic variables in addition to static constants. Graphs can have bounds that depend on slider values, and sliders can depend on each other, making it simpler than ever to create powerful, dynamic visualizations.
Support for rational numbers. For an expression that results in an evaluated numeric value, the calculators will try to detect whether the result is a (relatively simple) rational number and, if so, allow the user to choose between decimal and fraction output. This behavior is configurable via the decimalToFraction constructor option. For all numeric computations, the calculators will attempt to propagate rational values whenever feasible, leading to more intuitive output in many common situations where intermediate floating-point rounding errors might otherwise introduce confusion.
Improved accessibility. Version 1.2 continues our commitment to improving accessibility for users who interact with the calculators via screen readers and audio devices. Audio trace is enabled for more expression types: notably tables and point definitions. Tones are also now generated using custom waveforms, rather than relying on HTML5 audio synthesis methods, making the audio experience more consistent across browsers. Spoken contextual information is more accurately reported when using keyboard navigation inside of expressions involving sums, integrals, and products. For screen readers that support the aria-roledescription attribute, the calculators provide more useful, human-readable descriptions of objects and page elements.
Code Update:
Note that the decimalToFraction constructor option is enabled by default in the graphing and scientific calculators and disabled by default in the four-function calculator.
If there are places where you are creating a calculator instance and then immediately calling updateSettings to provide different default graph settings, you may wish to simplify that process and avoid an additional render by passing all of the relevant options and settings into the constructor at once.
The links constructor option in the graphing calculator is now also present in the basic calculators. If you have set links: false to remove external hyperlinks in a testing or otherwise restricted environment, you should consider setting it for the basic calculators as well.
It is now possible to set label size and orientation through GraphingCalculator.setExpression, if desired.
The capExpressionSize constructor option limits any expression’s length to 100 characters, which may be useful in highly restricted environments such as testing.
For partners who are self-hosting, the API can now be loaded as a CommonJS module and bundled using webpack and other CommonJS-compatible bundlers.