-
Notifications
You must be signed in to change notification settings - Fork 74
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
Plots from hvplot
don't work
#3880
Labels
area: plots
Issues related to Plots category.
bug
Something isn't working
lang: python
support
theme: app builder
Milestone
Comments
Thank you for the report! I'm able to repro this on macOS. |
Once #4118 is finished, this may be taken care of since bokeh is the plotting library underpinning hvplot. |
nstrayer
added a commit
that referenced
this issue
Aug 15, 2024
Addresses #3880 ### What This PR adds a new service that intercepts messages from holoviz plots so they can be replayed when a plot is rendered into the plots pane. ### Why This is necessary because holoviz sends preliminary messages that load assets for displaying plots and these messages need to be sent to the plot webview along with the plotting message when rendering the plot or else various assets will not be available. This is not a problem in notebooks because all output is rendered into a single large "backlayer" webview and thus the preliminary messages are properly "remembered." This is specific to holoviz/holoviews plots right now but there is a decent chance this pattern of remembering prerequisite messages and replaying them to the output webview will be useful for other libraries/situations. ### Limitations Right now we store the prereq messages in memory on the UI thread. This is nice and lightweight _but_ has the problem of forgetting those messages if the user reloads the front end. Since hvplots doesn't replay the asset loading messages on reload the plots won't work until the session is restarted. We could do something like make the storage of prereq messages use a non-ui layer cache, but I'm not convinced it will be a big issue. ### Results __hvplots now work in the plots pane__ <img width="1352" alt="image" src="https://github.com/user-attachments/assets/d60dd978-8be9-4cc8-8827-71a5956d9fff"> __Behavior in notebooks should be unchanged__ <img width="953" alt="image" src="https://github.com/user-attachments/assets/8bd307d1-1b46-4c12-886c-ea2293aedac1"> ### QA Notes This code will create a simple hvplot scatter plot. It should work in the plots pane. ```python import polars as pl import hvplot import hvplot.polars pl.DataFrame(dict(x=[1,2,3], y=[4,5,6])).hvplot.scatter(x="x", y="y") ``` The same code should work in a notebook. (Although even before this PR I noticed sometimes it was flakey which I think is due to how hvplots loads assets). <!-- Add additional information for QA on how to validate the change, paying special attention to the level of risk, adjacent areas that could be affected by the change, and any important contextual information not present in the linked issues. --> --------- Signed-off-by: Nick Strayer <nick.strayer@posit.co> Co-authored-by: Wasim Lorgat <mwlorgat@gmail.com>
jonvanausdeln
added
the
needs automated test
Issue is candidate for automated test
label
Aug 19, 2024
Verified FixedPositron Version(s) : 2024.08.0-48 Test scenario(s)Using original code, the plot shows as expected using:
Link(s) to TestRail test cases run or created: |
jonvanausdeln
removed
the
needs automated test
Issue is candidate for automated test
label
Sep 23, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: plots
Issues related to Plots category.
bug
Something isn't working
lang: python
support
theme: app builder
Positron Version:
Steps to reproduce the issue:
hvplot
.What did you expect to happen?
Should show the plot in the plotting panel and let me play with it, like in the regular Jupyter extension:
Actual behavior
Generates a series of non-viewable plots in the plots pane, but the actual plot doesn't show:
Were there any error messages in the output or Developer Tools console?
No
The text was updated successfully, but these errors were encountered: