Skip to content

Instantly share code, notes, and snippets.

@devangmundhra
devangmundhra / bounding_circle.py
Created January 16, 2016 06:49
Finding venues within a radius (relies on PostgresSQL PostGIS)
"""
This file exposes a function to convert a GET request with location and radius into a GEOS object to be able to run Postgres query on it
"""
from geo import geocode_location
def bounding_circle(get_location_params):
"""
get_location_params- string that consists of comma separated query param "location name,radius", something like "Connaught Place,10"
radius in km
"""
@devangmundhra
devangmundhra / index.html
Created October 24, 2012 17:16
Textarea
<!DOCTYPE html>
<style>
textarea {
color: white;
width: 280px;
height: 280px;
border: 1px solid gray;
border-radius: 8px;
font-family: HelveticaNeue-CondensedBold;
@devangmundhra
devangmundhra / bashtords.json
Created October 12, 2012 23:47
The Bashtords
{ "children" : [ { "children" : [ { "children" : [ { "name" : "Tanya",
"size" : 100
} ],
"name" : "First Year"
},
{ "children" : [ { "name" : "Tanya",
"size" : 100
},
{ "name" : "Korean something",
"size" : 500
@devangmundhra
devangmundhra / index.html
Created August 18, 2011 23:16 — forked from mundhradevang/index.html
Deleting cell in a treemap when clicked
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
<style type="text/css">
rect {
fill: none;
stroke: #fff;
@devangmundhra
devangmundhra / index.html
Created June 3, 2011 18:48 — forked from mbostock/.block
Zoomable Icicle
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Partition - Icicle</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
<style type="text/css">
rect {
@devangmundhra
devangmundhra / index.html
Created May 11, 2011 00:56 — forked from mundhradevang/index.html
Branch treemap node with mouse click
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Treemap</title>
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script>
<link type="text/css" rel="stylesheet" href="treemap.css"/>
</head>
<body>
<div id="chart"></div>
<script type="text/javascript" src="treemap_branch_on_click.js"></script>
@devangmundhra
devangmundhra / index.html
Created April 13, 2011 04:26
Branch treemap node with mouse click
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Treemap</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
<link type="text/css" rel="stylesheet" href="treemap.css"/>
</head>
<body>
<div id="chart"></div>
@devangmundhra
devangmundhra / index.html
Created April 9, 2011 23:42
To start with the innermost circle of sunburst and display the children of the parent being clicked
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Treemap</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
<style type="text/css">
svg {
font: 10px sans-serif;
}
@devangmundhra
devangmundhra / flare.json
Created April 8, 2011 06:42
Treemap example plus adding the capability that each node of the treemap unfolds on a mouse click
{
"flare": {
"analytics": {
"cluster": {
"AgglomerativeCluster": 3938,
"CommunityStructure": 3812,
"HierarchicalCluster": 6714,
"MergeEdge": 743
},
"graph": {
@devangmundhra
devangmundhra / flare.json
Created April 8, 2011 05:55
The first part uses the sunburst example. The last part attempts to add text for each of the arcs.
{
"flare": {
"analytics": {
"cluster": {
"AgglomerativeCluster": 3938,
"CommunityStructure": 3812,
"HierarchicalCluster": 6714,
"MergeEdge": 743
},
"graph": {