-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fast example #5
Merged
Merged
Fast example #5
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Sep 30, 2020
Your questions:
1. How do I add raw_css? I would like to set the body margin to 0px.
Use the `.prepend_body_style()` method instead of the `.prepend_body_css()` or the `.append_head_no_nb_css()` methods.
2. How do I solve the "Bokeh is not defined" problem and get the bar chart shown?
I think that you’ve found the solution to this issue afterwards.
3. How do integrate the Button with the Panel backend such that when I click it I can update the bar chart?
I am not familiar with Fast but I think that it may be possible to jslink a button (any plain HTML button) to a panel component, which would then be watched from python. I haven’t tried it but I think that the reference information to help with that is here: https://panel.holoviz.org/user_guide/Links.html
|
I realize that these questions are all due to almost inexistent documentation on my part.
Let me explain what the `main` parameter does:
When you use the `panel` CLI command you can do two things:
1. serve one, two, a list of notebooks, specified by name or you can even use a wildcard
2. serve a directory, specifying a directory name such as `.` and if you do then the `panel` CLI command looks for a notebook named `main.ipynb` and it also serves all of the resource files that happen to have been placed inside of the `static` folder.
By default `panel-component` embeds all resources using base64 encoding in the template itself, all .js .css .png etc resources are embedded. This makes each served notebook really large, and it is wasteful when you are serving multiple notebooks simultaneously.
In order to avoid that waste and embedding of all the resources, you can use the second option. That is: You rename at least one of your notebooks to `main.ipynb` and set the `main` parameter to `True`, which will then result in all the resources being copied by `panel-component` over to the `static` folder instead of embedding them in the html, making each served notebook a lot smaller and allowing the browser to cache the resources.
The `panel-component` expects the original actual resources to exist in a `www` folder which can be inside the folder where the notebooks are, or inside the python module where you may be sub-classing the component to create a special purpose one, like the `page` component of the `panel-bootstrap-vue` package.
|
I’ll have to find some time to play with Fast.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Example showcasing how to use the fast.design components with the panel-components package.
WORK IN PROGRESS.
Builds on #3.
The only new contribution is the file
fast_hello_world.py
. Can be run viapython -m panel serve 'examples\fast_hello_world.py' --dev
.I have the following questions for @paulopes