Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Load GeoJSON from a URL</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.mapbox.com/mapbox.js/v2.3.0/mapbox.js'></script> | |
<link href='https://api.mapbox.com/mapbox.js/v2.3.0/mapbox.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Global variables | |
var ss = SpreadsheetApp.getActiveSpreadsheet(), | |
sheet = ss.getActiveSheet(), | |
activeRange = ss.getActiveRange(), | |
settings = {}; | |
var geocoders = { | |
yahoo: { | |
query: function(query, key) { | |
return 'http://where.yahooapis.com/geocode?appid=' + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//assuming jQuery is available | |
//attach events to the nav buttons above datasets | |
$('#sidebarOptions').on('click', 'a', function() { | |
var dataset = $('#datasetName').attr('title'); | |
var label = $(this).attr('title'); | |
//labels sent to google analytics on click events will include the dataset name and the label of the button | |
//this gives greater insight into how users are interacting with datasets once they arrive | |
ga('send', 'event', 'Data Panel', 'Click', dataset + ': ' + label); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Connects to the Socrata search API and loads data describing the tabular datasets in the catalog for use by D3 tree map | |
#This version connects to a list of existing Socrata instances and loops through the ones categorized as city | |
#Use: python dataportalapi.py > portaldata.json | |
import requests, json, math, re | |
def check_categories(d,category): | |
for i in range(len(d)): | |
if d[i]['name'] == category: return i | |
return -1 |