Skip to content

Instantly share code, notes, and snippets.


Mark DiMarco markmarkoh

View GitHub Profile
View index.js
// load the h3 json
.then(r => r.json())
.then(data => {
// create a hex layer
const hexLayer = new deck.H3HexagonLayer({
id: 'h3-hex',
data: data,
pickable: false,
coverage: 0.9,
import h3
import csv
import json
with open('./thor_filtered.csv', newline='') as csvfile:
line = csv.reader(csvfile, delimiter=',')
lines = 0
results = {}
for row in line:
lines += 1
markmarkoh /
Last active Mar 17, 2020
The many ways to fetch data from

Every file and query on is an API endpoint to be consumed via any language or application. Here are a few common examples:

Using a query URL


import pandas as pd
df = pd.read_csv('')
markmarkoh /
Last active Sep 18, 2016 — forked from mbostock/.block
Draw This Graph!

Example 'draw this chart' workflow

markmarkoh /
Last active May 14, 2018 — forked from jefffriesen/
US Zip Codes

This is a d3.js visualization of US zip codes.

Original zip code dataset from Geocommons.

5MB shapefile with properties such as zipcode, state, name, population, area, more. (Thank you Bill Greer)

This converts it nicely:

markmarkoh /
Last active Mar 15, 2016 — forked from efekarakus/
Find Peaks

This example illustrates how to use the findPeaks API. You can download the library from

The algorithm is based on "Improved peak detection in mass spectrum by incorporating continuous wavelet transform-based pattern matching" by Pan Du, Warren A. Kibbe and Simon M. Lin. The paper can be found here.

markmarkoh / convertExample.js
Last active Aug 29, 2015
Converted Datamaps World Maps from 2 letter ISO code to 3 letter
View convertExample.js
var isoCodeConverterData = {"BD": "BGD", "BE": "BEL", "BF": "BFA", "BG": "BGR", "BA": "BIH", "BB": "BRB", "WF": "WLF", "BL": "BLM", "BM": "BMU", "BN": "BRN", "BO": "BOL", "BH": "BHR", "BI": "BDI", "BJ": "BEN", "BT": "BTN", "JM": "JAM", "BV": "BVT", "BW": "BWA", "WS": "WSM", "BQ": "BES", "BR": "BRA", "BS": "BHS", "JE": "JEY", "BY": "BLR", "BZ": "BLZ", "RU": "RUS", "RW": "RWA", "RS": "SRB", "TL": "TLS", "RE": "REU", "TM": "TKM", "TJ": "TJK", "RO": "ROU", "TK": "TKL", "GW": "GNB", "GU": "GUM", "GT": "GTM", "GS": "SGS", "GR": "GRC", "GQ": "GNQ", "GP": "GLP", "JP": "JPN", "GY": "GUY", "GG": "GGY", "GF": "GUF", "GE": "GEO", "GD": "GRD", "GB": "GBR", "GA": "GAB", "SV": "SLV", "GN": "GIN", "GM": "GMB", "GL": "GRL", "GI": "GIB", "GH": "GHA", "OM": "OMN", "TN": "TUN", "JO": "JOR", "HR": "HRV", "HT": "HTI", "HU": "HUN", "HK": "HKG", "HN": "HND", "HM": "HMD", "VE": "VEN", "PR": "PRI", "PS": "PSE", "PW": "PLW", "PT": "PRT", "SJ": "SJM", "PY": "PRY", "IQ": "IRQ", "PA": "PAN", "PF": "PYF",
View topojson.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
markmarkoh /
Last active Aug 29, 2015
Graticule & Orthographic Projections

Graticule && Orthographic Projections

In the latest datamaps (v0.3.4), you can specify orthographic as your projection to show a map in a more 'globe' like fashion.

Additionally you can specify the rotation through projectionConfiguration, which is a new configuration block that I'll be building out for more control over projections.

You can’t perform that action at this time.