In this case, the syntax:
d3.selectAll('.classname', function() { ... });
does not work in d3.js. Instead you should use something like:
d3.selectAll('.classname').each(function() { ... });
So in your code above, this should work:
d3.selectAll('.item')
.each(function(){
//when an item is clicked, svgClickEvents must not be fired
d3.select('#canvas').on('click', null); //this should remove the event listener
d3.select(this).on("click",function() {
d3.event.stopPropagation();
console.log("click circle");
});
});