Skip to content

Instantly share code, notes, and snippets.

@piensaenpixel
Last active May 10, 2016 16:38
Show Gist options
  • Save piensaenpixel/3fb05fbc44ac8737508b7ce9732cd00a to your computer and use it in GitHub Desktop.
Save piensaenpixel/3fb05fbc44ac8737508b7ce9732cd00a to your computer and use it in GitHub Desktop.
CartoCSS Elections
/** choropleth visualization */
#public{
polygon-fill: #cccccc;
line-color: #FFF;
line-width: 0.25;
line-opacity: 1;
[partido_ganador_2015 = 'PP'] {
polygon-fill: #0194d9;
}
[partido_ganador_2015 = 'PSOE'] {
polygon-fill: #f82433;
}
[partido_ganador_2015 = 'PODEMOS'] {
polygon-fill: #9c489e;
}
[partido_ganador_2015 = 'PODEMOS-COMPROMÍS'] {
polygon-fill: #9c489e;
}
[partido_ganador_2015 = 'EN COMÚ'] {
polygon-fill: #9c489e;
}
[partido_ganador_2015 = 'EAJ-PNV'] {
polygon-fill: #00914a;
}
[partido_ganador_2015 = "C's"] {
polygon-fill: #ef7a36;
}
[partido_ganador_2015 = "IU-UP"] {
polygon-fill: #8f2222;
}
[partido_ganador_2015 = "EH BILDU"] {
polygon-fill: #c3cf34;
}
[partido_ganador_2015 = "EB"] {
polygon-fill: #c3cf34;
}
[partido_ganador_2015 = "ERC-CATSI"] {
polygon-fill: #f79f21;
}
[partido_ganador_2015 = "ERC-CATSI"] {
polygon-fill: #f79f21;
}
[partido_ganador_2015 = "MÉS"] {
polygon-fill: #999999;
}
[partido_ganador_2015 = "NÓS"] {
polygon-fill: #9cc1e6;
}
[partido_ganador_2015 = "UNIO"] {
polygon-fill: #6699ff;
}
[partido_ganador_2015 = "DL"] {
polygon-fill: #19204b;
}
[partido_ganador_2015 = "GBAI"] {
polygon-fill: #e68272;
}
[partido_ganador_2015 = "CC"] {
polygon-fill: #ffff96;
}
[partido_ganador_2015 = "EN MAREA"] {
polygon-fill: #33ccff;
}
}
#public [ porcentaje_ganador <= 100] {
polygon-opacity: 1;
}
#public [ porcentaje_ganador <= 95] {
polygon-opacity: .95;
}
#public [ porcentaje_ganador <= 90] {
polygon-opacity: .9;
}
#public [ porcentaje_ganador <= 85] {
polygon-opacity: .85;
}
#public [ porcentaje_ganador <= 80] {
polygon-opacity: .8;
}
#public [ porcentaje_ganador <= 75] {
polygon-opacity: .75;
}
#public [ porcentaje_ganador <= 70] {
polygon-opacity: .7;
}
#public [ porcentaje_ganador <= 65] {
polygon-opacity: .65;
}
#public [ porcentaje_ganador <= 60] {
polygon-opacity: .6;
}
#public [ porcentaje_ganador <= 55] {
polygon-opacity: .55;
}
#public [ porcentaje_ganador <= 50] {
polygon-opacity: .5;
}
#public [ porcentaje_ganador <= 45] {
polygon-opacity: .45;
}
#public [ porcentaje_ganador <= 40] {
polygon-opacity: .4;
}
#public [ porcentaje_ganador <= 35] {
polygon-opacity: .35;
}
#public [ porcentaje_ganador <= 30] {
polygon-opacity: .3;
}
#public [ porcentaje_ganador <= 25] {
polygon-opacity: .25;
}
#public [ porcentaje_ganador <= 20] {
polygon-opacity: .2;
}
#public [ porcentaje_ganador <= 15] {
polygon-opacity: .15;
}
#public [ porcentaje_ganador <= 10] {
polygon-opacity: .1;
}
#public [ porcentaje_ganador <= 5] {
polygon-opacity: .05;
}
#public [ porcentaje_ganador = 0] {
polygon-opacity: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment