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

[Feature Request] add support for application/vnd.holoviews_load.v0+json #142

Open
awray3 opened this issue Jan 31, 2024 · 10 comments
Open
Labels
enhancement New feature or request

Comments

@awray3
Copy link

awray3 commented Jan 31, 2024

Hello,

I am trying to run df.plot() on a pandas Dataframe and view the plot with Molten.
Only text/plain and text/html options are returned by MoltenEvaluateLine, and :MoltenOpenInBrowser shows a blank page.

Is there a specific way I should be running plotting code in order for this to work?

@benlubas
Copy link
Owner

If there's a text/html output it should work. I can check it out

@awray3
Copy link
Author

awray3 commented Jan 31, 2024

Here's the output of debug logs:
image

No image is displayed either, even though I have image.nvim installed and configured correctly (I think) with all optional dependencies in my neovim environment (which is separate from the kernel environment)

@benlubas
Copy link
Owner

benlubas commented Feb 1, 2024

I'm curious about the HTML mimetype b/c I don't see it. I am seeing the image though. I guess you haven't setup image.nvim correctly

image

@awray3
Copy link
Author

awray3 commented Feb 1, 2024

I can confirm I have image.nvim working (I put the neovim logo there with require('image').from_file(...)) and I've set the image.nvim config. I use Lunarvim for the base of my config, perhaps there's a conflict in some autogroup somewhere.

image

@benlubas
Copy link
Owner

benlubas commented Feb 1, 2024

I highly doubt that it's Lunarvim interfering.

do you have you config on github that you could link for me to take a look at?

@awray3
Copy link
Author

awray3 commented Feb 1, 2024

Yes, here's my config. I'm running on kitty.

@awray3
Copy link
Author

awray3 commented Feb 1, 2024

Aha, I found what was missing from the init function:

vim.g.molten_image_provider = "image.nvim"

Now plots that come back as image/png work!

Though I guess there's still the original problem. I often use hvplot which returns 'text/html' instead of 'image/png', and I'm still getting nothing from :MoltenOpenInBrowser.

@benlubas
Copy link
Owner

benlubas commented Feb 1, 2024

I also see nothing when trying to run the following code:

import hvplot.pandas  # noqa
from bokeh.sampledata import iris

iris = iris.flowers

hvplot.plotting.andrews_curves(
    iris,
    class_column='species',
    samples=20,

There are a few hints in the browser console:
image

And that in conjunction with this from their website:
image

Makes me think that we need to do something extra for this to work...

@benlubas
Copy link
Owner

benlubas commented Feb 1, 2024

This is the special mimetype that we could support: application/vnd.holoviews_load.v0+json. I'm not sure which javascript library we need to load, or where to get it from or anything like that honestly. Do you have any idea where to look?

@awray3
Copy link
Author

awray3 commented Feb 2, 2024

I could look into it

@benlubas benlubas changed the title [Help] text/html mimetype isn't displaying in browser [Feature Request] add support for application/vnd.holoviews_load.v0+json Feb 2, 2024
@benlubas benlubas added the enhancement New feature or request label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants