Skip to content

epiviz-navigation: Hover state not correctly maintained when navigation changes #16

Description

@daattali

When a hover state is induced on an epiviz-navigation element, and then the user changes the navigation eg. by pressing the left/right buttons or the zoom buttons, the hover remains in the same location on the chart even though the chart moved.

Reproducible example:

<html>

<script src="http://ghcdn.rawgit.org/epiviz/epiviz-chart/master/cdn/jquery/dist/jquery.js"></script>
<script src="http://ghcdn.rawgit.org/epiviz/epiviz-chart/master/cdn/jquery-ui/jquery-ui.js"></script>
<script src="http://ghcdn.rawgit.org/epiviz/epiviz-chart/master/cdn/renderingQueues/renderingQueue.js"></script>

<script src="http://ghcdn.rawgit.org/epiviz/epiviz-chart/master/cdn/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="http://ghcdn.rawgit.org/epiviz/epiviz-chart/master/cdn/epiviz-components.html">

<button id="clickme">Do hover</button>

<epiviz-data-source provider-type="epiviz.data.WebServerDataProvider" provider-id="umd" provider-url="https://epiviz-dev.cbcb.umd.edu/api/"></epiviz-data-source>

<epiviz-navigation chr="chr6" start=40076201 end=45076201 no-logo>
    <epiviz-genes-track id="test" slot="charts" dim-s='["genes"]'></epiviz-genes-track>
</epiviz-navigation>

<script>
document.getElementById('clickme').addEventListener('click', () => {
chart = document.querySelector("epiviz-navigation")
chart.dispatchEvent(
    new CustomEvent("hover", {
        detail: { 
            data: new epiviz.ui.charts.ChartObject("", 41000000, 42000000, undefined, undefined, undefined, undefined, undefined, "chr6")
        }
   })
);
});
</script>

</html>

Initially the hover is correctly shown on 4.1M-4.2M

image

But if I move, the chart updates without the hover area updating

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions