binnisb / blog

Jupyter notebook blog
https://binnisb.github.io/blog
Apache License 2.0
2 stars 0 forks source link

Getting Plotly working in Jupyter Lab and fastpages | Brain Relieve #3

Open utterances-bot opened 4 years ago

utterances-bot commented 4 years ago

Getting Plotly working in Jupyter Lab and fastpages | Brain Relieve

Steps to get plotly and cufflinks working in jupyter lab

https://binnisb.github.io/blog/datascience/2020/04/02/Plotly-in-lab.html

binnisb commented 4 years ago

Testing comments

hamelsmu commented 4 years ago

It would be nice if you explained a little bit about what cufflinks is? If you fleshed this blog post out a little bit more with more thorough instructions and background would love to incorporate this into the official docs. Thanks!

binnisb commented 4 years ago

Hey. I'll do it.

How about I update the notebook here, and ping you here in a comment when I feel it's about ready?

Or should I copy the notebook to fastpages repo and do a PR there ?

hamelsmu commented 4 years ago

Just let me know when it’s ready on your blog and I’ll just link to it from the README

binnisb commented 4 years ago

@hamelsmu I am done with cleaning up the post. Feel free to reference it if you want and please don't hesitate to point out improvements I can make.

For others that might use this as reference, please give feedback if something is unclear or is not working / wrong. Thanks!

binnisb commented 4 years ago

@hamelsmu As you can see in the post, I need to render the figures with HTML(fig.to_html()), even when the figures render in the notebook locally. Do you have some idea why? I might try to figure out why, but it works for me as is at the moment so might not be worth the effort :smile:

SamCurtis111 commented 3 years ago

is it possible to use ipywidgets dropdowns instead of altair for fast pages?

viniviena commented 3 years ago

Hey. Great post, dude! I saw your previous post about how including plotly figures into fastpages. I tried your solution but it seems it is crashing fastpages in 2021. Do you have any contact so i can send you the error messages and maybe get your help? It would be really useful :D

SamCurtis111 commented 3 years ago

@viniviena I was working through this a few days ago and found using: HTML(graphname.to_html(include_plotlyjs='cdn')) Works for me. Note that the above will not show up in the notebook itself, so put the line of code in its own cell and if you want to see the graph in notebook then call it how you usually would in Jupyter and use #hide at the top of the cell

viniviena commented 3 years ago

@SamCurtis111 It worked! I really appreciate your help. Thank you a lot. Do you know if we can use widgets inside of it as well? Like slide bars and menus.

SamCurtis111 commented 3 years ago

@viniviena no problem at all. Unfortunately you cant use widgets with fastpages (read it in the fastpages docs somewhere recently). This was a real bummer for me, I resorted to using plotly for any charts I had already made that didn't have dropdowns etc but had to use altair for any plots with widgets. It's a lot more cumbersome imo but once you get the hang of making one or two you get a good feel for it and there are lots of examples online.