Hi,
I have made a panel which uses the datepicker widget as input for a histogram.
By selecting a date, you can get the respective histogram for that specific day.
panel.servable()
I have tried embeddig the widget like so:
panel.embed()
or
panel.save(‘test.html’, embed = True)
unfortunately to no avail. I read in another thread that daterange doesn’t work as it you can’t embed the range options with panel as the input needs to be discreet. Does the same limitation also apply here? I had hoped a single date input would qualifies.
@guido, welcome to the discourse! I’ve gotten a lot of great tips and support here, and I’m sure you’ll find the same.
It would help tremendously if you could provide a minimal example of your current code and describe specifically what is not working.
I’ve had success using a DiscreteSlider widget to select dates which dynamically update plots. With a bit more clarity on your current code and desired outcome, I could see if my solution would work for you.
In the next cell I use either hourly.embed() or hourly.save('hourly.html', embed = True) but the command doesn’t run through all the different states. Doing a similar routine but with the ‘Select’ widget, it does save the different states to the output which i can share easily in a HTML.
Hope you or anyone else can make a bit a sense of the situation!
@cisaacstern Thanks for providing the detailed answer, it’s the only thing that will work currently! The problem is that @guido is asking about a feature called embedding in Panel, which allows Panel to embed the entire state space of an application into an HTML file or a set of JSON files shipped alongside the exported HTML. That said in this case this is problematic because embedding only works for certain widgets where the state space is relatively small. Currently this is not implemented for DatePicker because the state space is potentially huge, but in certain cases I imagine the state space could be small enough to be tractable. So @guido, I’d encourage you to file an issue requesting that we enable embedding support for the DatePicker widget.
Hi @cisaacstern, thank you so much for taking the time to generate an example. I did take away some new insights in making a cleaner code using pn.depends.
Using the .app() function is a little addition so I can have the callback functional in the jupyter notebook. Though my ultimate wish is to have it be captured in the HTML, so that I can share it with others. @philippjfr thanks for the explanation as well. I guess I am at a dead end for now.This text will be hidden