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 / data.topo.json
Created November 19, 2018 18:45
US 113th Congressional District with State - Zip Code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@git-ashish
git-ashish / usCongressionalDistrict113.topo.json
Last active November 17, 2018 13:29
US 113 Congressional District TopoJSON
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@git-ashish
git-ashish / README.md
Created November 13, 2018 07:52 — forked from asizer/README.md
d3 Horizontal BoxPlot

This sample is based on Mike Bostock's Box Plots. The box.js file has been modified in a number of ways besides making the box plots horizontal: the transitions have been removed, the 1.5 iqr function is included as the default to compute the whisker length, data objects are attached to the whisker ends and outlier dots (instead of just the values), and there are transparent q1-q2 and q2-q3 boxes that contain those respective data points for possible future use.

Hovering over outlier dots in the boxplot highlights them on the table and vice-versa. This also demonstrates a move-to-front functionality -- when an outlier circle is highlighted, it is moved to the end of the svg's elements so that it appears on top of the other outliers.

Also, the axis rounds its range to intervals that go into a power of 10 (see the cleanUpChartRange function).

The variable being plotted is a generated logNoraml distribution, to demonstrate outliers more prominently (sometimes there are so many, the table gets cut

@git-ashish
git-ashish / index.html
Created November 8, 2018 13:25 — forked from jasondavies/index.html
longscroll.js
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.longscroll {
overflow-y: auto;
width: 480px;
height: 500px;
float: left;
}
.longscroll .row {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@git-ashish
git-ashish / README.md
Created October 23, 2018 14:30 — forked from emeeks/README.md
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.

@git-ashish
git-ashish / README.md
Created October 18, 2018 11:34 — forked from veltman/README.md
Electoral cartograms
@git-ashish
git-ashish / README.md
Created October 17, 2018 15:29 — forked from nbremer/.block
Self Organizing Map - Hexagonal Heatmap - Lines

The end result of my blog on SOM - Adding boundaries inside a hexagonal heatmap in D3.js in which the one heatmap of a Self Organizing Map is displayed with D3 with a small hover event and where boundaries between the overlaying segments have been visualized with black lines

A simpler version without line boundaries can be found here

@git-ashish
git-ashish / index.js
Created October 15, 2018 08:45
JavaScript: Detect if a device is Mobile
// Detect if device is a Mobile
function isMobile() {
var bIsMobile = false;
try {
bIsMobile = /Mobi/i.test(navigator.userAgent) || /Android/i.test(navigator.userAgent);
}catch(e){
}
return bIsMobile;
}
@git-ashish
git-ashish / .gitignore
Created September 26, 2018 08:45 — forked from starcalibre/.gitignore
Fast Interactive Canvas Scatterplot
.idea/
*.iml