Christophe Viau implemented a new shape type for D3.js based on superformulas. One nice property of these shapes is that you can easily tween between two shapes by simply interpolating the control points. Click on the blue shapes to try it!
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
$ git diff lib/express/plugins/body-decoder.js | |
diff --git a/lib/express/plugins/body-decoder.js b/lib/express/plugins/body-decoder.js | |
index 1d67ff4..4ec448c 100644 | |
--- a/lib/express/plugins/body-decoder.js | |
+++ b/lib/express/plugins/body-decoder.js | |
@@ -22,7 +22,7 @@ exports.BodyDecoder = Plugin.extend({ | |
var request = event.request | |
if (request.header('Content-Type') && | |
request.header('Content-Type').includes('application/x-www-form-urlencoded')) | |
- request.params.post = queryString.parseQuery(request.body) |
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
print 'function striptags ( code ) { | |
var regbr = new RegExp("<br>","gi"), regexp = new RegExp("<[^>]+>","g"); | |
return code.replace(regbr,"\n").replace(regexp,"").replace(" "," "); | |
} | |
function decoupe_chaine ( texte, chaine ) { | |
var pd,i,c,pa; | |
//alert("texte=\'" + texte + "\', chaine=\'" + chaine + "\'"); | |
pd = texte.toLowerCase().indexOf(chaine.toLowerCase(),0); |
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> | |
<meta charset="utf-8"> | |
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script> | |
<div id="viz"></div> | |
<div id="scale">scale: <span>240</span></div> | |
<script type="text/javascript"> |
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
function MyClient() { | |
var self = this, | |
width = $('#map').width(), | |
mapCanvasHeight = (width * 0.45); | |
this.init = function() { | |
self.drawMap(); | |
self.drawMarker(); | |
self.drawArc(); | |
} |
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
// demo.js | |
// | |
// Adapted by Kai Chang and Rich Morin from http://bl.ocks.org/1653763 | |
window.onload = function() { | |
var w = $('#chart').width(), | |
h = (w * 0.45); | |
proj = { |
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
creditor | debtor | amount | risk | |
---|---|---|---|---|
Britain | France | 22.4 | 3 | |
Britain | Greece | 0.55 | 0 | |
Britain | Italy | 26 | 0 | |
Britain | Portugal | 19.4 | 0 | |
Britain | United States | 345 | 1 | |
France | Germany | 53.8 | 1 | |
France | Greece | 53.9 | 0 | |
France | Ireland | 17.3 | 0 | |
France | Italy | 366 | 0 |
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 name="viewport" content="initial-scale=1.0, user-scalable=no"/> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> | |
<script type="text/javascript" src="http://github.com/mbostock/d3/raw/v1.8.4/d3.js"></script> | |
<style type="text/css"> | |
html, body, #map { | |
width: 100%; |
Using Upperdog Interactive’s CSS Twitter logo as reference, and I wrote some circle-circle intersection code (a.k.a. math) to specify the Twitter logo as sequence of elliptical arc segments. There are other versions of the Twitter logo in SVG, but as best I can tell, they use cubic Béziers. I found it mathematically unsettling to use Béziers when circular arcs would suffice.
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
function thisClient() { | |
"use strict" | |
var self = this | |
var width = 960, | |
height = 500, | |
centered, data | |
this.init = function() { | |
//now.receiveLocation = function(message) { |
OlderNewer