[ Launch: PathLib & Pattern ] 4749218 by roundrobin[ Launch: Variable Stroke width ] 4735469 by roundrobin[ Launch: SVG Path Test 1 ] 4721138 by roundrobin[ Launch: SVG Path Element ] 4721053 by roundrobin[ Launch: Bootstrap Trib ] 4711978 by roundrobin[ Launch: Tributary inlet ] 4711690 by roundrobin
This file contains hidden or 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
| /* | |
| @fliptopbox | |
| LZW Compression/Decompression for Strings | |
| Implementation of LZW algorithms from: | |
| http://rosettacode.org/wiki/LZW_compression#JavaScript | |
| Usage: | |
| var a = 'a very very long string to be squashed'; | |
| var b = a.compress(); // 'a veryāăąlong striċ to bečquashed' |
This file contains hidden or 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
| // http://phrogz.net/SVG/convert_path_to_polygon.xhtml | |
| function pathToPolygon(path,samples){ | |
| if (!samples) samples = 0; | |
| var doc = path.ownerDocument; | |
| var poly = doc.createElementNS('http://www.w3.org/2000/svg','polygon'); | |
| // Put all path segments in a queue | |
| for (var segs=[],s=path.pathSegList,i=s.numberOfItems-1;i>=0;--i) segs[i] = s.getItem(i); | |
| var segments = segs.concat(); |
[ Launch: Variable Stroke width ] 4721145 by roundrobin[ Launch: SVG Path Test 1 ] 4721138 by roundrobin[ Launch: SVG Path Element ] 4721053 by roundrobin[ Launch: Bootstrap Trib ] 4711978 by roundrobin[ Launch: Tributary inlet ] 4711690 by roundrobin
[ Launch: SVG Path Test 1 ] 4721138 by roundrobin[ Launch: SVG Path Element ] 4721053 by roundrobin[ Launch: Bootstrap Trib ] 4711978 by roundrobin[ Launch: Tributary inlet ] 4711690 by roundrobin
This file contains hidden or 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
| function UndoItem (perform, data) { | |
| this.perform = perform; | |
| this.data = data; | |
| } | |
| /** | |
| * UndoStack: | |
| * Easy undo-redo in JavaScript. | |
| **/ |
This file contains hidden or 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 runInSandbox = (function () { | |
| function extend(dest, src, arr) { | |
| var property = null, | |
| ext = '', | |
| isArray = false, | |
| key; | |
| for (property in src) { | |
| key = arr ? '[' + property + ']' : '["' + property + '"]'; | |
| ext += dest + key + ' = '; |
This file contains hidden or 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
| /* | |
| * This work is free. You can redistribute it and/or modify it under the | |
| * terms of the Do What The Fuck You Want To Public License, Version 2, | |
| * as published by Sam Hocevar. See the COPYING file for more details. | |
| */ | |
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { |
This file contains hidden or 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 http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
| <script type="text/javascript" src="https://raw.github.com/larskotthoff/d3/varline/src/svg/line-variable.js"></script> | |
| </head> | |
| <body> | |
| <div id="linevar"></div> |
This file contains hidden or 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
| function bezier(pts) { | |
| return function (t) { | |
| for (var a = pts; a.length > 1; a = b) // do..while loop in disguise | |
| for (var i = 0, b = [], j; i < a.length - 1; i++) // cycle over control points | |
| for (b[i] = [], j = 0; j < a[i].length; j++) // cycle over dimensions | |
| b[i][j] = a[i][j] * (1 - t) + a[i+1][j] * t; // interpolation | |
| return a[0]; | |
| } | |
| } |