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

Styling hvplot output in notebook #1

Open
jbusecke opened this issue Apr 28, 2021 · 4 comments
Open

Styling hvplot output in notebook #1

jbusecke opened this issue Apr 28, 2021 · 4 comments

Comments

@jbusecke
Copy link
Collaborator

I was super impressed by the neat styling of @cisaacstern s work here.

I am wondering if I can apply similar things via a configuration file in all my notebooks?

@cisaacstern
Copy link

@jbusecke, the example you've linked is deployed on a Bokeh server using Panel's command line interface: https://panel.holoviz.org/user_guide/Deploy_and_Export.html#launching-a-server-on-the-commandline

In general, Panel objects in a notebook can be deployed in this way by appending .servable() to them, and then calling panel serve notebook_file.ipynb from the command line, as described above. The interactive object will then be viewable in its own browser tab, without any code.

This same command line syntax can also be used with .py files. (This is the tangent I started down during the meeting: I believe developing more complex Panel apps is easier to do in .py files, mainly because they play much more nicely with git. You can still experiment with these files line-by-line by using jupytext, which allows you to open and run .py files in Jupyter.)

To unlock more customization in the appearance of your final app, I'd recommend exploring Panel's Templates, and in particular the Custom Template, which is what I used to make the app you linked to above. This is a minimal Jinja HTML template to which you can add whatever custom CSS styles (or even JavaScript) you desire.

@jbusecke
Copy link
Collaborator Author

Awesome, thanks for the detailed description! I will def try to use something like this for the promo of my latest paper (and probably come back and bug you about it haha).

But am I correct that this is not possible to achieve for the 'regular' widget-notebook hvplots? This might be overkill, but I was curious to whether I can change the appearance of hvplots (linewidth, ticksize, etc.) for my exploratory work aswell.

@cisaacstern
Copy link

I believe most hvplots are actually Bokeh plots under the hood. So you might have luck adapting some of the methods described here: https://docs.bokeh.org/en/latest/docs/user_guide/styling.html

Let me know if that looks promising! If not, we'll go back to the drawing board.

@jbusecke
Copy link
Collaborator Author

That is exactly what I was looking for. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants