Conversation
There was a problem hiding this comment.
The event from pie/index.js does not have a stopImmediatePropagation method.
There was a problem hiding this comment.
is pt a plain object or an array?
There was a problem hiding this comment.
It's an object. We could wrap it in an array so that points that is returned with the plotly_click event matches scatter events, but it doesn't make sense in the context - there will only be element ever passed - the slice that's clicked on.
There was a problem hiding this comment.
I'd vote for returning an array of length 1 for consistency, even though as you said there will always be only one pt in that array.
cc @alexcjohnson thoughts?
There was a problem hiding this comment.
Yes please, make it an array. For consistency with other types, as @etpinard says, but also with the converse operation for the same type - displaying hover data - which could still include multiple slices that you want to highlight.
|
@etpinard it's now returned as an array in |
|
Looks good. It might be worth spending some time trying to set-up click event tests. |
|
Looks like there's no easy way to click events within out test framework So 💃 + #118 |
Added click event on pie charts.
From issue #105.
It seems like a bit of an ugly hack, but there doesn't appear to be a standardized method for the click event.
The ugly part of adding
slices[0][0].__data__.traceis because for some reason, only the first slice in theeachloop - the largest slice - contains the trace data.I'd prefer to make some changes before merging this in, but I'm open to suggestions.