Skip to content

Instantly share code, notes, and snippets.

View adg29's full-sized avatar
📱

Alan Garcia adg29

📱
View GitHub Profile
// convert 0..255 R,G,B values to binary string
RGBToBin = function(r,g,b){
var bin = r << 16 | g << 8 | b;
return (function(h){
return new Array(25-h.length).join("0")+h
})(bin.toString(2))
}
// convert 0..255 R,G,B values to a hexidecimal color string
RGBToHex = function(r,g,b){
@adg29
adg29 / index.html
Last active April 27, 2017 17:54 — forked from biovisualize/index.html
Invoice using a minimalist d3 templating system
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script type='text/javascript' src="http://d3js.org/d3.v3.min.js"></script>
<script type='text/javascript' src="infos.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
@adg29
adg29 / index.html
Last active April 27, 2017 17:49 — forked from alvaromorales/index.html
Circular Heat Chart of Taxi Pickups in Boston
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="http://prcweb.co.uk/lab/circularheat/js/circularHeatChart.js"></script>
<script type="text/javascript">
var taxicabData = {"Charles Playhouse": [2226064, 3129361, 2439844, 177241, 147456, 284089, 498436, 1684804, 3147076, 3186225, 2660161, 2808976, 2650384, 2446096, 2505889, 2380849, 2643876, 2839225, 4276624, 4452100, 3621409, 3806401, 3104644, 1841449, 1708249, 1243225, 558009, 87616, 94249, 240100, 597529, 3154176, 5626384, 4583881, 3579664, 3717184, 3489424, 4536900, 4756761, 3845521, 3186225, 4618201, 6411024, 6416089, 5494336, 5764801, 6502500, 4639716, 4048144, 4787344, 3101121, 167281, 161604, 348100, 883600, 5062500, 7717284, 5466244, 3802500, 3759721, 4145296, 4524129, 4571044, 3912484, 4280761, 5098564, 7767369, 7612081, 6497401, 7214596, 6864400, 5058001, 5574321, 6295081, 3869089, 212521, 181476, 436921, 866761, 4431025, 6543364,
@adg29
adg29 / README.md
Last active November 16, 2024 18:00 — forked from markmarkoh/README.md
New York with Counties (FIPS codes)

This example uses custom map data that includes counties in the state of New York. Custom map data is specified with geographyConfig.dataUrl, which will attempt to make d3.json request to that URL.

In this example, counties are referred to by their FIPs code.

The data was converted from a .SHP file to TopoJSON, instructions to do that here

More DataMaps examples here

@adg29
adg29 / README.md
Last active April 27, 2017 17:46 — forked from mbostock/.block
Focus + context zooming with D3's brush component

This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.

@adg29
adg29 / README.markdown
Last active April 27, 2017 17:42 — forked from bewest/README.markdown
Time scales zooming in D3

Time scales

This demo several time scales. src

full screen demo

D3's time axis does magic things. I expected to modify the x axis such that I could mostly re-use D3's date formatting tricks, but exercise greater control over the resolution at different time scales.

@adg29
adg29 / README.md
Last active April 27, 2017 17:41 — forked from milroc/README.md
Backbone.js with d3.js
@adg29
adg29 / README.md
Last active August 29, 2015 13:56
amoebaAbstract_01_formatik

Variation on abstract computational animation for the exhibition

"Abstraction Now", Künstlerhaus Vienna, 29.08-28.09 2003.

You are allowed to play with this code as much as you like, but you may not publish pieces based directly on it. The Vec2D class can be used freely in any context. via http://yaythis.me/1hgyFVQ

@adg29
adg29 / README.md
Last active May 21, 2018 13:15
Three.JS orbit controls example

TODO

  1. Import delicious bookmarks
  2. Position Scale Orient and Color triangles based on variables of each bookmark in context of sets of bookmarks that live in a recent activity set, in tag sets, and the others dynamic sets of bookmarks.
# usage: `python ~/Desktop/contours.py 1994-654-12_v02.tif`
# output is to a squareless.txt file and the directory "out"
# Working well with thumbnails with 400px as their longest side - untested with other dimensions
# for i in $(ls -1 | grep tif); do python /Users/artsyinc/Documents/resistance/experiments/artwork_image_cropping/contours.py $i; done
import cv2
import numpy as np
from matplotlib import pyplot as plt
import sys