Skip to content

Instantly share code, notes, and snippets.

View andrewhassan's full-sized avatar

Andrew Hassan andrewhassan

View GitHub Profile
@andrewhassan
andrewhassan / .block
Created July 18, 2016 16:48 — forked from mbostock/.block
Color Mesh
license: gpl-3.0
@andrewhassan
andrewhassan / README.md
Created February 3, 2016 20:17 — forked from brattonc/README.md
D3 Liquid Fill Gauge

Liquid Fill Gauge v1.1 - 7/14/2015

Changes:

  • Added support for updating the gauge value after loading is complete. The loadLiquidFillGauge method now returns an object with an update method which allows the gauge value to be changed. Click any of the gauges above to randomly update their value.

Configurable features include:

  • Changeable min/max values.
  • All colors.
date Airbus Boeing
2000-07-31 0 0
2000-08-31 -0.884 9.8912
2000-09-29 9.6685 32.1383
2000-10-31 32.5967 38.9245
2000-11-30 33.1492 41.4853
2000-12-29 30.7182 35.2113
2001-01-31 27.0718 19.8464
2001-02-28 24.3094 27.4264
2001-03-30 16.0773 14.1306
/*jslint nomen: true*/
/*global window, console, d3, _*/
var BarChart = window.BarChart = (function () {
'use strict';
function BarChart(options) {
// Validate/set options
if (!options) {
options = {};

Q1

The following 2D array is data "encrypted" with a cipher.

A H A F S G !
S N A O U W S
D A D A E S S
J P A R A F W

Keybase proof

I hereby claim:

  • I am andrewhassan on github.
  • I am ahassan (https://keybase.io/ahassan) on keybase.
  • I have a public key whose fingerprint is 0FD8 1DD9 B248 F520 DAE5 8FD4 2148 C403 2847 8F8E

To claim this, I am signing this object:

for (var rfid in rfid_list) {
var clickHandler = function () {
$('html, body').animate({
scrollTop: $("[data-filter='rfid-" + rfid + "']").offset().top // When this runs, the value of rfid is the last value
}, 500);
};
// I removed unimportant code
text = g.click(clickHandler); // This is SnapSVG .click function
@andrewhassan
andrewhassan / gist:5620353
Created May 21, 2013 14:44
Grouped Pie Chart Function. Takes in data and some parameters for the pie chart. It will plot the data and return an update function that can be called with new data. Note: Adding new data to the dataset when calling the update function will cause uncoloured slices to appear. Also, this function requires d3.js.
/**
* Create Pie function
*
* This function will create a grouped pie graph on call and return an update function that can be called with new data/
*
* Params:
* data: The data for the chart in the form [{"label": "label", "value": 123, "group": "Group Name"},...]
* w: The width of the svg element
* h: The heigh of the svg element
* animationDuration: The amount of time (in ms) that you want the animation to take when updating data