Open dung-phan opened 2 years ago
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.
As for your second question, if you point me to which example this is referencing, I can take a look: https://github.com/scotthmurray/d3-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: group. Should it be
svg.selectAll("path") .attr("d", path);
Paths and circles in this example (p.301) are updated onsvg
instead ofmap
which contains themap
instead or it shouldn't matter here? Thanks a lot!