ipyplot icon indicating copy to clipboard operation
ipyplot copied to clipboard

[Bug] HTML wont display

Open LaurenBK opened this issue 4 years ago • 6 comments

Hi, thank's for this package - it looks like exactly what I was looking for. I am struggling to find a way to use this in Databricks though which is where I want to use this. The package runs fine but instead of seeing the output as an image, I see <IPython.core.display.HTML object> twice when I try ipyplot.plot_images or ipyplot.plot_class_tabs Is there a way to add a flag to return the html directly from the function call so I can use the built in function to display html? Because the html is hidden, I can't click the link that would display the html

LaurenBK avatar Nov 10 '21 12:11 LaurenBK

Hi @LaurenBK, Yeah, it should be possible, it would return HTML as string though - would that work for you?

karolzak avatar Nov 10 '21 12:11 karolzak

Hi, yes please that would be great. Databricks has a method to display html but the command is slightly different to jupyter which is why the current html helper is not displaying it correctly. I should be able to get around this with the string

LaurenBK avatar Nov 10 '21 13:11 LaurenBK

Hi, yes please that would be great. Databricks has a method to display html but the command is slightly different to jupyter which is why the current html helper is not displaying it correctly. I should be able to get around this with the string

Now that I think about it, maybe it would make sense to add an internal check for environment and if it's Databricks then use different display function?

karolzak avatar Nov 10 '21 13:11 karolzak

That would be much simpler for a user. Would checking for a Databricks environment be simple though? It looks like you might do it by checking for environment variables but would these always be set up the same way? It might end up being more work down the line.

LaurenBK avatar Nov 10 '21 15:11 LaurenBK

I'll think about implementing both options. Returning html as a string is simpler and it would be a good "quick and dirty" workaround but in longer perspective I'll think about adding automatic platform detection to better address running IPyPlot in different environments

karolzak avatar Nov 10 '21 15:11 karolzak

Experiencing same issue here. How can I return the HTML as string with ipyplot.plot_images ? Thanks

utkuarslan5 avatar Oct 10 '22 11:10 utkuarslan5