d3-flame-graph icon indicating copy to clipboard operation
d3-flame-graph copied to clipboard

Fixes issue #8 Move tooltip with mouse pointer

Open rohchakr opened this issue 4 years ago • 7 comments

Added event mousemove to call the function tooltip.show(). Now within the frame, the tooltip will follow the mouse pointer.

rohchakr avatar Apr 25 '20 16:04 rohchakr

@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

rohchakr avatar Apr 29 '20 13:04 rohchakr

tooltip1tooltip2

rohchakr avatar Apr 29 '20 13:04 rohchakr

Need to move chartRightBoundary to tooltip to maintain .show compatibility with d3-tip.

spiermar avatar May 11 '20 19:05 spiermar

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.

rohchakr avatar May 16 '20 08:05 rohchakr

@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?

rohchakr avatar May 16 '20 08:05 rohchakr

Need to move chartRightBoundary to tooltip to maintain .show compatibility with d3-tip.

This is done.

rohchakr avatar May 16 '20 11:05 rohchakr

@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?

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.

spiermar avatar May 20 '20 17:05 spiermar