Skip to content

Instantly share code, notes, and snippets.

@nivas8292
nivas8292 / cities.csv
Last active January 2, 2020 14:22
World Map with Zoom slider and Zoom and Pan options
code city country lat lon
ZNZ ZANZIBAR TANZANIA -6.13 39.31
TYO TOKYO JAPAN 35.68 139.76
AKL AUCKLAND NEW ZEALAND -36.85 174.78
BKK BANGKOK THAILAND 13.75 100.48
DEL DELHI INDIA 29.01 77.38
SIN SINGAPORE SINGAPOR 1.36 103.75
BSB BRASILIA BRAZIL -15.67 -47.43
RIO RIO DE JANEIRO BRAZIL -22.90 -43.24
YTO TORONTO CANADA 43.64 -79.40
@nivas8292
nivas8292 / README.MD
Last active November 5, 2018 07:44
Force Layout - Directed Graph with Customized Node and Link

This is a slight varation of example given by mbostock

Click on the Nodes to Zoom in. Double Click on the Nodes to Zoom out.

@nivas8292
nivas8292 / frontendDevlopmentBookmarks.md
Created March 24, 2017 15:43 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@nivas8292
nivas8292 / indec.html
Last active August 29, 2015 14:27
Marks Comparision
<!DOCTYPE html>
<html>
<head>
<title>Welcome to D3 tutorial </title>
<style type="text/css">
body, html {
font-family:"Arial", sans-serif;
font-size:0.95em;
text-align:center;
@nivas8292
nivas8292 / adjacency_matrix.js
Last active August 29, 2015 14:24
Adjacency Matrix Example
(function() {
d3.layout.adjacencyMatrix = function() {
var directed = true,
size = [1,1],
nodes = [],
edges = [],
edgeWeight = function (d) {return 1},
nodeID = function (d) {return d.id};
function matrix() {
@nivas8292
nivas8292 / README.MD
Last active August 29, 2015 14:24
Population in US

Press Left <- / Right -> to navigate to different years

@nivas8292
nivas8292 / index.html
Last active August 29, 2015 14:23
Reusable Bar Chart
<html>
<head>
<title>Reusable Bar Chart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<style>
section {
width: 400px;
display: inline-block;
@nivas8292
nivas8292 / data.csv
Last active August 29, 2015 14:23
Zoom and Brush in d3
date price
Jan 2000 1394.46
Feb 2000 1366.42
Mar 2000 1498.58
Apr 2000 1452.43
May 2000 1420.6
Jun 2000 1454.6
Jul 2000 1430.83
Aug 2000 1517.68
Sep 2000 1436.51
@nivas8292
nivas8292 / data.csv
Last active August 29, 2015 14:22
Degree Days
date value
01-01 25.5
01-02 25.6
01-03 25.7
01-04 25.6
01-05 25.9
01-06 25.9
01-07 25.7
01-08 25.6
01-09 25.6
@nivas8292
nivas8292 / index.html
Last active August 29, 2015 14:22
Column Bar Chart with Sort Animation
<html>
<head>
<title>D3 Bar Chart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="main.css">
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
</head>
<body>
<script>