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
@git-ashish
git-ashish / .block
Created February 28, 2024 14:57 — forked from AntonOrlov/.block
Radial Bar Chart built with D3
license: gpl-3.0
@git-ashish
git-ashish / puppeteer-gif.js
Created September 20, 2021 18:40 — forked from bambooom/puppeteer-gif.js
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))});
}
@git-ashish
git-ashish / .block
Created May 28, 2021 08:46 — forked from HarryStevens/.block
Spin the Earth
license: gpl-3.0
@git-ashish
git-ashish / .block
Created May 28, 2021 08:46 — forked from HarryStevens/.block
Transparent Earth
license: gpl-3.0
@git-ashish
git-ashish / .block
Created April 26, 2021 13:04 — forked from mbostock/.block
D3 Show Reel
license: gpl-3.0
@git-ashish
git-ashish / .block
Created July 29, 2020 11:27 — forked from rpgove/.block
EuroVis 2019 Twitter interaction network
license: bsd-3-clause
height: 600
@git-ashish
git-ashish / .block
Created June 20, 2019 06:51 — forked from mbostock/.block
Bounded Force Layout
license: gpl-3.0
@git-ashish
git-ashish / index.html
Created June 15, 2019 07:31 — forked from MoritzStefaner/.block
Force-based label placement
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta charset="utf-8">
<title>Force based label placement</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.6.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.6.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.6.0"></script>
</head>
<body>
@git-ashish
git-ashish / lat_lng_jitter.js
Created May 30, 2019 11:54 — forked from michiel/lat_lng_jitter.js
Add jitter to latitude/longitude
//
// Make a few assumptions and add noise to latitude/longitude position
// Ex, console.log(jitter(-26.4853429150483, -49.072945734375, 5));
//
var rad_Earth = 6378.16;
var one_degree = (2 * Math.PI * rad_Earth) / 360;
var one_km = 1 / one_degree;
function randomInRange(from, to, fixed) {
@git-ashish
git-ashish / README.md
Created May 16, 2019 17:15 — forked from veltman/README.md
Canvas scatterplot with quadtree

Canvas scatterplot w/ quadtree for point picking on hover, per: https://twitter.com/mbostock/status/733317794419212288

If you don't want the full Voronoi effect because your chart has some big dead zones, you could add a distance threshold and only trigger the highlighting when the nearest point is within that distance.

If you need behavior that more closely mimics mouse/touch because your shapes have significant dimensions or their layer order matters, you could try colorpicking instead.