Skip to content
Dave Landry edited this page Apr 30, 2015 · 3 revisions

## Library Dependencies Various 3rd Party libraries are needed in order to run DataViva.

### D3.js The main javascript library that we use throughout the entire site. Similar to jQuery, it creates simple shorthand for a lot of commonly used javascript functions. Where D3 differs from jQuery is that it was made with data visualization in mind, and enables the ability to act quickly and efficiently on large data objects. From the developer:

D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.

Full documentation can be found here.

### D3plus D3plus is an extension to the D3 library that allows quicker and easier creation of the visualizations used in DataViva.

Full documentation can be found here.

### Zoomable Tiles A D3 plug-in that enables tile based geographica maps. The D3plus Geo Map depends on this library being present.

Full documentation can be found here.

### TopoJSON Another D3 plug-in that enables the D3plus Geo Map to use topoJSON files as coordinates. TopoJSON files are quicker, more efficient, and have a smaller footprint than standard geoJSON files. From the developer:

Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs. This technique is similar to Matt Bloch’s MapShaper and the Arc/Info Export format, .e00. TopoJSON eliminates redundancy, allowing related geometries to be stored efficiently in the same file.

Full documentation can be found here.

For DataViva, shape files (.shp) for the geography of Brazil were downloaded from the IBGE website, converted to geoJSON, and then converted to topoJSON.

### Queue.js Queue.js is a small helper library that allows the apps in DataViva to invoke multiple asynchronous data calls at once, and wait for them all to complete before moving on.

Full documentation can be found here.

### Leon Leon is a library that converts standard HTML input elements (such as radio buttons, select lists, and range sliders) into more attractive and cross-browser uniform inputs.

Full documentation can be found here.

### localForage A library from Mozilla which allows for smart cross-browser local storage caching. DataViva caches all attribute data queries in local browser storage for faster visualizations.

Full documentation can be found here.

### Redactor For the rich-text forms in the “Contact Us” page of DataViva, we use a library called Redactor. This enables easy HTML formatting of questions and replies, along with Portuguese translations for words such as “Bold” and “Italic”. Redactor requires jQuery to be installed for it to work, but is the only place in the entire site we need jQuery.

Full documentation can be found here.

### JQuery While JQuery is usually used as a site-wide framework for making Javascript DOM manipulation easier, DataViva loads it only as a dependency for Redactor.

### Modernizr To detect what features are available in a user’s browser, we use Modernizr. DataViva uses Modernizr to detect if the use is using a touch or mouse based device, along with knowing whether or not their browser supports live updating of the URL (for example, when you change settings on an app the URL changes dynamically).

Full documentation can be found here.

### Moment.js Moment.js is a javascript library that enables easy date and time manipulation. DataViva uses moment.js in the “Contact Us” page to display datetimes as “4 months ago”, rather than just showing the date posted.

Full documentation can be found here.

Clone this wiki locally