-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Adding a DatetimePicker widget #2107
Conversation
This is awesome, thank you! Is there an easy way to refactor this in such a way that we can add a DatetimeRange widget without duplicating too much code? |
Right; very often what I need to do is to choose a datetime range for which data to plot, so in practice I'm more often in need of a range than of a single datetime. |
This is definitely possible. I have a small example with it. Although it is not finished yet as I have not implemented it on the python/panel side, but it works in the browser/bokeh model. It should be pretty straight forward to implement it on the panel side, but this will be another day. I have attached a video showcasing it, where the console logs a change in the widget. datetimepicker_range.mp4 |
This looks great, can't wait to see it in Lumen. |
Codecov Report
@@ Coverage Diff @@
## master #2107 +/- ##
==========================================
+ Coverage 84.42% 84.50% +0.07%
==========================================
Files 179 182 +3
Lines 20776 21272 +496
==========================================
+ Hits 17541 17975 +434
- Misses 3235 3297 +62
Continue to review full report at Codecov.
|
This is great, thank you @hoxbro. Will merge and do any cleanup tasks in another PR if I find anything. |
As mentioned in #1975 I have been working on a
DatetimePicker
. This is based on the existingDatePicker
already in Panel and Bokeh, so a lot of the code is reused from it.I could not get the value to be datetime in the Bokeh model, so I went with a simple string to communicate with the model. I also tried to inherit a lot of the code from the existing
DatePicker
but in the end it was easier to not do it.The following code can be used to start the widget.
Example of the widget in action:
https://user-images.githubusercontent.com/19758978/111658738-e8b39380-880c-11eb-801c-fe24b14dab00.mp4
TODO