Skip to content

Instantly share code, notes, and snippets.

@wboykinm
Created July 18, 2014 01:34
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 wboykinm/95578d6d4a3a62044909 to your computer and use it in GitHub Desktop.
Save wboykinm/95578d6d4a3a62044909 to your computer and use it in GitHub Desktop.
CartoCSS stylesheet for national map of median household income by census block
Map {
background-color: #111;
}
#bg [b19013001>0] {
line-width:0;
line-opacity:0;
polygon-opacity:1;
polygon-fill:#FBEC5D;
[b19013001<25000]{polygon-opacity:0.01;polygon-gamma:1;}
[b19013001>=25000][b19013001<30000]{polygon-opacity:0.02;polygon-gamma:0.98;}
[b19013001>=30000][b19013001<35000]{polygon-opacity:0.04;polygon-gamma:0.96;}
[b19013001>=35000][b19013001<40000]{polygon-opacity:0.06;polygon-gamma:0.94;}
[b19013001>=40000][b19013001<45000]{polygon-opacity:0.1;polygon-gamma:0.9;}
[b19013001>=45000][b19013001<50000]{polygon-opacity:0.2;polygon-gamma:0.8;}
[b19013001>=50000][b19013001<55000]{polygon-opacity:0.3;polygon-gamma:0.7;}
[b19013001>=55000][b19013001<60000]{polygon-opacity:0.4;polygon-gamma:0.7;}
[b19013001>=60000][b19013001<65000]{polygon-opacity:0.45;polygon-gamma:0.7;}
[b19013001>=65000][b19013001<70000]{polygon-opacity:0.5;polygon-gamma:0.7;}
[b19013001>=70000][b19013001<75000]{polygon-opacity:0.6;polygon-gamma:0.6;}
[b19013001>=75000][b19013001<85000]{polygon-opacity:0.7;polygon-gamma:0.6;}
[b19013001>=85000][b19013001<100000]{polygon-opacity:0.8;polygon-gamma:0.5;}
[b19013001>=100000][b19013001<120000]{polygon-opacity:0.9;polygon-gamma:0.2;}
[b19013001>=120000]{polygon-opacity:1;polygon-gamma:0;}
}
#places [ADM0_A3='USA']{
[zoom>=9][POP_MAX>=100000][POP_MAX<1200000]{
marker-width:2;
marker-line-color:#333;
marker-line-opacity:0.7;
marker-line-width:0.8;
marker-fill:#fff;
marker-fill-opacity:0.9;
marker-allow-overlap:true;
marker-ignore-placement:true;
text-face-name:'Lucida Console Regular';
text-allow-overlap:true;
text-name:'[NAME]';
text-size:9;
text-fill:#e2e3e3;
text-character-spacing:2;
text-dx:6;
text-halo-fill:fadeout(#333,20%);
text-halo-radius:1.4;
text-clip:false;
text-wrap-width:18;
}
[zoom>=8][POP_MAX>=1200000][POP_MAX<2000000]{
marker-width:3;
marker-line-color:#333;
marker-line-opacity:0.7;
marker-line-width:0.8;
marker-fill:#fff;
marker-fill-opacity:0.9;
marker-allow-overlap:true;
marker-ignore-placement:true;
text-face-name:'Lucida Console Regular';
text-name:'[NAME]';
text-size:10;
text-fill:#e2e3e3;
text-character-spacing:2;
text-dx:6;
text-halo-fill:fadeout(#333,20%);
text-halo-radius:1.4;
text-clip:false;
text-wrap-width:18;
}
[zoom>=6][POP_MAX>=2000000][POP_MAX<4000000]{
marker-width:4;
marker-line-color:#333;
marker-line-opacity:0.7;
marker-line-width:0.8;
marker-fill:#fff;
marker-fill-opacity:0.9;
marker-allow-overlap:true;
marker-ignore-placement:true;
text-face-name:'Lucida Console Regular';
text-name:'[NAME]';
text-size:11;
text-fill:#e2e3e3;
text-character-spacing:2;
text-dx:6;
text-halo-fill:fadeout(#333,20%);
text-halo-radius:1.4;
text-clip:false;
text-wrap-width:18;
}
[zoom>4][POP_MAX>=4000000]{
marker-width:5;
marker-line-color:#333;
marker-line-opacity:0.7;
marker-line-width:0.8;
marker-fill:#fff;
marker-fill-opacity:0.9;
marker-allow-overlap:true;
marker-ignore-placement:true;
text-face-name:'Lucida Console Regular';
text-name:'[NAME]';
text-size:14;
text-fill:#e2e3e3;
text-character-spacing:1;
text-dx:6;
text-halo-fill:fadeout(#333,20%);
text-halo-radius:1.4;
text-clip:false;
text-wrap-width:18;
}
}
#states [zoom>5][PERIMETER>5]{
line-color:#999;
line-width:0.2;
line-opacity:0.9;
polygon-opacity:0;
/*text-face-name:'Lucida Console Regular';
text-name:'[STATE]';
text-size:13;
text-fill:#e2e3e3;
text-transform:uppercase;
text-character-spacing:2;
text-dx:0;
text-halo-fill:fadeout(#333,20%);
text-halo-radius:1.4;
text-clip:false;
text-wrap-width:18;
text-allow-overlap:false;*/
}
#land {
line-color:#333;
line-width:0;
polygon-opacity:1;
polygon-fill:#222;
}
#lakes {
line-color:#111;
line-width:0;
polygon-opacity:1;
polygon-fill:#111;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment