Skip to content

Instantly share code, notes, and snippets.

mccannf

Block or report user

Report or block mccannf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mccannf
mccannf / README.markdown
Created Jan 17, 2012
D3 Drag Rectangle with drag handles
View README.markdown

This is an example of the power of the D3 library and how you can use the drag behavior of D3 to control the position and shape of the SVG element.

@mccannf
mccannf / README.markdown
Last active Dec 25, 2015
Line chart with tipsy tooltips
View README.markdown
@mccannf
mccannf / redmine.rb
Created Oct 12, 2012
Module to be used with Her ORM to parse XML REST API. Specifically for Redmine REST feed.
View redmine.rb
module Redmine
class Issue
include Her::Model
end
class ParseXML < Faraday::Response::Middleware
# Parse the response body
#
# @param [String] body The response body
# @return [Mixed] the parsed response
@mccannf
mccannf / data.csv
Created Nov 1, 2012
D3 Pie charts with grid lines
View data.csv
age population percent
<5 2704659 67
5-13 4499890 38
14-17 2159981 91
18-24 3853788 49
25-44 14106543 71
45-64 8819342 88
=65 612463 64
@mccannf
mccannf / index.html
Created Nov 2, 2012
Force graph with larger radii
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Mobile Patent Suits</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
path.link {
fill: none;
View builds.json
[
{
"result": 10,
"finished_at": "2011-12-01" },
{
"result": 20,
"finished_at": "2011-12-03" },
{
"result": 30,
"finished_at": "2011-12-05" },
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Mike Heavers - Projects</title>
<script type="text/javascript" src="http://mikeheavers.com/transfers/projects/js/d3.v2.min.js"></script>
<script type="text/javascript" src="http://mikeheavers.com/transfers/projects/js/packages.js"></script>
<link type="text/css" rel="stylesheet" href="http://mikeheavers.com/transfers/projects/css/bundle-radial.css"/>
</head>
<body>
@mccannf
mccannf / README.md
Created Dec 1, 2012 — forked from mbostock/.block
Reingold–Tilford Tree
View README.md

The tree layout implements the Reingold-Tilford algorithm for efficient, tidy arrangement of layered nodes. The depth of nodes is computed by distance from the root, leading to a ragged appearance. Cartesian orientations are also supported. Implementation based on work by Jeff Heer and Jason Davies using Buchheim et al.'s linear-time variant of the Reingold-Tilford algorithm. Data shows the Flare class hierarchy, also courtesy Jeff Heer.

View index.csv
mydate Afghan Security Forces afghaninterpolated U.S. Troops usinterpolated Other Foreign Troops otherinterpolated
November-01 0 0 1300 0 0 0
December-01 240 1 2500 0 1667 1
January-02 480 1 4067 0 3333 1
February-02 720 1 5633 0 5000 0
March-02 960 1 7200 0 5000 0
April-02 1200 1 7425 0 5000 0
May-02 1440 1 7650 0 4500 0
June-02 1680 1 7875 0 5000 0
July-02 1920 1 8100 0 4900 1
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
circle {
stroke: #fff;
}
</style>
<body>
You can’t perform that action at this time.