Skip to content

Instantly share code, notes, and snippets.

View shobhitg's full-sized avatar

Shobhit Gupta shobhitg

View GitHub Profile
@shobhitg
shobhitg / Readme.md
Last active August 29, 2015 13:56
General Update Pattern example (using Yahoo Finance API)

This is a non-graphical exmaple to demonstrate the general update pattern in d3.

Similar to mBostock's General Update Pattern, I

In console we can chage the array tickers and the comma separated string fields to query from Yahoo Finance API.

The table only updates during US trading hours.

@shobhitg
shobhitg / index.html
Created February 24, 2014 17:18
Reddit - D3 update
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>D3 General update pattern using tables</title>
<link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css"/>
</head>

Creating a pattern for diagrams gthat require a bit of circuit style visualization.

  • So we go sortest path or not.
  • If we change object's positoin, do the wiring/lines automatically realign?
  • Paths/wiring will have configurations ... e.g width / smoothing curve.
  • Layouts (shortest distance, relation between objects, length of path)
  • Force (pi nnned objects).
  • Collision detection
  • Treat the problem as a graph and for detecting path intersections use this as example: http://www.jasondavies.com/planarity/ Mike Bostocks Spline Editor: http://bl.ocks.org/mbostock/4342190
@shobhitg
shobhitg / a_song_of_ice_and_fire_chapter_graph.dot
Last active February 13, 2020 09:11
ASOIAF Chapterwise POV graph by /r/AbouBenAdhem
digraph "A Song of Ice and Fire" {
fontsize=32;
label="A Song of Ice and Fire\nChapter Graph";
labelloc=t;
ranksep=equally;
concentrate=true;
compound=true;
node [shape=record, color=blue, style=filled, fillcolor=lightsteelblue1]; AGOTKEY [label="A Game\nOf Thrones"];
AGOT0 [label="Prologue\n(Will)"]; AGOT1 [label="Bran I"];
@shobhitg
shobhitg / server.js
Last active March 12, 2022 12:03
File upload example using busboy with express
var path = require('path');
var fs = require('fs');
var os = require('os');
var express = require('express');
var app = express();
var Busboy = require('busboy');
app.get('/', function (req, res) {
res.send('<html><head></head><body>\
<form method="POST" enctype="multipart/form-data">\
@shobhitg
shobhitg / README.md
Last active October 27, 2019 22:07
Migrants-Deaths-Visualization

Visulization of Migrant deaths in the Mediterranean

Used this very handy library called D3SvgOverlay which makes is very easy to overlay d3 components over leaflet maps.

Added some Crossfilter based timeline filtering via dc.js.

@shobhitg
shobhitg / ES6_Singlet.js
Created April 24, 2016 20:13 — forked from milankarunarathne/ES6_Singlet.js
Create Singleton pattern using ES6
'use strict';
/**
* Created by Milan Karunarathne
* Email: mhkarunarathne@gmail.com
* May be freely distributed under the MIT license
*/
import EventEmitter from 'events';
class Single extends EventEmitter {
@shobhitg
shobhitg / README.md
Created June 10, 2016 07:21
fresh block
@shobhitg
shobhitg / .block
Last active March 17, 2017 17:13
d3-bubble-mock
license: mit
@shobhitg
shobhitg / .block
Last active April 27, 2017 23:56
fresh block
license: mit