Skip to content

Instantly share code, notes, and snippets.

Matthew Conlen mathisonian

Block or report user

Report or block mathisonian

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
View app.js
var aspectRatio= '16:9'
var svg = d3.select('#example-4')
.append('svg')
.attr('width', '100%')
.attr('viewBox', '0 0 ' + aspectRatio.split(':').join(' '));
// draw a rect to act as an outline
svg.append('rect')
View checkerboard.js
// Assume a variable called `svg`
// has already been created,
// corresponding to a d3 selection
// of an SVG element.
//
// For this example take the
// 'size' of the svg to be 202x202 pixels
var marginSize = 1;
View svg-sizing.js
// This can be generalized to arbitrary
// aspect ratios. See last example for
// more on that.
// See calculation for total size in
// example above
var size = 202;
// 1st example - set an explicit
View app.js
var svg = d3.select('#example-3')
.append('svg')
.attr('width', '100%')
.attr('viewBox', '0 0 202 202');
var data = d3.range(10).map(function (d, i) {
return i;
});
View app.js
var svg = d3.select('#example-2')
.append('svg')
.attr('width', '100%')
.attr('viewBox', '0 0 202 202');
var data = d3.range(10).map(function (d, i) {
return i;
});
View app.js
var svg = d3.select('#example-1')
.append('svg')
.attr('width', 202)
.attr('height', 202);
var data = d3.range(10).map(function (d, i) {
return i;
});
@mathisonian
mathisonian / index.py
Last active Sep 10, 2015
existing viz example
View index.py
from lightning import Lightning, Visualization
lgn = Lightning()
# use a saved session id
lgn.use_session(sesion_id)
# use an existing visualization
viz = Visualization(session=lgn.session, json={'id': visualization_id})
@mathisonian
mathisonian / index.js
Created Jul 6, 2015
react transitions
View index.js
var TransitioningClass = React.createClass(
transitions: ['myVarA', 'myVarB'] // uses d3 to guess interpolation type
});
var TransitioningClass = React.createClass(
transitions: {
myVarA: 'color'
@mathisonian
mathisonian / gist:76057519c67d48f6b0fd
Created May 4, 2015
map emoji names to their codes
View gist:76057519c67d48f6b0fd
{"100":"1F4AF","1234":"1F522","copyright":"00A9","registered":"00AE","bangbang":"203C","interrobang":"2049","tm":"2122","information_source":"2139","left_right_arrow":"2194","arrow_up_down":"2195","arrow_upper_left":"2196","arrow_upper_right":"2197","arrow_lower_right":"2198","arrow_lower_left":"2199","leftwards_arrow_with_hook":"21A9","arrow_right_hook":"21AA","watch":"231A","hourglass":"231B","fast_forward":"23E9","rewind":"23EA","arrow_double_up":"23EB","arrow_double_down":"23EC","alarm_clock":"23F0","hourglass_flowing_sand":"23F3","m":"24C2","black_small_square":"25AA","white_small_square":"25AB","arrow_forward":"25B6","arrow_backward":"25C0","white_medium_square":"25FB","black_medium_square":"25FC","white_medium_small_square":"25FD","black_medium_small_square":"25FE","sunny":"2600","cloud":"2601","phone":"260E","telephone":"260E","ballot_box_with_check":"2611","umbrella":"2614","coffee":"2615","point_up":"261D","relaxed":"263A","aries":"2648","taurus":"2649","gemini":"264A","cancer":"264B","leo":"264C","
View index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>JavaScript Non-Form CurseMonger</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
<SCRIPT LANGUAGE="JavaScript">
<!--Hide JavaScript from Java-Impaired Browsers
isn1="*00Your mouth spews*01You are*02Your mother wears*03Your"
+" Father is*04Your Eleventh Child will be*05Your Mate"
+"rnal Ancestors are*06Your Personal Trainer is*07Your spouse "
You can’t perform that action at this time.