Skip to content

Instantly share code, notes, and snippets.

View markmarkoh's full-sized avatar

Mark DiMarco markmarkoh

View GitHub Profile
// 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,
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 January 16, 2021 08:14
The many ways to fetch data from data.world

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 February 26, 2019 22:10 — forked from eesur/README.md
d3 | Force layout with images
@markmarkoh
markmarkoh / README.md
Last active September 18, 2016 01:25 — forked from mbostock/.block
Draw This Graph!

Example 'draw this chart' workflow

@markmarkoh
markmarkoh / README.md
Last active May 14, 2018 13:37 — forked from jefffriesen/README.md
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.

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

This converts it nicely:

@markmarkoh
markmarkoh / README.md
Last active March 15, 2016 16:10 — forked from efekarakus/README.md
Find Peaks

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 August 29, 2015 14:25
Converted Datamaps World Maps from 2 letter ISO code to 3 letter
//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",
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 August 29, 2015 14:05
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.