You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original code: var dragging = function(d) { //Log out d3.event, so you can see all the goodies inside //console.log(d3.event);
It should be function(e,d) and console.log(e) and using e (event) to get access to dx and dy.
Also I have a question: svg.selectAll("path") .attr("d", path);
Paths and circles in this example (p.301) are updated on svg instead of map which contains the group. Should it be map instead or it shouldn't matter here?
Thanks a lot!
The text was updated successfully, but these errors were encountered:
Thanks @dung-phan! I suspect that you're using a newer version of D3. The book and examples are written to work with v4.5.0 — if you use a newer version (like the current version), you'll have to make some changes.
I've flagged this to update in some future version of the book.
Original code:
var dragging = function(d) {
//Log out d3.event, so you can see all the goodies inside
//console.log(d3.event);
It should be
function(e,d)
andconsole.log(e)
and usinge
(event) to get access todx
anddy
.Also I have a question:
svg.selectAll("path") .attr("d", path);
Paths and circles in this example (p.301) are updated on
svg
instead ofmap
which contains the group. Should it bemap
instead or it shouldn't matter here?Thanks a lot!
The text was updated successfully, but these errors were encountered: