caged / d3-tip

d3 tooltips
http://labratrevenge.com/d3-tip
MIT License
1.22k stars 349 forks source link

Tooltip positioning with specified rootElement #248

Closed WillMLumere closed 5 years ago

WillMLumere commented 5 years ago

Thanks for this library. This PR resolves issues with using the rootElement method to specify a root for the tooltip div that is not statically positioned at the document root.

  1. Resolve errors that arise when using rootElement by treating the variable consistently as a function that returns a node
  2. Account for positioning, scrolling, and document margins when calculating tooltip position.

This covers all the following positioning cases:

  1. Tooltip parent is static position or is the document root
  2. Tooltip parent has position adjustments and is not in the same layout tree as the chart
  3. Tooltip parent has position adjustments and is in the same layout tree as the chart
  4. Chart is inside of a scrolled parent in any of the above scenarios
stale[bot] commented 5 years ago

Hey there! It looks like this issue has been automatically marked as stale because it has not had recent activity. To help the maintainers stay focused, it will be closed if no further activity occurs. Thank you for your contributions.