Last active
January 11, 2016 01:49
Revisions
-
carlsonsolutiondesign revised this gist
Jan 11, 2016 . 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 @@ -142,7 +142,7 @@ }) .attr("xlink:href", function(d) { return (d.depth == 1 ? "#curvedPath" : null); }) .attr("fill", function(d, i) { return color(map(d.name)); } ) .style("font-size", min/45 + "px") .text(function(d) { return (d.depth == 1 ? d.name : ""); }); var g = node.append("svg:g") @@ -158,7 +158,7 @@ .attr("dy", ".31em") .attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; }) .attr("transform", function(d) { return d.x < 180 ? "" : "rotate(180)"; }) .style("font-size", min/45 + "px") .text(function(d) { return (d.depth == 2 ? d.name : ""); }) // minor links -
carlsonsolutiondesign revised this gist
Jan 11, 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 @@ -107,7 +107,7 @@ var arc = d3.svg.arc() .innerRadius(0) .outerRadius(function(d,i) {return min/7; }) .startAngle(function(d,i) { return 0;}) .endAngle(function(d) { return 2*pi;}); -
carlsonsolutiondesign revised this gist
Jan 11, 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 @@ -125,7 +125,7 @@ var cluster = d3.layout.cluster() .separation(function(d) { return 1;}) .size([360, min/4]) .sort(null); var nodes = cluster.nodes(json); -
carlsonsolutiondesign revised this gist
Jan 11, 2016 . 1 changed file with 3 additions and 3 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 @@ -147,7 +147,7 @@ var g = node.append("svg:g") .attr("class", "node") .attr("transform", function(d) { return "rotate(" + (d.x - 90) + ") translate(" + d.y + ")"; }); g.append("svg:circle") .attr("r", function(d) { return d.size * min / 900; }) @@ -157,7 +157,7 @@ .attr("dx", function(d) { return d.x < 180 ? 18 : -18; }) .attr("dy", ".31em") .attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; }) .attr("transform", function(d) { return d.x < 180 ? "" : "rotate(180)"; }) .style("font-size", min/50 + "px") .text(function(d) { return (d.depth == 2 ? d.name : ""); }) @@ -197,7 +197,7 @@ if (o.depth == 2 && count[o.name] > 1) { o.x += 2.5; } return "rotate(" + (o.x - 90) + ") translate(" + d.target.y + ")"; }) .append("svg:circle") .attr("r", function(d) { return d.source.size * min / 900; }) -
carlsonsolutiondesign revised this gist
Jan 11, 2016 . 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 @@ -71,7 +71,7 @@ }); // once the big circles have been plotted, move y inward if (d.depth == 2) { d.y /= 1.15; } }); json.forEach(function(d) { @@ -107,7 +107,7 @@ var arc = d3.svg.arc() .innerRadius(0) .outerRadius(function(d,i) {return height/7; }) .startAngle(function(d,i) { return 0;}) .endAngle(function(d) { return 2*pi;}); -
carlsonsolutiondesign revised this gist
Jan 11, 2016 . 1 changed file with 9 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 @@ -71,7 +71,7 @@ }); // once the big circles have been plotted, move y inward if (d.depth == 2) { d.y /= 1.25; } }); json.forEach(function(d) { @@ -107,7 +107,7 @@ var arc = d3.svg.arc() .innerRadius(0) .outerRadius(function(d,i) {return min/7; }) .startAngle(function(d,i) { return 0;}) .endAngle(function(d) { return 2*pi;}); @@ -125,7 +125,7 @@ var cluster = d3.layout.cluster() .separation(function(d) { return 1;}) .size([360, ry/2]) .sort(null); var nodes = cluster.nodes(json); @@ -142,11 +142,12 @@ }) .attr("xlink:href", function(d) { return (d.depth == 1 ? "#curvedPath" : null); }) .attr("fill", function(d, i) { return color(map(d.name)); } ) .style("font-size", min/50 + "px") .text(function(d) { return (d.depth == 1 ? d.name : ""); }); var g = node.append("svg:g") .attr("class", "node") .attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")"; }); g.append("svg:circle") .attr("r", function(d) { return d.size * min / 900; }) @@ -156,9 +157,11 @@ .attr("dx", function(d) { return d.x < 180 ? 18 : -18; }) .attr("dy", ".31em") .attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; }) .attr("transform", function(d) { return d.x < 180 ? "translate(" + d.y/min + ")" : "rotate(180) translate(" + (d.y/min) + ")"; }) .style("font-size", min/50 + "px") .text(function(d) { return (d.depth == 2 ? d.name : ""); }) // minor links var count = {}; var links = getLinks(nodes, count); var splines = bundle(links); @@ -184,6 +187,7 @@ } } // minor circles center.selectAll(".circle") .data(links) .enter().append("svg:g") -
carlsonsolutiondesign revised this gist
Jan 11, 2016 . 1 changed file with 57 additions and 51 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 @@ -16,16 +16,7 @@ <div style="width:100%;height:100%"></div> <script type="text/javascript"> function setup(json) { var domain = []; var range = []; var i = 0; @@ -45,45 +36,65 @@ .domain(domain) .range(range); d3.select(window) .on("resize", function() { /* width = window.innerWidth; height = window.innerHeight; d3.select("svg") .attr("width", width) .attr("height", height); */ d3.select("svg").remove(); redraw(json, map); }) redraw(json, map); } function getLinks(json, count) { var map = {}; var other = []; json.forEach(function(d) { map[d.name] = d; count[d.name] = 0; }); json.forEach(function(d) { if (d.other) d.other.forEach(function(o) { count[o.name]++; other.push({source: map[d.name], target: map[o.name]}); }); // once the big circles have been plotted, move y inward if (d.depth == 2) { d.y -= 28; } }); json.forEach(function(d) { if (d.depth == 2 && count[d.name] > 1) { d.x -= count[d.name] + 0.5; } }); return other; } function redraw(json, map) { var width = $("div").width() || Math.max(document.documentElement.clientWidth, window.innerWidth || 0); var height = $("div").height() || Math.max(document.documentElement.clientHeight, window.innerHeight || 0) var min = width < height ? width : height; var rx = width/2; var ry = height/2; var rm = min/2; var color = d3.scale.category20(); var pi = Math.PI; var bundle = d3.layout.bundle(); @@ -109,20 +120,15 @@ .attr("d", arc) .attr("id", "curvedPath"); var center = svg.append("svg:g") .attr("transform", "translate(" + rx + "," + ry + ")"); var cluster = d3.layout.cluster() .separation(function(d) { return 1;}) .size([360, rm - 170]) .sort(null); var nodes = cluster.nodes(json); var node = center.selectAll("g.node") .data(nodes) .enter().append("svg:g") @@ -150,7 +156,7 @@ .attr("dx", function(d) { return d.x < 180 ? 18 : -18; }) .attr("dy", ".31em") .attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; }) .attr("transform", function(d) { return d.x < 180 ? "translate(" + d.y/min + ")" : "rotate(180) translate(" + (-d.y/min) + ")"; }) .text(function(d) { return (d.depth == 2 ? d.name : ""); }) var count = {}; @@ -197,7 +203,7 @@ $(document).ready(function() { d3.json("sw.json", function(error, json) { if (error) return console.warn(error); setup(json); }); }); </script> -
carlsonsolutiondesign revised this gist
Jan 10, 2016 . 1 changed file with 169 additions and 165 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 @@ -15,186 +15,190 @@ <body> <div style="width:100%;height:100%"></div> <script type="text/javascript"> function redraw(json) { var width = $("div").width() || Math.max(document.documentElement.clientWidth, window.innerWidth || 0); var height = $("div").height() || Math.max(document.documentElement.clientHeight, window.innerHeight || 0) var rx = width/2; var ry = height/2; var min = width < height ? width : height; var color = d3.scale.category20(); var domain = []; var range = []; var i = 0; for (ch in json.children) { child = json.children[ch]; domain.push(child.name); range.push(i); for (gc in child.children) { grandchild = child.children[gc]; domain.push(grandchild.name); range.push(i); } i++; } var map = d3.scale.ordinal() .domain(domain) .range(range); function getLinks(json, count) { var map = {}; var other = []; json.forEach(function(d) { map[d.name] = d; count[d.name] = 0; }); json.forEach(function(d) { if (d.other) d.other.forEach(function(o) { count[o.name]++; other.push({source: map[d.name], target: map[o.name]}); }); // once the big circles have been plotted, move y inward if (d.depth == 2) { d.y -= 28; } }); json.forEach(function(d) { if (d.depth == 2 && count[d.name] > 1) { d.x -= count[d.name] + 0.5; } }); return other; } var pi = Math.PI; var cluster = d3.layout.cluster() .separation(function(d) { return 1;}) .size([360, ry - 170]) .sort(null); var bundle = d3.layout.bundle(); var line = d3.svg.line.radial() .interpolate("bundle") .tension(0.50) .radius(function(d) { return d.y; }) .angle(function(d) { return d.x / 180 * pi; }); var arc = d3.svg.arc() .innerRadius(0) .outerRadius(function(d,i) {return (height+width)/11.5; }) .startAngle(function(d,i) { return 0;}) .endAngle(function(d) { return 2*pi;}); var svg = d3.select("div") .append("svg:svg") .attr("viewBox", "0 0 " + width + " " + height); svg.append('defs') .append('path') .attr("d", arc) .attr("id", "curvedPath"); d3.select(window) .on("resize", function() { width = window.innerWidth; height = window.innerHeight; svg .attr("width", width) .attr("height", height); }) var center = svg.append("svg:g") .attr("transform", "translate(" + rx + "," + ry + ")"); var nodes = cluster.nodes(json); var node = center.selectAll("g.node") .data(nodes) .enter().append("svg:g") node.append("svg:text") .attr("text-anchor", function(d) { return "middle"; }) .append('textPath') .attr("startOffset", function(d) { var percent = 100*d.x/360; return (percent >= 50 ? percent - 50 : percent + 50) +"%"; }) .attr("xlink:href", function(d) { return (d.depth == 1 ? "#curvedPath" : null); }) .attr("fill", function(d, i) { return color(map(d.name)); } ) .text(function(d) { return (d.depth == 1 ? d.name : ""); }); var g = node.append("svg:g") .attr("class", "node") .attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" +d.y + ")"; }); g.append("svg:circle") .attr("r", function(d) { return d.size * min / 900; }) .attr("fill", function (d,i) { return color(map(d.name));}); g.append("svg:text") .attr("dx", function(d) { return d.x < 180 ? 18 : -18; }) .attr("dy", ".31em") .attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; }) .attr("transform", function(d) { return d.x < 180 ? null : "rotate(180)"; }) .text(function(d) { return (d.depth == 2 ? d.name : ""); }) var count = {}; var links = getLinks(nodes, count); var splines = bundle(links); center.selectAll(".path") .data(links) .enter().append("svg:path") .attr("stroke", function(d) {return color(map(d.source.name));}) .attr("fill", "none") .attr("class", "path") .attr("d", function(d, i) { var o = splines[i][3]; if (o.depth == 2 && count[o.name] > 1) { o.x += 2.5; } return line(splines[i]); }); // set o.x back for (i in splines) { var o = splines[i][3]; if (o.depth == 2 && count[o.name] > 1) { o.x -= 2.5; } } center.selectAll(".circle") .data(links) .enter().append("svg:g") .attr("class", "circle") .attr("transform", function(d,i) { var o = splines[i][3]; if (o.depth == 2 && count[o.name] > 1) { o.x += 2.5; } return "rotate(" + (o.x - 90) + ")translate(" + d.target.y + ")"; }) .append("svg:circle") .attr("r", function(d) { return d.source.size * min / 900; }) .attr("fill", function (d,i) { return color(map(d.source.name));}); } $(document).ready(function() { d3.json("sw.json", function(error, json) { if (error) return console.warn(error); redraw(json); }); }); </script> <script type="text/javascript"> -
carlsonsolutiondesign revised this gist
Jan 10, 2016 . 1 changed file with 4 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 @@ -17,10 +17,9 @@ <script type="text/javascript"> $(document).ready(function() { d3.json("sw.json", function(error, json) { if (error) return console.warn(error); var width = $("div").width() || Math.max(document.documentElement.clientWidth, window.innerWidth || 0); var height = $("div").height() || Math.max(document.documentElement.clientHeight, window.innerHeight || 0) var rx = width/2; var ry = height/2; @@ -111,7 +110,7 @@ .attr("d", arc) .attr("id", "curvedPath"); d3.select(window) .on("resize", function() { width = window.innerWidth; height = window.innerHeight; -
coderextreme revised this gist
Jan 10, 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 @@ -1,2 +1,2 @@ Built with [blockbuilder.org](http://blockbuilder.org). Click on Open in a new window to see responsiveness. -
carlsonsolutiondesign revised this gist
Jan 10, 2016 . 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 @@ -1 +1,2 @@ Built with [blockbuilder.org](http://blockbuilder.org) Click on Open in a new window to see responsiveness. -
carlsonsolutiondesign revised this gist
Jan 10, 2016 . 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 @@ -198,9 +198,9 @@ }); }); </script> <script type="text/javascript"> // Hack to make this example display correctly in an iframe on bl.ocks.org d3.select(self.frameElement).style("height", "700px"); </script> </body> </html> -
carlsonsolutiondesign revised this gist
Jan 10, 2016 . 1 changed file with 10 additions and 11 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 @@ -19,12 +19,12 @@ d3.json("sw.json", function(error, json) { if (error) return console.warn(error); var divNode = d3.select("div").node() var width = $("div").width(); height = $("div").height() || window.innerHeight; var rx = width/2; var ry = height/2; var min = width < height ? width : height; var color = d3.scale.category20(); @@ -98,13 +98,13 @@ var arc = d3.svg.arc() .innerRadius(0) .outerRadius(function(d,i) {return (height+width)/11.5; }) .startAngle(function(d,i) { return 0;}) .endAngle(function(d) { return 2*pi;}); var svg = d3.select("div") .append("svg:svg") .attr("viewBox", "0 0 " + width + " " + height); svg.append('defs') .append('path') @@ -115,7 +115,6 @@ .on("resize", function() { width = window.innerWidth; height = window.innerHeight; svg .attr("width", width) .attr("height", height); @@ -147,7 +146,7 @@ .attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" +d.y + ")"; }); g.append("svg:circle") .attr("r", function(d) { return d.size * min / 900; }) .attr("fill", function (d,i) { return color(map(d.name));}); g.append("svg:text") @@ -194,7 +193,7 @@ return "rotate(" + (o.x - 90) + ")translate(" + d.target.y + ")"; }) .append("svg:circle") .attr("r", function(d) { return d.source.size * min / 900; }) .attr("fill", function (d,i) { return color(map(d.source.name));}); }); }); -
carlsonsolutiondesign revised this gist
Jan 10, 2016 . 1 changed file with 14 additions and 14 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 @@ -18,11 +18,11 @@ $(document).ready(function() { d3.json("sw.json", function(error, json) { if (error) return console.warn(error); var divNode = d3.select("div").node() console.log(divNode); var w = $("div").width(); h = $("div").height() || window.innerHeight; console.log(w+" "+h); var rx = w/2; var ry = h/2; @@ -98,30 +98,30 @@ var arc = d3.svg.arc() .innerRadius(0) .outerRadius(function(d,i) {return w/6; }) .startAngle(function(d,i) { return 0;}) .endAngle(function(d) { return 2*pi;}); var svg = d3.select("div") .append("svg:svg") .attr("viewBox", "0 0 " + w + " " + h); svg.append('defs') .append('path') .attr("d", arc) .attr("id", "curvedPath"); d3.select("div") .on("resize", function() { width = window.innerWidth; height = window.innerHeight; console.log(w+" "+h); svg .attr("width", width) .attr("height", height); cluster.size([width, height]); }) var center = svg.append("svg:g") .attr("transform", "translate(" + rx + "," + ry + ")"); @@ -204,4 +204,4 @@ d3.select(self.frameElement).style("height", "700px"); </script--> </body> </html> -
carlsonsolutiondesign revised this gist
Jan 10, 2016 . 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. -
coderextreme revised this gist
Jan 10, 2016 . No changes.There are no files selected for viewing
-
coderextreme revised this gist
Jan 10, 2016 . 1 changed file with 4 additions and 4 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 @@ -98,7 +98,7 @@ var arc = d3.svg.arc() .innerRadius(0) .outerRadius(function(d,i) {return w/20; }) .startAngle(function(d,i) { return 0;}) .endAngle(function(d) { return 2*pi;}); @@ -138,7 +138,7 @@ var percent = 100*d.x/360; return (percent >= 50 ? percent - 50 : percent + 50) +"%"; }) .attr("xlink:href", function(d) { return (d.depth == 1 ? "#curvedPath" : null); }) .attr("fill", function(d, i) { return color(map(d.name)); } ) .text(function(d) { return (d.depth == 1 ? d.name : ""); }); @@ -190,8 +190,8 @@ var o = splines[i][3]; if (o.depth == 2 && count[o.name] > 1) { o.x += 2.5; } return "rotate(" + (o.x - 90) + ")translate(" + d.target.y + ")"; }) .append("svg:circle") .attr("r", function(d) { return d.source.size; }) -
coderextreme revised this gist
Jan 10, 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 @@ -98,7 +98,7 @@ var arc = d3.svg.arc() .innerRadius(0) .outerRadius(function(d,i) {return w/6; }) .startAngle(function(d,i) { return 0;}) .endAngle(function(d) { return 2*pi;}); -
coderextreme revised this gist
Jan 10, 2016 . No changes.There are no files selected for viewing
-
coderextreme revised this gist
Jan 10, 2016 . 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 @@ -20,8 +20,8 @@ if (error) return console.warn(error); var divNode = d3.select("div").node() console.log(divNode); var w = divNode.offsetWidth || window.width; h = divNode.offsetHeight || window.height; console.log(w+" "+h); var rx = w/2; var ry = h/2; -
coderextreme revised this gist
Jan 10, 2016 . 1 changed file with 4 additions and 3 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 @@ -18,9 +18,10 @@ $(document).ready(function() { d3.json("sw.json", function(error, json) { if (error) return console.warn(error); var divNode = d3.select("div").node() console.log(divNode); var w = divNode.offsetWidth; h = divNode.offsetHeight; console.log(w+" "+h); var rx = w/2; var ry = h/2; -
coderextreme revised this gist
Jan 10, 2016 . 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 @@ -19,8 +19,8 @@ d3.json("sw.json", function(error, json) { if (error) return console.warn(error); var w = d3.select("div").width(); h = d3.select("div").height(); console.log(w+" "+h); var rx = w/2; var ry = h/2; -
coderextreme revised this gist
Jan 10, 2016 . 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 @@ -19,8 +19,8 @@ d3.json("sw.json", function(error, json) { if (error) return console.warn(error); var w = d3.select("div").width; h = d3.select("div").height; console.log(w+" "+h); var rx = w/2; var ry = h/2; -
coderextreme revised this gist
Jan 10, 2016 . No changes.There are no files selected for viewing
-
coderextreme revised this gist
Jan 10, 2016 . 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 @@ -21,7 +21,7 @@ var w = d3.select("div").attr("width"); h = d3.select("div").attr("height"); console.log(w+" "+h); var rx = w/2; var ry = h/2; @@ -109,6 +109,7 @@ .on("resize", function() { width = d3.select("div").attr("width"); height = d3.select("div").attr("height"); console.log(w+" "+h); svg .attr("width", width) .attr("height", height); -
coderextreme revised this gist
Jan 10, 2016 . 1 changed file with 6 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 @@ -3,10 +3,14 @@ <head> <meta charset="utf-8"> <title>Double Hierarchy DAG</title> <style> body { width:100%; height:100%; } </style> <script src="http://d3js.org/d3.v3.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> </head> <body> <div style="width:100%;height:100%"></div> -
coderextreme revised this gist
Jan 10, 2016 . 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 @@ -9,14 +9,15 @@ href="https://fonts.googleapis.com/css?family=Open+Sans:400,600"> </head> <body> <div style="width:100%;height:100%"></div> <script type="text/javascript"> $(document).ready(function() { d3.json("sw.json", function(error, json) { if (error) return console.warn(error); var w = d3.select("div").attr("width"); h = d3.select("div").attr("height"); alert(w+" "+h); var rx = w/2; var ry = h/2; -
coderextreme revised this gist
Jan 10, 2016 . 1 changed file with 4 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 @@ -11,6 +11,7 @@ <body> <div></div> <script type="text/javascript"> $(document).ready(function() { d3.json("sw.json", function(error, json) { if (error) return console.warn(error); @@ -188,11 +189,12 @@ .append("svg:circle") .attr("r", function(d) { return d.source.size; }) .attr("fill", function (d,i) { return color(map(d.source.name));}); }); }); </script> <!--script type="text/javascript"> // Hack to make this example display correctly in an iframe on bl.ocks.org d3.select(self.frameElement).style("height", "700px"); </script--> </body> </html> -
coderextreme revised this gist
Jan 10, 2016 . 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 @@ -14,8 +14,8 @@ d3.json("sw.json", function(error, json) { if (error) return console.warn(error); var w = d3.select("div").attr("width"); h = d3.select("div").attr("height"); var rx = w/2; var ry = h/2; -
coderextreme revised this gist
Jan 10, 2016 . 1 changed file with 7 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 @@ -9,12 +9,13 @@ href="https://fonts.googleapis.com/css?family=Open+Sans:400,600"> </head> <body> <div></div> <script type="text/javascript"> d3.json("sw.json", function(error, json) { if (error) return console.warn(error); var w = document.innerWidth, h = document.innerHeight; var rx = w/2; var ry = h/2; @@ -94,14 +95,14 @@ .startAngle(function(d,i) { return 0;}) .endAngle(function(d) { return 2*pi;}); var svg = d3.select("div") .append("svg:svg") .attr("viewBox", "0 0 " + w + " " + h); d3.select("div") .on("resize", function() { width = d3.select("div").attr("width"); height = d3.select("div").attr("height"); svg .attr("width", width) .attr("height", height);
NewerOlder