palantir / plottable

:bar_chart: A library of modular chart components built on D3
http://plottablejs.org/
MIT License
2.97k stars 224 forks source link

Static position on container messes up which plot point is hovered #3437

Open nchen63 opened 6 years ago

nchen63 commented 6 years ago

Hovering over plot points can hover over the wrong point if there is a static container somewhere in the chart's ancestors.

The fix is to check if the ancestor statically positioned in getCumulativeTransform(). Something functionally equivalent to:

        var styles = window.getComputedStyle(elem);
        if (styles.getPropertyValue("position") == "static") {
            return transform;
        }