Skip to content

bug: interactions misaligned when plot is inside transform: scale()-ed element #888

Closed
@hellochar

Description

@hellochar

See http://codepen.io/hellochar/pen/JKgXPE and mouse around.

Looks like plotly.js miscalculates where the mouse is positioned if the plot itself is rendered inside an element with a transform: scale() CSS property set. The tooltips don't match up with where the mouse is. This is most apparent when you try to click+drag an area of the plot and it clearly shows the locations don't match up.

The buttons in the toolbar line up correctly, as does the hitbox for dragging the axes or enabling/disabling specific traces.

Also it looks like if you're at the top-left corner of the plot, the mouse position is accurate (that is, the (0, 0) origin point is handled correctly; only the scaling factor is off).

Also see palantir/plottable#1644 which looks to be the same issue in Plottable.

Let me know if that makes sense and if there's something else I can do!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething brokencommunitycommunity contribution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions