Skip to content

Instantly share code, notes, and snippets.

View git-ashish's full-sized avatar
🏠
Freelancing – Open to exciting opportunities

Ashish Singh git-ashish

🏠
Freelancing – Open to exciting opportunities
View GitHub Profile
@bambooom
bambooom / puppeteer-gif.js
Last active February 3, 2024 06:08
use puppeteer to generate gif
const fs = require('fs');
const puppeteer = require('puppeteer');
const GIFEncoder = require('gifencoder');
const PNG = require('png-js');
function decode(png) {
return new Promise(r => {png.decode(pixels => r(pixels))});
}
@veltman
veltman / README.md
Last active July 24, 2022 18:42
Flocking boids
@mrcslws
mrcslws / .block
Last active May 7, 2019 15:03 — forked from mbostock/.block
Pan & Zoom Axes
license: gpl-3.0
@pbeshai
pbeshai / .block
Last active July 17, 2023 09:40
Animate thousands of points with canvas and D3
license: mit
height: 620
border: no
@emeeks
emeeks / README.md
Last active June 6, 2019 10:58
Network Annotation with Collision Detection

Using collision detection with network visualization labels

This demonstrates how to use d3-annotation() with bboxCollide to procedurally place node labels. After using the nodes data to create a network visualization of the Les Miserables play, we filter the nodes to leave out the side characters and pass that array to d3-annotation. We then create a second forceSimulation, this time using the size of the notes as the property in our bounding box collision detection, to move the labels out of each others' way.

d3-annotation by Susie Lu.

@steveharoz
steveharoz / .block
Last active April 10, 2024 07:11 — forked from mbostock/.block
d3-force testing ground
license: gpl-3.0
height: 1030
scrolling: yes
@yurivish
yurivish / venn-diagrams.js
Last active December 26, 2020 03:20
Area-proportional Venn Diagrams
// Since `overlapArea` function is monotonic increasing, we can perform a
// simple bisection search to find the distance that leads to an overlap
// area within epsilon of the desired overlap.
function distanceForOverlapArea(r1, r2, desiredOverlap) {
// Ensure r1 <= r2
if (r1 > r2) {
var temp = r2;
r2 = r1;
r1 = temp;
}
@drzax
drzax / .block
Last active December 6, 2023 16:28
Narrative Charts
license: mit
scrolling: true
height: 300
@mbostock
mbostock / .block
Last active November 8, 2019 06:14
Star Map
license: gpl-3.0
height: 960
redirect: https://observablehq.com/@mbostock/star-map
@mbostock
mbostock / .block
Last active July 5, 2019 13:17
Line with Missing Data
license: gpl-3.0
redirect: https://observablehq.com/@d3/line-with-missing-data