Working version with d3 and dispatcher of events