To make the election map described, we need to add two conditional statements. One for county_winner='gop' and another for county_winner='dem'. What we would expect is that within the condition, that only the polygons requested are considered in the classification.
CartoCSS
For example, in traditional CartoCSS that would be written like this:
So the logic here is first considering only counties won by a candidate and then second, splitting the class breaks only between the values of the requested polygons.
TurboCARTO
With TurboCARTO, whether you are doing manual classification or using one of our built-in classification methods (like equal), all polygons in the dataset are being considered.
For example, if we assigned this TurboCARTO to the elections results:
The reason I can tell that the output CartoCSS is not right and that TurboCARTO is not only respecting the requested polygons is because if a candidate won a county, there pct_ would be >50.
In addition to not respecting the conditions, we are encountering the same issue we are here with only two classes being colored for each candidate.
Autostyling is doing it properly when using something like a category widget. Basically, a widget treats a filter like a traditional CartoCSS condition, first, filtering on the condition and second, applying the TurboCARTO ramp.
@rochoa @saleiva
It looks like TurboCARTO is not respecting conditional CartoCSS statements.
Building on this issue: https://github.com/CartoDB/turbo-carto/issues/60
To make the election map described, we need to add two conditional statements. One for
county_winner='gop'
and another forcounty_winner='dem'
. What we would expect is that within the condition, that only the polygons requested are considered in the classification.CartoCSS
For example, in traditional CartoCSS that would be written like this:
So the logic here is first considering only counties won by a candidate and then second, splitting the class breaks only between the values of the requested polygons.
TurboCARTO
With TurboCARTO, whether you are doing manual classification or using one of our built-in classification methods (like
equal
), all polygons in the dataset are being considered.For example, if we assigned this TurboCARTO to the elections results:
The output CartoCSS is:
The reason I can tell that the output CartoCSS is not right and that TurboCARTO is not only respecting the requested polygons is because if a candidate won a county, there
pct_
would be >50.In addition to not respecting the conditions, we are encountering the same issue we are here with only two classes being colored for each candidate.
Autostyling is doing it properly when using something like a category widget. Basically, a widget treats a filter like a traditional CartoCSS condition, first, filtering on the condition and second, applying the TurboCARTO ramp.
.carto with TurboCARTO from above applied
Elections_ TurboCARTO with Condition (on 2016-12-23 at 03.14.06).carto.zip