Only works in full screen http://bl.ocks.org/ZJONSSON/raw/5581551/
<!DOCTYPE html> | |
<html lang="en"><head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0"/> | |
<title>Leaflet vector tile map of rivers</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" /> | |
<!--[if lte IE 8]> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.ie.css" /> |
UPDATE: The Vector Tiles are not being served at this time by Openstreetmap. Try later or a different provider (example) Services seem to have resumed
A simple test of extending the L.TileLayer to fetch geoJSON tiles from openstreetmap and render them with d3. This is probably not the most efficient way to do this, as we accept empty image tags (from the standard TileLayer) and use them as containers for the data/requests.
var data; | |
d3.csv("data.csv",function(err,d) { | |
data = {}; | |
d.forEach(function(d) { | |
var kyn = d.kyn, aldur = +d.aldur; | |
Object.keys(d) | |
.filter(function(d) { return d != 'kyn' && d != 'aldur';}) | |
.forEach(function(e,i) { | |
var born = +e-aldur; |
Testing automatic pause/resume in node-mysql Query.stream() in https://github.com/ZJONSSON/node-mysql/commit/eb4410bbc1e4496cbac66fe56f32225e55f7e463
Pan and Zoom (mousewheel) to explore the randomized data.
This experiment uses d3.js, dpl.js and pyfy.js to simulate geometric brownian motion with brownian bridge between any "known points" (either given values or already-randomized values). Active caching is utilized to ensure that any base random number stays in place until the world is re-randomized (i.e. I keep filling in missing information). This means that when volatility or drift is changed, the path is recalculated using the previously established Gaussian random outcomes.
The blue dots are known monthly closing values for APPL and the gray line is the simulated brownian motion Pan and zoom to look deeper and further. As you move around the cache will grow larger, but pressing "randomize" will reset the world to a new initial vector.
var stream = require("stream"), | |
util = require("util"); | |
function QueueWrite(maxOpen,fn,options) { | |
this.maxOpen = maxOpen; | |
this.open = 0; | |
this.queue = []; | |
this.fn = fn; | |
stream.Writable.call(this,options); | |
} |
Changes in this fork:
- index.html : Original file looped through all nodes:
point.each(function(d) { d.scanned = d.selected = false; });
This version only touches the nodes scanned by the quadtree (and the previous selection), resulting in faster response - quadtree.js : Experiment in internalizing the area (x1,x2,y1,y2) of each quadrant within each node-object
See original here
See demo http://bl.ocks.org/4241973 for the original