Skip to content

Suggestion: support responsive size (mouse events) #15

Description

@mikkokam

By adding this, sparkline interactionLayer can support responsive (% - based) sizes (css expanding the sparkline to fit a div, for instance).

var realWidth;

interactionLayer.addEventListener("mouseover", event => {
    realWidth = svg.clientWidth;
});

interactionLayer.addEventListener("mousemove", event => {
    const mouseX = (event.offsetX * width) / realWidth;
...

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions