-
-
Save mbostock/2565344 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
Feb 9, 2016 . 1 changed file with 1 addition and 1 deletion.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 @@ -13,7 +13,7 @@ </style> <body> <script src="//d3js.org/d3.v3.min.js"></script> <script> var svg = d3.select("body").append("svg") -
mbostock revised this gist
Oct 5, 2015 . No changes.There are no files selected for viewing
-
mbostock revised this gist
Oct 5, 2015 . 3 changed files with 26 additions and 16 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 @@ A demonstration of [SVG’s textPath element](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/textPath). 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,29 +1,38 @@ <!DOCTYPE html> <meta charset="utf-8"> <style> #curve-text { font: 40px sans-serif; } #curve-line { stroke: #999; fill: none; } </style> <body> <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script> <script> var svg = d3.select("body").append("svg") .attr("width", 960) .attr("height", 500) .attr("viewBox", "0 0 1000 300"); svg.append("defs").append("path") .attr("id", "curve") .attr("d", "M100,200C200,100 300,0 400,100C500,200 600,300 700,200C800,100 900,100 900,100"); svg.append("text") .attr("id", "curve-text") .append("textPath") .attr("xlink:href", "#curve") .text("We go up, then we go down, then up again."); svg.append("use") .attr("id", "curve-line") .attr("xlink:href", "#curve"); </script> LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed. -
mbostock revised this gist
Jun 11, 2015 . 1 changed file with 1 addition and 1 deletion.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,7 +1,7 @@ <!DOCTYPE html> <meta charset="utf-8"> <body> <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> <script> var svg = d3.select("body").append("svg") -
mbostock revised this gist
Jun 11, 2015 . 1 changed file with 1 addition and 1 deletion.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,7 +1,7 @@ <!DOCTYPE html> <meta charset="utf-8"> <body> <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.js"></script> <script> var svg = d3.select("body").append("svg") -
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 revised this gist
Jul 20, 2012 . 1 changed file with 0 additions and 1 deletion.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,4 +1,3 @@ <!DOCTYPE html> <meta charset="utf-8"> <body> -
mbostock revised this gist
May 1, 2012 . 1 changed file with 9 additions and 8 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,3 +1,4 @@ <!DOCTYPE html> <meta charset="utf-8"> <body> @@ -13,17 +14,17 @@ var thing = svg.append("g") .attr("id", "thing") .style("fill", "navy"); thing.append("text") .style("font-size", "20px") .append("textPath") .attr("xlink:href", "#s3") .text("Wavy text is the gimmick for many years to come (d3)"); thing.append("use") .attr("xlink:href", "#s3") .style("stroke", "black") .style("fill", "none"); </script> -
mbostock revised this gist
May 1, 2012 . 1 changed file with 20 additions and 44 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,53 +1,29 @@ <!DOCTYPE html> <meta charset="utf-8"> <body> <script src="http://d3js.org/d3.v2.js"></script> <script> var svg = d3.select("body").append("svg") .attr("viewBox", "0 0 500 300"); svg.append("defs").append("path") .attr("id", "s3") .attr("d", "M 10,90 Q 100,15 200,70 Q 340,140 400,30"); var thing = svg.append("g") .attr("id", "thing") .attr("fill", "navy"); thing.append("text") .attr("font-size", "20") .append("textPath") .attr("xlink:href", "#s3") .text("Wavy text is the gimmick for many years to come (d3)"); thing.append("use") .attr("xlink:href", "#s3") .attr("stroke", "black") .attr("fill", "none"); </script> -
dustin revised this gist
May 1, 2012 . 1 changed file with 2 additions and 2 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 @@ -38,13 +38,13 @@ .append("text") .attr("font-size", "20") .append("textPath") .attr("xlink:href", "#s3") .text("Wavy text is the gimmick for many years to come (d3)"); d3.select("#thing").append("use") .attr("x", 0) .attr("y", 0) .attr("xlink:href", "#s3") .attr("stroke", "black") .attr("fill", "none"); -
dustin revised this gist
May 1, 2012 . 1 changed file with 2 additions and 2 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 @@ -38,13 +38,13 @@ .append("text") .attr("font-size", "20") .append("textPath") .attr("{http://www.w3.org/1999/xlink}:href", "#s3") .text("Wavy text is the gimmick for many years to come (d3)"); d3.select("#thing").append("use") .attr("x", 0) .attr("y", 0) .attr("{http://www.w3.org/1999/xlink}:href", "#s3") .attr("stroke", "black") .attr("fill", "none"); -
dustin revised this gist
May 1, 2012 . 1 changed file with 2 additions and 1 deletion.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 @@ -24,7 +24,8 @@ var svg = d3.select("body") .append("svg:svg") .attr("viewBox", "0 0 500 300") .attr("version", "1.1"); svg.append("defs") .append("path") -
dustin revised this gist
May 1, 2012 . 1 changed file with 1 addition and 1 deletion.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 @@ -38,7 +38,7 @@ .attr("font-size", "20") .append("textPath") .attr("xlink:href", "#s3") .text("Wavy text is the gimmick for many years to come (d3)"); d3.select("#thing").append("use") .attr("x", 0) -
dustin revised this gist
May 1, 2012 . 1 changed file with 7 additions and 7 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 @@ -6,17 +6,17 @@ <script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.4.0/d3.js"></script> </head> <body> <svg viewBox="0 0 500 300" version="1.1"> <defs> <path id="s2" d="M 10,90 Q 100,15 200,70 Q 340,140 400,30"/> </defs> <g fill="navy"> <text font-size="20"> <textPath xlink:href="#s2"> Wavy text is the gimmick for many years to come (original) </textPath> </text> <use x="0" y="0" xlink:href="#s2" stroke="black" fill="none"/> </g> </svg> -
dustin revised this gist
May 1, 2012 . 1 changed file with 3 additions and 5 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 @@ -6,22 +6,20 @@ <script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.4.0/d3.js"></script> </head> <body> <svg viewBox = "0 0 500 300" version = "1.1"> <defs> <path id = "s2" d = "M 10,90 Q 100,15 200,70 Q 340,140 400,30"/> </defs> <g fill = "navy"> <text font-size = "20"> <textPath xlink:href = "#s2"> Wavy text is the gimmick for many years to come </textPath> </text> <use x = "0" y = "0" xlink:href = "#s2" stroke = "black" fill = "none"/> </g> </svg> <script type="text/javascript"> var svg = d3.select("body") -
dustin revised this gist
May 1, 2012 . 1 changed file with 0 additions and 1 deletion.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 @@ -36,7 +36,6 @@ svg.append("svg:g") .attr("id", "thing") .attr("fill", "navy") .append("text") .attr("font-size", "20") .append("textPath") -
dustin revised this gist
May 1, 2012 . 1 changed file with 1 addition and 1 deletion.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 @@ -26,7 +26,7 @@ var svg = d3.select("body") .append("svg:svg") .attr("viewBox", "0 0 500 300"); svg.append("defs") .append("path") -
dustin revised this gist
May 1, 2012 . 1 changed file with 9 additions and 6 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 @@ -24,17 +24,13 @@ --> <script type="text/javascript"> var svg = d3.select("body") .append("svg:svg") .attr("viewBox", "0 0 500 300); svg.append("defs") .append("path") .attr("id", "s3") .attr("d", "M 10,90 Q 100,15 200,70 Q 340,140 400,30"); svg.append("svg:g") @@ -47,6 +43,13 @@ .attr("xlink:href", "#s3") .text("Wavy text is the gimmick for many years to come"); d3.select("#thing").append("use") .attr("x", 0) .attr("y", 0) .attr("xlink:href", "#s3") .attr("stroke", "black") .attr("fill", "none"); </script> </body> </html> -
dustin created this gist
May 1, 2012 .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,52 @@ <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Path Test</title> <script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.4.0/d3.js"></script> </head> <body> <!-- <svg viewBox = "0 0 500 300" version = "1.1"> <defs> <path id = "s3" d = "M 10,90 Q 100,15 200,70 Q 340,140 400,30"/> </defs> <g fill = "navy"> <text font-size = "20"> <textPath xlink:href = "#s3"> Wavy text is the gimmick for many years to come </textPath> </text> <use x = "0" y = "0" xlink:href = "#s3" stroke = "black" fill = "none"/> </g> </svg> --> <script type="text/javascript"> var w = 960, h = 500; var svg = d3.select("body") .append("svg:svg") .attr("width", w) .attr("height", h); svg.append("defs") .append("path") .attr("id", "d3") .attr("d", "M 10,90 Q 100,15 200,70 Q 340,140 400,30"); svg.append("svg:g") .attr("id", "thing") .attr("fill", "navy") .attr("transform", "translate(" + w / 2 + "," + h / 2 + ")") .append("text") .attr("font-size", "20") .append("textPath") .attr("xlink:href", "#s3") .text("Wavy text is the gimmick for many years to come"); </script> </body> </html>