-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove interactivity-utils #90
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also good not to only fix the tests, but to increase the coverage of the visual with new unit tests. You can start at least with parts that you've changed.
src/behavior.ts
Outdated
this.options.legendItems.on("contextmenu", (event: MouseEvent, dataPoint: LegendDataPoint) => { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
this.selectionManager.showContextMenu(dataPoint.identity, { | ||
x: event.clientX, | ||
y: event.clientY | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can create a callback that gets the identity
and event
as params and call it here and on the lines 151 and 132
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you did it below with emptyContextMenu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The callback is the same for selections
and outerline
d3-selections, but the legendItems
has a little different dataPoint. Identity is retrieved from dataPoint.identity
for LegendDataPoint
and dataPoint.data.identity
for d3PieArcDatum<AsterDataPoint>
.
Therefore, I created a callback for d3PieArcDatum as it's duplicated, but leave the callback for LegendDataPoint
as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why I said that you can pass an identity instead of dataPoint, so it won't affect on it
No description provided.