javascript - Treemap with d3: the x, y, dx & dy are NaN -


A quick question I have an issue with the D3 Trempe method is when I load this script, all the X 0 and the console tells me that y, dy and dx are not numbers. what I have done?

  var colorScale = d3.scale.category10 (); Var Canvas 9 = D 3.select ("result-side 9"). Append ("SVG") .attr ("width", 600) .attr ("height", 600) .attr ("transform", "translate (10, 10)"); D3.json ("assemblee5.json", function (data) {var treemap = d3.layout.treemap (). Size (550,550) .Node (data); var cells = canvas9.selectAll (". Cell"). Data ("X", function (d) {return dx;} (" ) .attr ("y", function (d, i) {return dy;}) .attr ("width", function (d, i) {return d.dx;}) .attr ("height", function ( D, i) {return d.dy;}) .attr ("fill", function (d, i) {return d.children? Null: colorScale (d.parent.name);}) .attr ("stroke" , "White"); cells .append ("text") .attr ("x", function (d, i) {return dx + d.dx / 2;}) .attr ("y", function (d, I) {return dy + d.dy / 2;}) .text (function (d) {return d.children? "": D.name;}) .attr ("text-anchor", "middle"); });   

JSonLint tells me that my Jason is valid.

First of all your JSOS is if you are valid in your JSN file If you use the example with it then it works fine.

The one thing I kept in mind is that you look at the 'root', 'nodes' or' example, and you will notice that the process of making data from the tree map to be determinated.

This is a better description.

EDIT: Ah .. My bad I forgot 'traymep' for 'tree' apology, this answer will not help much. Pardon.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -