This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Your Stylesheet | |
* | |
* This stylesheet is loaded when Atom starts up and is reloaded automatically | |
* when it is changed. | |
* | |
* If you are unfamiliar with LESS, you can read more about it here: | |
* http://www.lesscss.org | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Select text of a content editable | |
// http://stackoverflow.com/a/6150060/2806996 | |
// Example usage: $('[contenteditable]:first').selectText() | |
$.fn.selectText = function() { | |
var range = document.createRange(); | |
range.selectNodeContents(this[0]); | |
var sel = window.getSelection(); | |
sel.removeAllRanges(); | |
sel.addRange(range); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
function randomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** | |
* The first commented line is your dabblet’s title | |
*/ | |
.wrapper { | |
position: relative; | |
} | |
.line { | |
position: absolute; | |
height: 1px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credit Christopher Chiche & Clemens Tolboom | |
// - http://stackoverflow.com/a/14426477/2806996 | |
d3.selection.prototype.moveToFront = function() { | |
return this.each(function(){ | |
this.parentNode.appendChild(this); | |
}); | |
}; | |
d3.selection.prototype.moveToBack = function() { | |
return this.each(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
function randomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
html, body { | |
height: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Patch Backbone Model and Collection to have awareness | |
// of current sync state. | |
// Adds an isLoading method and _inFlight count property. | |
// Fires before:sync and after:sync events. | |
// Based on http://tbranyen.com/post/how-to-indicate-backbone-fetch-progress | |
!function() { | |
function onSyncEnd() { | |
-- this._inFlight; | |
this.trigger("after:sync", this); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
svg { | |
} | |
rect { | |
fill-opacity: 0.5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var colorScale = d3.scale.category10(); | |
var chart = c3.generate({ | |
bindto: '#bar-chart', | |
data: { | |
x: 'x', | |
columns: [ | |
['x', 'apple', 'banana'], | |
['count', 191, 238], | |
], |
OlderNewer