Last active
June 26, 2016 08:04
-
-
Save mbostock/1067636 to your computer and use it in GitHub Desktop.
Revisions
-
mbostock revised this gist
Feb 9, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ license: gpl-3.0 -
mbostock revised this gist
Nov 17, 2015 . 1 changed file with 45 additions and 49 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,100 +1,96 @@ <!DOCTYPE html> <meta charset="utf-8"> <style> body { background: #333; } </style> <body> <script src="//d3js.org/d3.v3.min.js"></script> <script> var width = 960, height = 500; var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); var defs = svg.append("defs"); defs.append("clipPath") .attr("id", "circle1") .append("circle") .attr("cx", 350) .attr("cy", 200) .attr("r", 180); defs.append("clipPath") .attr("id", "circle2") .append("circle") .attr("cx", 550) .attr("cy", 200) .attr("r", 180); defs.append("clipPath") .attr("id", "circle3") .append("circle") .attr("cx", 450) .attr("cy", 300) .attr("r", 180); svg.append("rect") .attr("clip-path", "url(#circle1)") .attr("width", width) .attr("height", height) .style("fill", "#ff0000"); svg.append("rect") .attr("clip-path", "url(#circle2)") .attr("width", width) .attr("height", height) .style("fill", "#00ff00"); svg.append("rect") .attr("clip-path", "url(#circle3)") .attr("width", width) .attr("height", height) .style("fill", "#0000ff"); svg.append("g") .attr("clip-path", "url(#circle1)") .append("rect") .attr("clip-path", "url(#circle2)") .attr("width", width) .attr("height", height) .style("fill", "#ffff00"); svg.append("g") .attr("clip-path", "url(#circle2)") .append("rect") .attr("clip-path", "url(#circle3)") .attr("width", width) .attr("height", height) .style("fill", "#00ffff"); svg.append("g") .attr("clip-path", "url(#circle3)") .append("rect") .attr("clip-path", "url(#circle1)") .attr("width", width) .attr("height", height) .style("fill", "#ff00ff"); svg.append("g") .attr("clip-path", "url(#circle3)") .append("g") .attr("clip-path", "url(#circle2)") .append("rect") .attr("clip-path", "url(#circle1)") .attr("width", width) .attr("height", height) .style("fill", "#ffffff"); </script> -
mbostock revised this gist
Dec 20, 2012 . No changes.There are no files selected for viewing
-
mbostock revised this gist
Oct 12, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed. -
mbostock created this gist
Jul 6, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,100 @@ <!DOCTYPE html> <html> <head> <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> <style type="text/css"> body { background: #333; } </style> </head> <body> <script type="text/javascript"> var w = 960, h = 500; var svg = d3.select("body").append("svg:svg") .attr("width", w) .attr("height", h); var defs = svg.append("svg:defs"); defs.append("svg:clipPath") .attr("id", "circle1") .append("svg:circle") .attr("cx", 350) .attr("cy", 200) .attr("r", 180); defs.append("svg:clipPath") .attr("id", "circle2") .append("svg:circle") .attr("cx", 550) .attr("cy", 200) .attr("r", 180); defs.append("svg:clipPath") .attr("id", "circle3") .append("svg:circle") .attr("cx", 450) .attr("cy", 300) .attr("r", 180); svg.append("svg:rect") .attr("clip-path", "url(#circle1)") .attr("width", w) .attr("height", h) .style("fill", "#ff0000"); svg.append("svg:rect") .attr("clip-path", "url(#circle2)") .attr("width", w) .attr("height", h) .style("fill", "#00ff00"); svg.append("svg:rect") .attr("clip-path", "url(#circle3)") .attr("width", w) .attr("height", h) .style("fill", "#0000ff"); svg.append("svg:g") .attr("clip-path", "url(#circle1)") .append("svg:rect") .attr("clip-path", "url(#circle2)") .attr("width", w) .attr("height", h) .style("fill", "#ffff00"); svg.append("svg:g") .attr("clip-path", "url(#circle2)") .append("svg:rect") .attr("clip-path", "url(#circle3)") .attr("width", w) .attr("height", h) .style("fill", "#00ffff"); svg.append("svg:g") .attr("clip-path", "url(#circle3)") .append("svg:rect") .attr("clip-path", "url(#circle1)") .attr("width", w) .attr("height", h) .style("fill", "#ff00ff"); svg.append("svg:g") .attr("clip-path", "url(#circle3)") .append("svg:g") .attr("clip-path", "url(#circle2)") .append("svg:rect") .attr("clip-path", "url(#circle1)") .attr("width", w) .attr("height", h) .style("fill", "#ffffff"); </script> </body> </html>