d3book icon indicating copy to clipboard operation
d3book copied to clipboard

Interactivity chapter reorganization

Open jtr13 opened this issue 3 years ago • 0 comments

7.2 change graphic to a bunch of circles on the svg

7.2.1 d3.select("svg").selectAll("circle").on("click") (explain: message is added if someone clicks on any circle point: we don't need any information about which circle or its attributes, data, etc.)

7.2.2 change an attribute d3.select("svg").selectAll("circle").on("click") ... .attr("fill", "blue"); clicking on a circle changes its attribute (you need to know which circle)

7.2.3 get information about the element that received an event d3.select("svg").selectAll("circle") use either cx or r -- should be something that is different for the different circles

7.2.4. d3.select("svg").selectAll("circle").data([ single array of different values than current ones for radii]).on("click", function(event, d) { d3.select(event.currentTarget).attr("r", d); ...

jtr13 avatar May 19 '22 15:05 jtr13