Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

4

You can use the new category Torque to change the marker-size and color if you have a limited amount of different categories (in this case, the number of letters). You just need a column with this number, use it in the Torque Cat wizard, and then you can check in the CartoCSS code the different options. There you'll be able to select width and color for the ...


3

Torque doesn't support polygons... yet! But you can experiment with D3, I took a first stab using D3 and CartoDB to achieve something, http://andrewxhill.github.io/cartodb-examples/intensity-time/index.html


3

You can apply the torqueLayer.hide() and torqueLayer.show() methods to control the display of your Torque layer. There is also the torqueLayer.setSQL('...') option. With all of these, you need to make sure that your data is not set to private because these do not work with named maps unless you add some additional parameters to the config file. A key thing ...


3

You could use a query like: WITH aux AS ( SELECT max(pntcnt) AS m FROM table_name ) SELECT t.*, (100.0*pntcnt)/aux.m AS norm_pntcnt FROM table_name t, aux to have a norm_pntcnt column with 0-100 values. Then in the CartoCSS, you could use something like: /** torque_heat visualization */ Map { -torque-frame-count:1; -torque-animation-...


2

You don't need a javascript query, you only need to know the number of bubbles per time and then get the change:time signal in torque layer. layer.on('change:time', function(datetime) { // update graph }) For number of bubbles you can get them from SQL API with a simple query or use this small hack I did some time ago https://gist.github.com/javisantana/...


2

Bubble size is defined by, marker-width. So a simple Torque style would be (pulling from your previous question), Map { -torque-frame-count:128; -torque-animation-duration:30; -torque-time-attribute:"time_column"; -torque-aggregation-function:"count(cartodb_id)"; -torque-resolution:2; -torque-data-aggregation:"cumulative"; } #table_name { marker-width: ...


2

You need to use the [value] value directly in the marker-width instead of using it in the constraints. Try this one: /** torque visualization */ Map { -torque-frame-count:16; -torque-animation-duration:10; -torque-time-attribute:"time"; -torque-aggregation-function:"avg(were_here)"; -torque-resolution:2; -torque-data-aggregation:linear; } #torque_sizes_ex{...


2

torque does not support marker-file and marker-fill at the same time, in other words, you can not color a sprite using marker fill. The workaround is to have an sprite per color.


2

All you should have to do is go to the time slider options. Change the Time Step interval to 1.0 and change it to Days. Time window should also be 1.0 days as well.


2

The Torque formatter is not editable via the CartoDB Editor at this moment. In order to edit it to show a different date format you'd need to use Javascript and the CartoDB.js library. You can check a working example here, but the key code is: cartodb.createVis('map', 'YOUR_TORQUE_VIZJSON_URL') .done(function(vis, layers) { //For CartoDB....


2

You can build your own torque-aggregation-function by playing a bit with maths. Let's say that your column is named floods. Then you could do: -torque-aggregation-function:"round(avg(floods))"; Please, take into account that the valuevariable of Torque is bounded by 255, so if your maximum values exceed this value (which seems that it does according to ...


2

That map uses the Leaflet extension L.terminator. This means that you need to build a map using the Leaflet and CartoDB.js library. Learning resources on CartoDB.js are in CartoDB's Map Academy. You specifically want to use the createLayer method for creating your map as it easily works with the Leaflet library's layers.


2

What @John Barça says in the comment above is true. No, Torque does not work with polygons. The Torque wizard is only available for points. Alternatively, there are other options that you could use to show different polygons with respect to time: The JavaScript API, CartoDB.js, enables you to add interactivity to your maps. In combination with our SQL API,...


2

The Torque value variable range is limited from 0 to 255 at the moment, and your data seem to contain values much higher than this threshold. You might want to normalize the data in the aggregation function or divide it by some quantity so that this value gets smaller (sum(pntcnt)/100). Depending on the nature of your data, just play with it and make sure ...


2

You could create new categories based upon two-variable conditions. Apply a query like this one: SELECT cartodb_id, time_column, the_geom_webmercator, numbers, categories CASE WHEN categories LIKE 'cat1' AND numbers <50 THEN 1 WHEN categories LIKE 'cat1' AND numbers >=50 THEN 2 WHEN categories LIKE 'cat2' AND numbers <50 ...


1

From 3.12 this has been changed, try with the following code instead: vis.timeSlider.formatter(function(d) return d.getUTCMonth()+"-"+ d.getUTCDay() + " "+ d.getUTCHours() + ":"+ d.getUTCMinutes(); })


1

You can't directly use column names in Torque's CartoCSS like you can with other types of maps. Instead, you need to let the torque-aggregation-function do the work for you. This function outputs a number called value that you can later use in the CartoCSS. It might seem weird to do it this way, but Torque bins data in time and space and then uses the ...


1

You can convert your number column to a date column by first creating a new column (button in the lower right corner), selecting 'date' as the data type, and then running the following SQL command to convert the numeric year to a date type: UPDATE table_name SET new_date_column = to_char(yr_num_column, 'YYYY')::date You will obviously have to change ...


1

We did some changes on the intervals of Torque. Yesterday we did a fix for this: if the data range is bigger than one year, then it'll show as always. I think this fix will solve your issue, as I'm seeing that you're using different years as the date.


1

This is not directly possible from the Editor at the moment, you need to use CartoDB.js for that. Check this example by @javisantana here. It's detecting the last torque step and pausing the reproduction there. <!DOCTYPE html> <html> <head> <title>Easy example | CartoDB.js</title> <meta name="viewport" content="initial-scale=...


1

I think you could do something with torque cat that they recently added. Create a column that contains the information about the group of ages that you want. Attribute each group age to one color and then you should be good to go.


1

You can create an empty column of type date and then populate it by using a SQL query. With the Postgres function to_timestamp you'll be able to add the pattern in which your dates are written so that you'll avoid the issue you're having with the automatic conversion. For example, if your dates are of the type: 2015-10-25 21:14:21 UPDATE tablename SET ...


1

First of all: the Torque option is not available because at the moment Torque only works on points. You can create a point table from your polygon table by using the following query in the SQL tab: SELECT ST_Centroid(the_geom) as the_geom, country, date, number, include_other_columns_here_separated_by_commas FROM your_table_name and selecting "Create ...


1

If you take a look at the tutorial: https://github.com/CartoDB/torque/wiki/How-spatial-aggregation-works you will see that the aggregation should change to: -torque-aggregation-function: "round(avg(type))"; instead of -torque-aggregation-function:"count(cartodb_id)";


1

We have done torque visualizations of 3,000,000+ points a few times* with no problem. We are also researching specialized indexes for tables used in torque visualizations that would make it even faster. That said, 100 million is a huge dataset. On the server side, torque can be a memory intensive, so I imagine you will hit the limit before this. *http://...


1

I would suggest building this using some custom js. Symbolize your data using the intensity type from the wizard in cartodb. Make sure there is a date or another field that can be used to show change over time Add a simple slider that represents the units for the user to see and that can be used to select a specific subset of your data. The code below ...


1

Ok so I found a cheat! I created a string field in my feature class (in the .gdb) and copied the values from my date field into the new string field (Ex: 17/02/2015 13:30:45). Then I altered the string so it matched the date format in CartoDB's Data View (2015-02-17T13:30:45Z) which is a SQL format for date-time I presume. I then exported my feature class as ...


1

In order to change the slider you have two options: create a custom one based on the default: https://github.com/CartoDB/cartodb.js/blob/develop/src/geo/ui/time_slider.js change current one styles with CSS, you just need to add a CSS file after loading cartodb.css


1

Yes, the FIFA 14 Torque map was created using Twitter data. CartoDB can import data directly from Twitter api. About Torque with graphs, you can check a great example in this link. Also, I would like to suggest you another great tool to create stories: Odyssey


1

In order to do that you would need to generate an extra column with the categories and apply the category wizard. Under the hood it uses mode (statistics function) to know in which category the point aggregation falls and using an extra color for each. Also torque does not allow values over 255 because it uses a byte to transfer the value. You could scale ...


Only top voted, non community-wiki answers of a minimum length are eligible