I'm trying to use the 'd3.dispatch' feature in one of my project. I want to setup a custom event and dispatch it to the available listenres using namespace.
I did this :
var dispatcher = d3.dispatch("period_selected");
brush.on("brush", function() {
var s = brush.extent()
// patch the event to listeners
dispatcher.period_selected(s);
});
// register listener for the event namespaced
dispatcher.on("period_selected.my_namespace", function(s,f) {
console.log(event.period_selected);
});
But I can't get back the with namespace as result. Do you have any idea?
Thanks in advance