Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately the code listed in the tutorial is incorrect. The svg element "circle" is specified by three attributes, "cx", x-axis coordinate of the center of the circle, "cy", y-axis coordinate of the center of the circle, and "r", the radius of the circle. I got this information from the w3 specification for an <a href="http://www.w3.org/TR/SVG/shapes.html#CircleElement" rel="nofollow">SVG circle</a>.</p> <p>I would recommend inspecting the JavaScript in the tutorial page to help iron out any other inconsistencies. Here it is:</p> <pre><code>&lt;script type="text/javascript"&gt; var dataset = [], i = 0; for(i=0; i&lt;5; i++){ dataset.push(Math.round(Math.random()*100)); } var sampleSVG = d3.select("#viz5") .append("svg") .attr("width", 400) .attr("height", 100); sampleSVG.selectAll("circle") .data(dataset) .enter().append("circle") .style("stroke", "gray") .style("fill", "white") .attr("r", 40) .attr("cx", function(d, i){return i*80+40}) .attr("cy", 50) .on("mouseover", function(){d3.select(this).style("fill", "aliceblue");}) .on("mouseout", function(){d3.select(this).style("fill", "white");}) .on("mousedown", animateFirstStep); function animateFirstStep(){ d3.select(this) .transition() .delay(0) .duration(1000) .attr("r", 10) .each("end", animateSecondStep); }; function animateSecondStep(){ d3.select(this) .transition() .duration(1000) .attr("r", 40); }; &lt;/script&gt; </code></pre> <p>I also created a JSFiddle which you can utilize to get the basic idea that the author of the tutorial is trying to convey, with respect to utilizing d3.js data, <a href="http://jsfiddle.net/dNRNq/" rel="nofollow">here</a>. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload