Skip to content

Instantly share code, notes, and snippets.

@mkedwards
mkedwards / ConvexHull.js
Last active January 25, 2017 08:55 — forked from mbostock/.block
Treemap
// ConvexHull.js
var epsilon = 1E-10;
// IN: vectors or vertices
// OUT: dot product
var dot = function(v1, v2) {
return (v1.x * v2.x) + (v1.y * v2.y) + (v1.z * v2.z);
}
<?php
namespace Grav\Plugin\Console;
use Grav\Console\ConsoleCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
/**
* Class GeneratorCommand
*
@Kcnarf
Kcnarf / .block
Last active December 3, 2018 08:32
Iris
license: mit
@vasturiano
vasturiano / .block
Last active March 27, 2026 15:01
Timelines Chart
height: 700
scrolling: yes
@enjalot
enjalot / PerformProjections.js
Last active October 18, 2016 00:12
character interpolation
// from Font Project by Neill Campbell
// http://vecg.cs.ucl.ac.uk/Projects/projects_fonts/font_project/PerformPrediction.js
var CharFuncs = CharFuncs || {};
function size(A) { return numeric.dim(A); }
function computeK(x, X, alpha, gamma) {
m = numeric.dim(x)[0];
d = numeric.dim(x)[1];
n = numeric.dim(X)[0];
@veltman
veltman / draw.js
Created July 2, 2016 04:33
D3 frames to video
// Pipe to ffmpeg with something like:
// node draw.js | ffmpeg -y -c:v png -f image2pipe -r 20 -i - -an -c:v libx264 -pix_fmt yuv420p -movflags +faststart myvideo.mp4
var Canvas = require("canvas"),
d3 = require("d3"),
topojson = require("topojson"),
rw = require("rw"),
world = require("./world-110m.json");
var width = 1280,
@armollica
armollica / .block
Last active November 8, 2021 21:38
Proj4/WKT + D3
height: 600
@Kcnarf
Kcnarf / .block
Last active October 13, 2016 07:27
path for Distance-limited Voronoi cell - d3v4
license: gpl-3.0
@curran
curran / .block
Last active October 23, 2019 22:40
Moon Calendar 2017
license: mit
border: no
height: 380
@monfera
monfera / .block
Last active August 8, 2016 11:34
Brownian motion with D3 4.0 velocity Verlet physics
license: gpl-3.0