Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark DiMarco markmarkoh

View GitHub Profile
View index.js
// load the h3 json
fetch('hexed.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,
View make_h3.py
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
markmarkoh / README.md
Last active Mar 17, 2020
The many ways to fetch data from data.world
View README.md

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

Using a query URL

Python

import pandas as pd
df = pd.read_csv('https://query.data.world/s/zgl3zbtcq5rutbq63ttfo3lhoq4saj')
@markmarkoh
markmarkoh / README.md
Last active Sep 18, 2016 — forked from mbostock/.block
Draw This Graph!
View README.md

Example 'draw this chart' workflow

@markmarkoh
markmarkoh / README.md
Last active May 14, 2018 — forked from jefffriesen/README.md
US Zip Codes
View README.md

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.

http://geocommons.com/overlays/54893 (Thank you Bill Greer)

This converts it nicely:

@markmarkoh
markmarkoh / README.md
Last active Mar 15, 2016 — forked from efekarakus/README.md
Find Peaks
View README.md

This example illustrates how to use the findPeaks API. You can download the library from https://github.com/efekarakus/d3-peaks.

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
markmarkoh / convertExample.js
Last active Aug 29, 2015
Converted Datamaps World Maps from 2 letter ISO code to 3 letter
View convertExample.js
//src: http://country.io/iso3.json
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
markmarkoh / README.md
Last active Aug 29, 2015
Graticule & Orthographic Projections
View README.md

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.