Skip to content

Instantly share code, notes, and snippets.

Ashish Singh git-ashish

Block or report user

Report or block git-ashish

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@git-ashish
git-ashish / .block
Created Jun 20, 2019 — forked from mbostock/.block
Bounded Force Layout
View .block
license: gpl-3.0
@git-ashish
git-ashish / index.html
Created Jun 15, 2019 — forked from MoritzStefaner/index.html
Force-based label placement
View index.html
<!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 — forked from michiel/lat_lng_jitter.js
Add jitter to latitude/longitude
View lat_lng_jitter.js
//
// 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 — forked from veltman/README.md
Canvas scatterplot with quadtree
View README.md

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.

@git-ashish
git-ashish / .block
Created May 16, 2019 — forked from pbeshai/.block
Animate thousands of points with canvas and D3
View .block
license: mit
height: 620
border: no
@git-ashish
git-ashish / README.md
Created May 16, 2019 — forked from veltman/README.md
Flocking boids
View README.md
@git-ashish
git-ashish / README.md
Created May 16, 2019 — forked from veltman/README.md
Flocking boids
View README.md
@git-ashish
git-ashish / .block
Created May 15, 2019 — forked from mbostock/.block
Chained Transitions
View .block
license:gpl-3.0
@git-ashish
git-ashish / .block
Created May 15, 2019 — forked from mbostock/.block
Projection Transitions
View .block
license: gpl-3.0
You can’t perform that action at this time.