Skip to content

Instantly share code, notes, and snippets.

@auremoser
Last active August 29, 2015 14:18
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 auremoser/1b34dc9755ea7e70ec64 to your computer and use it in GitHub Desktop.
Save auremoser/1b34dc9755ea7e70ec64 to your computer and use it in GitHub Desktop.
Payscale US Stress Map

PayScale.com data packages provide some perspective on payrates and competitive salaries across the US. Data for stress across cities in the domestic USA is available via this data package.

<!DOCTYPE html>
<html>
<head>
<title>Payscale.com Map with Create Viz</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" />
<style>
html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
#header {
color: #3D8FCA;
font-family: 'Helvetica-Neue', sans-serif;
font-size: 24px;
padding-top: 10px;
padding-left: 20px;
text-align: left;
text-transform: uppercase;
}
#map {
background-repeat: no-repeat;
background-size: contain;
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 40px;
}
</style>
</head>
<body>
<div id="header">Payscale Map of U.S. Stress</div>
<div id="map"></div>
<!-- include cartodb.js library -->
<script src="http://libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script>
<!-- place your code between the script tags below -->
<script>
window.onload = function() {
var vizjson_url = 'http://aureliamoser.cartodb.com/api/v2/viz/a7977d1e-c826-11e4-a74e-0e0c41326911/viz.json'; // <-- Paste viz.json URL between quotes
var options = {
zoom: 4,
cartodb_logo: false,
layer_selector: true,
legends: true,
}
cartodb.createVis(map, vizjson_url, options) // <-- Change map_id to match your id in html
.done(function(vis, layers) {
// do stuff
console.log("Map successfully created");
})
.error(function(err) {
// report error
console.log("An error occurred: " + err);
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment