Pass function for click actions to d3 directive