-
Notifications
You must be signed in to change notification settings - Fork 245
Description
Shiny is having a problem with calculating coordinate information with the release version of Plotnine.
I'll demonstrate with this app from the shinylive examples: https://shinylive.io/py/examples/#basic-plot-interaction
With this screenshot, the cursor is at (4, 25), and the x and y coordinates are detected to be right on, at (4.0, 25.0). Note that this is with shinylive, which uses a custom build of plotnine that avoids the problem. (https://github.com/wch/plotnine/tree/fix-dims)
If I save the files from that app and run it with regular Python (not shinylive) using shiny 0.6.1.1 and plotnine 0.12.4 installed from PyPI, it demonstrates the problem -- the detected coordinates are slightly off, at (4.27, 25.9):
The code in Shiny that extracts the coordmap information is here. It basically finds the mapping between the pixel coordinate space and the data coordinate space. I believe that in the release version of plotnine, the detection of the pixel coordinate space is not correct.

