d3-flame-graph
d3-flame-graph copied to clipboard
Fixes issue #8 Move tooltip with mouse pointer
Added event mousemove to call the function tooltip.show(). Now within the frame, the tooltip will follow the mouse pointer.
@spiermar
If mousemove
seems to be risky and not of high priority, then we can again revisit it sometime later on.
For now, if the approach provided in latest commit to resolve tooltip overflowing the chart right boundary is acceptable, let's make it clean and let me know if I need to revert the changes for mousemove
Need to move chartRightBoundary
to tooltip to maintain .show
compatibility with d3-tip.
Working to make it compatible with d3-tip as per https://github.com/caged/d3-tip/blob/master/docs/showing-and-hiding-tooltips.md#tipshow
so that the function is called like tip.show(d, this) like before.
@spiermar I was wondering about the reason why we want our .show
to be compatible with d3-tip. d3-tip.js seems to be a standard and we would want users to be comfortable using flamegraph.tooltip
in the same way as they would use d3-tip. It might be painful to work with libraries which don't have api's consistent with standards.
Is there any other reason?
Need to move
chartRightBoundary
to tooltip to maintain.show
compatibility with d3-tip.
This is done.
@spiermar I was wondering about the reason why we want our
.show
to be compatible with d3-tip. d3-tip.js seems to be a standard and we would want users to be comfortable usingflamegraph.tooltip
in the same way as they would use d3-tip. It might be painful to work with libraries which don't have api's consistent with standards.Is there any other reason?
The change that dropped d3-tip from the dependencies in favor of the simple tooltip script happened recently and most users still use de-tip and will likely continue for a while, even if it was abandoned. Looking to not introduce breaking changes.