Skip to content

Instantly share code, notes, and snippets.

View domoritz's full-sized avatar
📊
charting new territory

Dominik Moritz domoritz

📊
charting new territory
View GitHub Profile
@domoritz
domoritz / Potential_JavaScript_API_for_Vega-Lite.js
Last active October 28, 2016 13:41
Potential JS API for Vega-Lite (akin to Altair)
/// FIGURE 2
var weather = vl.data()
.url('data/weather.csv')
.format('csv');
// Line chart with aggregation
var fig2a = vl.line()
.data(weather)
.x(vl.month('date'))
.y(vl.mean('temp_max'))
@domoritz
domoritz / Gemfile
Created March 4, 2016 00:23
Gemfile for github pages
source 'https://rubygems.org'
require 'json'
require 'open-uri'
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
gem 'github-pages', versions['github-pages']
@domoritz
domoritz / data.csv
Last active March 27, 2017 01:38
Compute mean delay and error for flight delay data
DayOfWeek DepTimeBlk DepDelay StdMeanErr
1 0001-0559 8.897969052224372 1.230957811414512
1 0600-0659 6.929324482623975 0.7006511663457965
1 0700-0759 7.723363774733638 0.5806981413397009
1 0800-0859 11.068298460323726 0.598413615307324
1 0900-0959 12.297140399913998 0.5771583231861239
1 1000-1059 14.13575152041703 0.612918392530587
1 1100-1159 15.679030558482614 0.6671801433858121
1 1200-1259 17.7011925795053 0.683686132015881
1 1300-1359 17.65929583512237 0.719630306303089
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"description": "A simple bar chart with embedded data.",
"data": {
"values": [
{"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43},
{"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53},
{"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52}
]
},
{
"data": {
"values": [
{"date": "20010101", "close": "1"},
{"date": "20010102", "close": "2"},
{"date": "20010103", "close": "3"}
],
"format": {
"parse": {
"date": "date:'%Y%m%d'"
@domoritz
domoritz / europe_world_bank.csv
Last active April 29, 2017 06:16
Population data for Europe for 2015 from the world bank
Code Country Population_ages_15_64_of_total Population_ages_65_and_above_of_total
ALB Albania 69.0574620108062 12.3963338706153
ARM Armenia 70.7901217876325 10.8259833940416
AUT Austria 67.0332301646914 18.7591300503032
AZE Azerbaijan 72.4553638068118 5.62608981288436
BLR Belarus 69.9508710458679 13.9809217228707
BEL Belgium 64.8307418795963 18.2248164293518
BIH Bosnia and Herzegovina 71.0579632250127 15.4439567753232
BGR Bulgaria 65.8285064995643 20.0274777416446
CHI Channel Islands 68.022872223444 17.2684065195611
@domoritz
domoritz / .block
Last active June 4, 2017 21:06
Demo of config override bug
license: bsd-3-clause
@domoritz
domoritz / .block
Last active June 28, 2017 01:02
Grouped Bar Chart
license: bsd-3-clause
@domoritz
domoritz / spec.json
Created July 25, 2017 18:23
Airline Delays: Heatmap
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": {
"url": "https://gist.githubusercontent.com/domoritz/1ca6a741fbfb0a64396e40f233ae6f21/raw/1b1e1e3cb5d112760fbc0fe620e1eeb6558bbdf3/delays.csv"
},
"width": 800,
"height": 400,
"mark": "rect",
"encoding": {
"x": {
@domoritz
domoritz / spec.json
Last active July 25, 2017 18:23
Airline Delays: Scatterplot
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": {"url": "https://gist.githubusercontent.com/domoritz/1ca6a741fbfb0a64396e40f233ae6f21/raw/1b1e1e3cb5d112760fbc0fe620e1eeb6558bbdf3/delays.csv"},
"width": 800,
"height": 400,
"mark": "point",
"encoding": {
"x": {"field": "DepDelay", "type": "quantitative"},
"y": {"field": "ArrDelay", "type": "quantitative"}
}