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 / index.html
Last active August 29, 2015 14:20 — forked from tmcw/index.html
d3 - Click & Double Click
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
body { margin:0; padding:0; }
#map { width:960px; height:500px; background:cyan; }
</style>
</head>
<body>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
@git-ashish
git-ashish / README.md
Last active August 29, 2015 14:22 — forked from mbostock/.block

A variation of programmatic zoom where buttons can be used to zoom-in or zoom-out around the current center of the viewport.

@git-ashish
git-ashish / README.md
Last active August 29, 2015 14:22 — forked from sim0nf/README.md

This is an example of building a tree layout using the Reingold-Tilford "tidy" algorithm, as described in "Tidier Drawings of Trees". As each new element is added to the graph, it animates in, starting at the previous position of the parent node. Thus, the existing nodes and the new node transition smoothly to their new positions. The animation stops when 500 nodes have been added to the tree.

Built with D3.js.

@git-ashish
git-ashish / elementsFromPoint.js
Created March 8, 2016 04:56 — forked from Rooster212/elementsFromPoint.js
Gets all elements below the specified point. Checks to see if browser already has method before using a manual method. Originally found https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/dTYbg4_S2b8/bEtoAnkP0swJ
// returns a list of all elements under the cursor
//
function elementsFromPoint(x,y) {
var elements = [], previousPointerEvents = [], current, i, d;
if(typeof document.elementsFromPoint === "function")
return document.elementsFromPoint(x,y);
if(typeof document.msElementsFromPoint === "function")
return document.msElementsFromPoint(x,y);
@git-ashish
git-ashish / .block
Created April 26, 2016 15:00 — forked from drzax/.block
Narrative Charts
license: mit
scrolling: true
height: 300
@git-ashish
git-ashish / ConvexHull.js
Created October 7, 2016 09:57 — forked from mkedwards/ConvexHull.js
Vornoi 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);
}
@git-ashish
git-ashish / .block
Created October 17, 2016 17:11 — forked from mbostock/.block
Voronoi Labels
license: gpl-3.0
@git-ashish
git-ashish / .block
Created October 17, 2016 17:12 — forked from mbostock/.block
Canvas Voronoi
license: gpl-3.0
@git-ashish
git-ashish / .block
Created October 17, 2016 17:12 — forked from mbostock/.block
Voronoi Tessellation
license: gpl-3.0