Skip to content

Instantly share code, notes, and snippets.

View nautilytics's full-sized avatar

Nautilytics nautilytics

View GitHub Profile
@nautilytics
nautilytics / brazil_soybean_production.csv
Last active December 26, 2015 13:29
Dynamic Production Forecasting
year value
1961 271488
1962 345175
1963 322915
1964 304897
1965 523176
1966 594975
1967 715606
1968 654476
1969 1056610
@nautilytics
nautilytics / ag_districts_counties.json
Last active December 26, 2015 16:59
NASS Corn Acres Planted 2000 to 2012
{"2710": {"name": "Northwest", "counties": [27005, 27027, 27029, 27069, 27087, 27089, 27107, 27113, 27119, 27125, 27135]}, "4120": {"name": "North Central", "counties": [41021, 41027, 41049, 41055, 41065]}, "2960": {"name": "East", "counties": [29055, 29071, 29073, 29099, 29113, 29139, 29157, 29183, 29186, 29187, 29189, 29193, 29219, 29221, 29510]}, "210": {"name": "Tanana Valley", "counties": [2090, 2240, 2290]}, "1780": {"name": "Southwest", "counties": [17003, 17027, 17077, 17087, 17133, 17145, 17153, 17157, 17163, 17181, 17189, 17199]}, "2650": {"name": "Central", "counties": [26035, 26051, 26057, 26073, 26107, 26111, 26117, 26133]}, "3920": {"name": "North Central", "counties": [39005, 39033, 39043, 39077, 39093, 39123, 39139, 39143, 39147, 39175]}, "2840": {"name": "Lower Delta", "counties": [28053, 28055, 28083, 28125, 28133, 28151, 28163]}, "4720": {"name": "West Tennessee", "counties": [47005, 47017, 47023, 47033, 47039, 47047, 47053, 47069, 47071, 47075, 47077, 47079, 47109, 47113, 47183]}, "3960":
{"SVN": {"HUN": 8.0, "AUT": 21.0, "ITA": 274633.0}, "BEN": {"GHA": 180.0, "TGO": 167.0}, "BEL": {"GRC": 51.0, "LUX": 30.0, "DEU": 18721.0, "BGR": 22.0, "GBR": 12225.0, "ROM": 20.0, "MYS": 1.0, "PRT": 1.0, "POL": 3872.0, "NLD": 109004.0, "GAB": 1622.0, "FRA": 31929.0, "SVK": 52.0, "LTU": 226.0, "ESP": 2.0, "DNK": 152.0, "AUT": 70.0, "FIN": 2592.0, "MAR": 5.0, "TUR": 3.0, "ITA": 660.0, "RUS": 32.0, "HUN": 587.0, "CZE": 1387.0}, "LUX": {"BEL": 5.0, "NOR": 260.0}, "TGO": {"GHA": 120.0, "ESP": 315.0}, "GHA": {"TGO": 2.0}, "DEU": {"SRB": 1.0, "BEL": 7393.0, "LUX": 41.0, "SWE": 2001.0, "GBR": 282.0, "CAN": 20.0, "CHE": 31.0, "ROM": 1.0, "HUN": 93.0, "PRT": 91.0, "POL": 1208.0, "NLD": 4559.0, "SVN": 8.0, "FRA": 2650.0, "EST": 2.0, "SVK": 121.0, "LTU": 2.0, "ESP": 96.0, "DNK": 5762.0, "IRL": 2.0, "GRC": 3.0, "TUR": 5.0, "ITA": 98.0, "AUT": 2090.0, "ARE": 1.0, "LVA": 1.0, "NOR": 3.0, "CZE": 12637.0}, "PER": {"ECU": 109.0, "CHL": 1.0, "USA": 10.0}, "LKA": {"JOR": 9.0, "GBR": 26.0, "CHE": 1.0}, "IDN": {"TMP": 291.0, "MYS
@nautilytics
nautilytics / corn_yields_1972_to_2012.json
Last active December 26, 2015 21:19
farmdoc Crop Insurance Decision Tool
This file has been truncated, but you can view the full file.
{"2003": {"48357": 198.4, "16073": 139.2, "16075": 140.9, "06115": 175.0, "06113": 174.6, "13023": 130.0, "40145": 95.7, "19159": 104.8, "39109": 167.4, "19155": 127.0, "39105": 95.4, "19157": 172.9, "39107": 156.0, "19151": 168.1, "39101": 162.0, "19153": 165.3, "39103": 135.7, "22009": 126.1, "40027": 100.0, "40025": 162.2, "06029": 170.0, "06021": 176.8, "40023": 127.8, "06023": 180.0, "06025": 147.5, "27173": 141.0, "27171": 118.0, "21101": 140.0, "21103": 119.0, "21105": 138.0, "21107": 135.0, "47081": 131.0, "26157": 129.0, "42055": 118.9, "26155": 117.0, "42057": 100.2, "42051": 81.8, "26151": 121.0, "42053": 105.0, "42059": 100.9, "12013": 82.5, "51115": 111.0, "46009": 100.0, "51113": 120.0, "46003": 80.2, "46007": 140.5, "46005": 63.4, "17031": 141.0, "17033": 144.0, "17035": 159.0, "17037": 170.0, "17039": 181.0, "26023": 138.0, "05003": 140.0, "26021": 122.0, "05001": 180.0, "26027": 127.0, "26025": 127.0, "12121": 80.6, "26029": 108.0, "01021": 77.0, "37009": 0.0, "37007": 95.0, "37003": 104.0, "
@nautilytics
nautilytics / d3.waterfall.js
Last active December 27, 2015 00:29
Waterfall Chart
(function () {
var yScale = d3.scale.linear();
var waterfallData = [];
var margin = 35;
var width = parseInt(d3.select('body').style("width")) - margin - margin,
height = parseInt(d3.select('body').style("height")) - margin - margin;
var xs = [
{label: "Tomatoes", value: 50},
@nautilytics
nautilytics / corn_planting_data.json
Last active December 27, 2015 12:29
Illinois Corn Planting Progress 1980 to 2009
{"1986": [
{
"date": 12,
"percentage": 2.0
},
{
"date": 13,
"percentage": 2.8571428571428572
},
{
@nautilytics
nautilytics / google-geo-interaction-only.js
Last active August 29, 2015 14:02
TileServer Click Interaction
var startingLocation = new google.maps.LatLng(42.3726261, -70.8322807)
, map = new google.maps.Map(document.getElementById('map'), {
zoom: 11,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL
},
center: startingLocation
})
, selectedGeographyPolygon
, selectedGeoID
@nautilytics
nautilytics / gist:75cbbb2d854de608e81c
Created July 15, 2015 19:07
node-mapnik .pbf tile-server example
var config = require('../../config/database')
, _ = require('lodash-compat')
, mercator = require('./../../geo_utils/sphericalmercator')
, geographic = require('./../../geo_utils/geographic')
, crypto = require("crypto")
, zlib = require('zlib')
, mapnik = require('mapnik')
, utils = require('./../../config/utils');
if (mapnik.register_default_input_plugins)
@nautilytics
nautilytics / d3-transition.js
Last active January 2, 2020 15:44
Comparing transitions in D3, React, and Angular
// D3
d3.selectAll(‘.marker’)
.data(data, d => d.id)
.enter();
// Angular
<g app-marker *ngFor="let item of data; trackBy: trackByPoint"></g>
trackByPoint(item) {
return item.id;
@nautilytics
nautilytics / d3-axis-react.js
Last active January 2, 2020 15:59
An example of creating an axis using React
import {select as d3_select} from 'd3-selection';
...
const xAxisRef = useRef();
useEffect(() => {
renderXAxis();
});
const renderXAxis = () => {
const xAxis = d3_select(xAxisRef.current);