From aafbf83d6c0129cadead413fc5e138a31e6d257c Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Fri, 6 Nov 2015 17:06:45 +0000 Subject: [PATCH] specifying initial columns in the cartoons --- examples/bi.html | 6 +++--- lib/torque/leaflet/torque.js | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/bi.html b/examples/bi.html index 6ddb0a5..ff7bba5 100644 --- a/examples/bi.html +++ b/examples/bi.html @@ -29,8 +29,8 @@ //color scale from http://colorbrewer2.org/ var CARTOCSS = [ 'Map {', - '-torque-time-attribute: "tpep_dropoff_datetime";', - '-torque-aggregation-function: "avg(temp::float)";', + '-torque-time-attribute: "transaction_date";', + '-torque-aggregation-function: "count(1);avg(confidence_score);merchant_name";', '-torque-frame-count: 1;', '-torque-animation-duration: 15;', '-torque-resolution: 1', @@ -63,7 +63,7 @@ var torqueLayer = new L.TorqueLayer({ user : 'stuartlynn', - table : 'sampled_taxi_data', + table : 'yodlee_512', cartocss: CARTOCSS, provider: "filterable_sql_api" }); diff --git a/lib/torque/leaflet/torque.js b/lib/torque/leaflet/torque.js index ab7d98f..e1ff9c8 100644 --- a/lib/torque/leaflet/torque.js +++ b/lib/torque/leaflet/torque.js @@ -30,10 +30,15 @@ L.TorqueLayer = L.CanvasLayer.extend({ this.key = 0; this.prevRenderedKey = 0; this._filters = {} + if (options.cartocss) { torque.extend(options, torque.common.TorqueLayer.optionsFromCartoCSS(options.cartocss)); } + + options.columns = options.countby.split(";") + + options.resolution = options.resolution || 2; options.steps = options.steps || 100; options.visible = options.visible === undefined ? true: options.visible;