[BUG] HTMLTooltip wrongly positioned for zero X or Y values · Issue #561 · svelteplot/svelteplot · GitHub
Skip to content

[BUG] HTMLTooltip wrongly positioned for zero X or Y values #561

Description

@bothness

Describe the bug
HTMLToolip gets positioned wrongly when the X or Y value is exactly zero. Instead of being positioned on the correct datum, it gets positioned on the top (Y) or left (X) of the chart.

To Reproduce
Use an HTMLTooltip on a datum with an X or Y value of zero.

Expected behavior
The tooltip should appear on the datum.

Screenshots
Sample datum with a Y value of zero.
Image

Desktop

  • OS: Windows 11
  • Browser: Chrome
  • Version: 148

Additional context
This requires a very simple fix (the issue derives from zero being falsey). I'll submit a PR.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions