From 093fc94076e50c1b1cb52408814bed2ea1a4c327 Mon Sep 17 00:00:00 2001 From: Francisco Dans Date: Thu, 14 Jan 2016 11:48:29 +0100 Subject: [PATCH] adds a valid torque css example --- doc/torque_api.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/doc/torque_api.md b/doc/torque_api.md index a8883a3..a2cdad0 100644 --- a/doc/torque_api.md +++ b/doc/torque_api.md @@ -84,21 +84,20 @@ TorqueLayer currently expects `marker` styling. #### Example -This CartoCSS example should be `string` encoded in Javascript. +This is how a minimal example of a stylesheet for a Torque visualisation would look like. -```scss +```css +Map { +-torque-time-attribute: "date"; +-torque-aggregation-function: "count(cartodb_id)"; +-torque-frame-count: 760; +-torque-animation-duration: 15; +-torque-resolution: 2; +} #layer { - marker-fill: #662506; - marker-width: 20; - [value > 1] { marker-fill: #FEE391; } - [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: 20; marker-fill-opacity: 0.05;}' // renders the previous frame - [frame-offset = 2] { marker-fill: red; marker-width: 30; marker-fill-opacity: 0.02;}' // renders two frames ago from the current being rendered + marker-width: 3; + marker-fill-opacity: 0.8; + marker-fill: #FEE391; } ```