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 ='#example-4')
.attr('width', '100%')
.attr('viewBox', '0 0 ' + aspectRatio.split(':').join(' '));
// draw a rect to act as an outline
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 ='#example-3')
.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 ='#example-2')
.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 ='#example-1')
.attr('width', 202)
.attr('height', 202);
var data = d3.range(10).map(function (d, i) {
return i;
mathisonian /
Last active Sep 10, 2015
existing viz example
from lightning import Lightning, Visualization
lgn = Lightning()
# use a saved session id
# use an existing visualization
viz = Visualization(session=lgn.session, json={'id': visualization_id})
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 / gist:76057519c67d48f6b0fd
Created May 4, 2015
map emoji names to their codes
View gist:76057519c67d48f6b0fd
View index.html
<TITLE>JavaScript Non-Form CurseMonger</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
<!--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.