Libraries Help Solve Commonly-Faced Issues. Here's A Few To Make Development Easier
Libraries Help Solve Commonly-Faced Issues. Here's A Few To Make Development Easier
1 4
Do the Mathey Floating number accuracy is another topic in JavaScript Hotkeys
https://mathjs.org runtimes. Math.JS solves this problem by providing a https://wangchujiang.
While the JavaScript language standard does fixed-point floating number implementation — simply set com/hotkeys
contain quite a few mathematical functions, it — of the desired precision, and raise your decimal number: Providing a keyboard-driven interface
course — is in no way complete. endears products to power users. This
One feature which is commonly missed involves math.bignumber(‘2.3e+500’) BigNumber, 2.3e+500 library takes care of the often-fussy
complex numbers. Math.JS provides a relatively details of keyboard management,
easy-to-use API whose basic usage looks like this: Keep in mind that BigNumber and its various classes are leaving you to focus on realising the
not a panacea cure for all digital problems. Fixed point business logic. Getting started
const a = math.complex(2, 3) arithmetic is known to be a lot slower than hardware- requires less than ten lines of code!
print(a.re) 2 accelerated float maths —if you don’t have a good reason
5
print(a.im) 3 to use higher accuracy, better make do without it. Toggle-a-Gogo!
twikito.github.io/
easy-toggle-state
Enabling and disabling GUI elements
programmatically is an old, yet
recurring task. Easy-toggle-state
provides a neat way around the
never-ending task — group elements
together, and switch them on and off
without breaking a sweat.
6
AutoNumeric
http://autonumeric.org
Making numbers look good
across locales is difficult. AutoNumeric
is a library dedicated to the number
formats and currencies of the world.
Simply pass in a numeric variable, and
feast your eyes on a string. The library
can also “monitor” text fields to make
them look better.
2
Map tile handling
https://leafletjs.com
7
If you manage to get your Data-driven SVG manipulation
hands onto a tile source, you quickly https://d3js.org
find out that having map tiles is but D3 creates data bindings between arbitrary
half a month’s rent. Leaflet provides DOM objects and elements stored in the code behind.
a relatively comprehensive tile This means that the look of the web site can be
rendering infrastructure, which takes customised flexibly in dependence of stored data.
care of bringing them on-screen in a D3 differs from traditional diagramming libraries in
flexible fashion. that it does not provide any templates. If you, for
example, seek to create a pie chart, better start out by
3
Keyframes, bringing in rectangles and adding data bindings to
made easy compute height et al.
https://animejs.com The library shines whenever extremely complex
Anime.JS provides a comfortable-to- and/or animated visualisations are required and the
use implementation of the keyframe setup time is not an issue. One popular example
animation pattern. Specify the start would be choropleth maps, commonly used in
state, the end state and an easing election reporting. This, of course, is a tiny overview
function — library and browser will — further tutorials can be found at https://github.
use CSS transforms to ensure that com/d3/d3/wiki/Tutorials.
your animations are run with
optimal speed.
48 _________________________________________________feature