Skip to content

Instantly share code, notes, and snippets.

@mtaptich
mtaptich / README.md
Last active May 28, 2019 05:09
Simple Traveler

Simple example of displaying a route in Leaflet using d3.js.

@mtaptich
mtaptich / README.md
Last active May 28, 2019 05:08
For Loop

The first of a series of data visualizations on basic coding concepts. The for loop continues as long as our circle fits (e.g., our condition)!

@mtaptich
mtaptich / index.html
Last active May 28, 2019 05:07
MUNI Greenhouse Gas Emissions (Realtime)
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<style>
html{
background-color: #000;
}
body {
width: 1024px;
@mtaptich
mtaptich / README.md
Last active March 12, 2018 03:17
Filter map with slider in d3.js

A simple way to filter spatial data in d3.js using HTML5 range input slider.

Data: The greenhouse gas emissions needed to ship logs for lumber, pulping, etc. to Chicago by a combination of rail and truck freight modes. We call the spatial extent in which trade is possible given an environmental budget a freightshed. Read more about this concept, DOI: 10.1021/acs.est.5b01697.

@mtaptich
mtaptich / README.md
Last active February 17, 2018 03:22
While Loop

The third of a series of data visualizations on basic coding concepts. The while loop will run while the circle is out of the box. When our condition is FALSE, the model stops. The model reactivates upon TRUE (which is not always the case).

@mtaptich
mtaptich / README.md
Last active August 1, 2016 01:37
k-means + d3.js

An example of K-means clustering in d3.js.

We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 58 columns, instead of 7. in line 2.
exporting_country,United States,China,Germany,France,United Kingdom,Japan,Italy,Canada,Korea,Spain,Netherlands,India,Mexico,Belgium,Russian Federation,Australia,Switzerland,Chinese Taipei,Brazil,Singapore,Poland,Ireland,Sweden,Saudi Arabia,Austria,Malaysia,Turkey,Thailand,Denmark,Indonesia,Czech Republic,Norway,Greece,Finland,Hungary,"Hong Kong, China",Portugal,Viet Nam,South Africa,Luxembourg,Israel,Slovak Republic,Romania,Philippines,Argentina,Chile,New Zealand,Bulgaria,Slovenia,Lithuania,Latvia,Estonia,Cyprus,Cambodia,Malta,Iceland,Brunei Darussalam
United States,1,111955.9,74435,51782.3,77745.3,89562.1,24319.9,213176.9,44279.2,21442.1,33111.1,28761.5,126533.1,15768.9,13912.6,28923.3,12717.2,24182.8,33361.2,25467.1,6441.3,44732.8,11847.8,18816.2,6383.9,19952.4,9994.3,12478.9,9168.9,11288.5,3893.6,8359.9,6815.9,5666.1,4141.2,9852.9,2673.7,4453.2,7556.4,5353.9,11168.5,1673.4,1887.7,8626.4,8175.5,9872.5,4132.5,1114.5,1297.4,778,656.4,676,734.7,843.3,635,687.3,592.7
China,289963.9,1,68753.2,42191.1,39545.3,111
@mtaptich
mtaptich / README.md
Created December 18, 2015 19:04
d3.js + dijkstra
@mtaptich
mtaptich / Readme.md
Last active July 27, 2016 15:29
Urban Dynamometer Driving Schedule

Urban Dynamometer Driving Schedule is the standardized dynamometer test on fuel economy that represents city driving conditions for light-duty vehicles.

@mtaptich
mtaptich / README.md
Last active June 23, 2016 20:15
EIO-LCA Visualization

Economic Input-Output Life Cycle Assessment (EIO-LCA) is a method to quantify the material, energy, and environmental impacts resulting from activities in our economy. The Economic Input-Output (EIO) method was first formalized by Nobel Prize winning economist, Wassily Leontief, in the 1970s. It took two decades before the computation performance of modern computers was sufficient enough to utilize this model at scale. Since the mid-1990s, EIO-LCA has been used to estimate economy-wide environmental impacts of many products and services, such as automobiles, refrigerators, computers, paper, retail trade, food systems, etc.

In this illustrative example, I model a simple economy consisting of three industrial sectors: steel, electric