Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential bug? Issue displaying values on mouse-over if diex, diey are floats #88

Open
hithisishal opened this issue Jul 31, 2020 · 1 comment

Comments

@hithisishal
Copy link

hithisishal commented Jul 31, 2020

Thank you so much for providing this useful library!

I ran into an issue where I couldn't see the value on mouseover if my diex and diey values in xyd were floats (1.0 instead of 1). I could fix this by setting them to integers in my data tuples, but it also worked to change xyd_to_dict() to cast the x and y values as integers:

def xyd_to_dict(xyd_list):
    """Convert the xyd list to a dict of xNNyNN key-value pairs."""
    return {"x{}y{}".format(int(_x), int(_y)): _d for _x, _y, _d in xyd_list}

I wonder if this should be implemented, or if there is a downside that I don't see.

@dougthor42
Copy link
Owner

Yes, that does indeed look like a bug!

To be honest it's been a looong time since I've looked at this code, so I'm 100% sure that implementing the change will have 0 side effects, but it sure does look like it'll be benign. I'm also seeing that my past self made some pretty terrible design choices when making this project, haha.

If you want to submit a PR for the change I'll gladly review it and merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants