Torque is an open-source JavaScript library from CartoDB for time series map visualization.
- The simplest way to create a Torque time-lapse animation is to upload the data to a CartoDB account,
#!/bin/sh | |
# | |
# update_storyboard_strings.sh - automatically extract translatable strings from storyboards and update strings files | |
# Based on http://forums.macrumors.com/showpost.php?p=16060008&postcount=4 by mikezang | |
storyboardExt=".storyboard" | |
stringsExt=".strings" | |
newStringsExt=".strings.new" | |
oldStringsExt=".strings.old" | |
localeDirExt=".lproj" |
#!/usr/bin/python | |
import requests, os, pickle, datetime, zipfile, subprocess, csv | |
class FeedFetcher(): | |
def __init__(self, ddir=os.getcwd()): | |
self.ddir = ddir | |
self.tc = {} # time checks for GTFS fetches | |
self.new_use = [] # list of new feeds successfully downloaded and validated |
#!/usr/bin/env python | |
""" Parse JSON real-time bus data from SEPTA: | |
http://www3.septa.org/hackathon/ | |
""" | |
from datetime import datetime, timedelta | |
import json | |
import requests | |
import sys |
import gviz_api | |
from django.db.models.query import ValuesQuerySet | |
# mapping of model field types to google vizualization column types (all not | |
# in list are 'string' type) valid google viz data types are: 'string' | |
# 'number' 'boolean' 'date' 'datetime' 'timeofday' | |
fieldmap = {'DateField':'date','DateTimeField':'datetime','BooleanField':'boolean', | |
'IntegerField':'number','DecimalField':'number','BigIntegerField':'number', | |
'FloatField':'number','TimeField':'timeofday','NullBooleanField':'boolean'} |
#!/usr/bin/env python | |
from bs4 import BeautifulSoup | |
import requests, os, subprocess | |
from time import sleep | |
download_dir = os.getcwd() | |
soup = BeautifulSoup(open('ned_links.html','rb')) | |
of = open('just_ned_links.txt', 'wb') |
Torque is an open-source JavaScript library from CartoDB for time series map visualization.
The Chrome DevTools team gave this presentation at Google I/O 2016.
The code for the exact demo app used in their presentation apparently isn't public, but was based on the progressive web app CodeLabs demo, the code for which is here, in the 'final' directory.
Progressive web apps have a responsive design and define a manifest.json, which gives URLs for launcher icons and the start URL for the app. With the manifest.json in place, users can add the web app to their device home screen and launch it directly. Another common feature of progressive web apps is their use of service workers to cache resources, which allows them to load quickly, cut down on network use, and potentially work offline.
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" /> | |
<body class="container-fluid"> | |
<div class="topnav" id="topnav"> | |
<ul> | |
<li><a href="#About">About</a></li> | |
<li><a href="#Portfolio">Portfolio</a></li> | |
<li><a href="#Contact">Contact</a></li> | |
</ul> | |
</div> |
#!/usr/bin/python | |
import requests, os, pickle, datetime, zipfile, subprocess, csv | |
from bs4 import BeautifulSoup | |
class FeedFetcher(): | |
def __init__(self, ddir=os.getcwd(), get_nj=True, nj_username='', nj_pass=''): | |
self.ddir = ddir | |
self.get_nj = get_nj # whether to fetch from NJ TRANSIT or not | |
self.tc = {} # time checks for GTFS fetches |
#!/usr/bin/env python | |
from os import walk | |
from ftplib import FTP | |
from time import sleep | |
# 10 - DE | |
# 34 - NJ | |
# 36 - NY | |
# 42 - PA |