Skip to content

Instantly share code, notes, and snippets.

@pbogden
pbogden / README.md
Last active August 29, 2015 14:27
symbols

D3 symbols

@pbogden
pbogden / README.md
Last active September 2, 2015 21:31
umbc

Earthquake demo for class #2

@pbogden
pbogden / README.md
Last active September 9, 2015 09:43
demo

Hints for the homework assignment:

Hint #1: Combine "index.html" from this gist with the bar chart that we discussed in class.

Hint #2: Instead of the "data" array in the bar chart, [4, 8, 15, 16, 23, 42], you should use an array of data values (earthquake magnitudes) that you obtain from the USGS API.

Hint #3: The array of data values is actually the "feature" property of the data object that you get from the USGS API. You will need to work with this "data.feature" array to solve the homework.

Hint #4: Use the developer console to inspect things.

@pbogden
pbogden / README.md
Last active September 9, 2015 22:07
umbc #2

Solution to homework from Class #2

Assignment: Create a bar chart showing the number of earthquakes of magnitude [0 - 1), [1 - 2), [2 - 3), etc. Using data from the USGS real-time earthquake feed.

The idea is to combine what we learned about the USGS API with the bar chart from Mike Bostock's most excellent Let's Make a Bar Chart, the code for which is here. To help get you started, this demo shows how to access and inspect data from the USGS earthquake API.

@pbogden
pbogden / README.md
Last active September 10, 2015 16:52
umbc countries

Template for countries.

@pbogden
pbogden / README.md
Last active September 10, 2015 17:08
umbc states

Template for US states.

@pbogden
pbogden / README.md
Last active September 14, 2015 10:55
filupmybowl v2

Bravo to Philip for his block. This version is only slighly modified.

Changes:

  • Cleaned up and documented a bit
  • Used the one-month USGS feed.

There are two sections where you could consider working with the data (exercising the array methods discussed in class). I've indicated them with comments. For example, you could filter the earthquake data and/or the countries -- both are available as arrays. You should also try experimenting with the CSS, to change the styling of the map.

@pbogden
pbogden / README.md
Last active September 22, 2015 00:00
suzee v2

Slightly modified version of Suzee's block. Changes:

  1. plotQuakes & getQuakes are separate -- setTimeout calls plotQuakes
  2. window.setTimeout is inside getQuakes, where its argument is defined
  3. info message also indicates when the quakes are added
@pbogden
pbogden / README.md
Last active September 27, 2015 21:34
suzee5

Changes to assignment #5. I believe this one does what you want. 3 changes are noted.

@pbogden
pbogden / README.md
Last active October 6, 2015 23:19
suzee6

Various homework assignments for Fall 2015