Go to file
2014-03-24 14:57:23 +01:00
css/jqueryui-smoothness scrubbable torque 2013-03-29 18:43:29 -07:00
dist updated torque 2014-03-21 15:57:51 +01:00
doc updated api 2013-11-11 16:55:34 +01:00
examples fixed ow-scrub example 2013-12-02 18:27:19 +01:00
img added example pause/play button 2013-04-02 20:50:49 -04:00
lib/torque fixed animation for leaflet 0.7.x 2014-03-24 14:57:23 +01:00
template recenter 2013-04-22 11:37:12 -04:00
test fixed windshaft provider with https 2014-02-25 16:04:20 +01:00
vendor updated carto 2013-11-26 18:39:28 +01:00
.gitignore build scripts 2013-07-30 10:45:35 +02:00
index.html fixed index 2014-02-25 09:12:29 +01:00
LICENSE.txt more cleanup 2012-09-30 20:50:13 -04:00
Makefile fixed diet file creation 2013-08-29 15:21:39 +02:00
NEWS updated news 2014-03-21 15:56:56 +01:00
package.json news and package for 2.3.0 2014-02-24 14:36:26 +01:00
README.md updated readme example 2013-11-27 11:06:48 +01:00

Torque

Render big, timeseries data in the client. Uses CartoDB to generate a datacube format. For a brief introduction to the format and methods, see our presentation slides

CartoDB users can use this code right away. Specify your username/tablename and datecolumn to get mapping time immediatley.

Have fun!

Torque library reference

Torque lets you render big, timeseries or categorical data in the client. This is useful for many modern applications that need more than just a static map. Early versions of Torque have been used to visualize human movement, Twitter activity, biodiversity data, and many more large-scale datasets.

The library uses CartoDB to generate a layercube format. For a brief introduction to the format and methods, see our presentation slides. If you are not using CartoDB to host your data, you can modify the input parameters to point toward any layercube service.

Getting started

The simplest way to use a visualization with Torque is...

Create a simple Torque visualization
``` javascript ...
... // define the torque layer style using cartocss var CARTOCSS = [ 'Map {', '-torque-time-attribute: "date";', '-torque-aggregation-function: "count(cartodb_id)";', '-torque-frame-count: 760;', '-torque-animation-duration: 15;', '-torque-resolution: 2', '}', '#layer {', ' marker-width: 3;', ' marker-fill-opacity: 0.8;', ' marker-fill: #FEE391; ', ' comp-op: "lighten";', ' [value > 2] { marker-fill: #FEC44F; }', ' [value > 3] { marker-fill: #FE9929; }', ' [value > 4] { marker-fill: #EC7014; }', ' [value > 5] { marker-fill: #CC4C02; }', ' [value > 6] { marker-fill: #993404; }', ' [value > 7] { marker-fill: #662506; }', ' [frame-offset = 1] { marker-width: 10; marker-fill-opacity: 0.05;}', ' [frame-offset = 2] { marker-width: 15; marker-fill-opacity: 0.02;}', '}' ].join('\n');
  var map = new L.Map('map', {
    zoomControl: true,
    center: [40, 0],
    zoom: 3
  });

  L.tileLayer('http://{s}.api.cartocdn.com/base-dark/{z}/{x}/{y}.png', {
    attribution: 'CartoDB'
  }).addTo(map);

  var torqueLayer = new L.TorqueLayer({
    user       : 'viz2',
    table      : 'ow',
    cartocss: CARTOCSS
  });
  torqueLayer.addTo(map);
  torqueLayer.play()

<script>
[Grab the complete example source code](https://github.com/CartoDB/torque/blob/master/examples/navy_leaflet.html)
<div class="margin20"></div>

### API
[see reference](https://github.com/CartoDB/torque/blob/master/doc/API.md)