Skip to content

Instantly share code, notes, and snippets.

View riccardoscalco's full-sized avatar
🐢
Thinking slowly

Riccardo Scalco riccardoscalco

🐢
Thinking slowly
View GitHub Profile
@patricksurry
patricksurry / README.md
Last active June 17, 2023 09:48 — forked from mbostock/README.md
D3JS quadtree nearest neighbor algorithm

This example adapts mbostock's quadtree brushing demo to find the nearest neighbor (shown red) of a new point (shown yellow). Choose a new point to classify by clicking on the diagram. (An alternative approach for nearest neighbors of the mouse position is D3's Voronoi polygons, but the idea here would extend to rapidly classifying many new points against a base collection of points.)

We use a data-dependent order of recursion through the quadtree

@mbostock
mbostock / .block
Last active December 17, 2023 21:17
Save SVG as PNG
license: gpl-3.0
@widged
widged / index.html
Last active April 15, 2021 16:26
Rapid implementation of a ternary plot with d3js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>D3 Ternary Plot</title>
<style>
line.axis {
stroke-width: 2;
stroke: #363636;
}
@tomstove
tomstove / europe.topo.json
Created April 25, 2013 12:53
UK Satellite Projection D3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phobson
phobson / horizon2.py
Last active March 14, 2017 16:03
Milla's version of horizons in python
import numpy as np
import matplotlib.pyplot as plt
def makeLayer(y, height):
neg=0.0
pos=0.0
if y > 0:
if y - height >= 0:
pos = height
y -= pos
@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@mbostock
mbostock / .block
Last active August 5, 2023 12:53
Margin Convention
license: gpl-3.0
redirect: https://observablehq.com/@d3/margin-convention
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@mbostock
mbostock / .block
Last active November 22, 2022 23:32
Line Transition
license: gpl-3.0
@mbostock
mbostock / .block
Last active July 8, 2023 20:00
SVG foreignObject Example
license: gpl-3.0