Skip to content

Instantly share code, notes, and snippets.

@ramiroaznar
Created February 15, 2017 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramiroaznar/0d2ece9f08fbf924c9b8dd7665b47cb0 to your computer and use it in GitHub Desktop.
Save ramiroaznar/0d2ece9f08fbf924c9b8dd7665b47cb0 to your computer and use it in GitHub Desktop.
TurboCARTO <> CartoCSS
/*** polygon-fill ***/
/* TurboCARTO */
polygon-fill: ramp([pop2005], cartocolor(Sunset), quantiles(7));
/* CartoCSS */
polygon-fill: #f3e79b;
[ pop2005 > 67827 ] {
polygon-fill: #fac484;
}
[ pop2005 > 456613 ] {
polygon-fill: #f8a07e;
}
[ pop2005 > 2253501 ] {
polygon-fill: #eb7f86;
}
[ pop2005 > 5416945 ] {
polygon-fill: #ce6693;
}
[ pop2005 > 10528226 ] {
polygon-fill: #a059a0;
}
[ pop2005 > 32270507 ] {
polygon-fill: #5c53a5;
}
/*** marker-width ***/
/* TurboCARTO */
polygon-fill: ramp([pop_max], range(1, 20), quantiles(7));
/* CartoCSS */
marker-width: 1;
[ pop_max > 9461 ] {
marker-width: 4.166666666666666;
}
[ pop_max > 27200 ] {
marker-width: 7.333333333333333;
}
[ pop_max > 53800 ] {
marker-width: 10.5;
}
[ pop_max > 98852 ] {
marker-width: 13.666666666666666;
}
[ pop_max > 187765 ] {
marker-width: 16.833333333333332;
}
[ pop_max > 440006 ] {
marker-width: 20;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment