Bokeh is a fiscally sponsored project of NumFOCUS, a nonprofit dedicated to supporting the open-source scientific computing community. Donations help pay for cloud hosting costs, travel, and other project needs. ©2021 Bokeh contributors. The website content uses the BSD License and is covered by the Bokeh Code of Conduct. Use Bokeh server and set up event handlers. In this section, we shall see how to add Bokeh widgets and assign JavaScript callbacks. This widget is a clickable button generally used to invoke a user defined call back handler. The constructor takes following parameters −. Download and use 4,000+ bokeh stock photos for free. Daily thousands of new images Completely Free to Use High-quality videos and images from Pexels. Discuss the development of Bokeh itself: Python library, Bokeh server, BokehJS, documentation, project infrastructure. For questions about using Bokeh, use the Community Support category.
- Bokeh Tutorial
- Bokeh Useful Resources
- Selected Reading
The bokeh.models.widgets module contains definitions of GUI objects similar to HTML form elements, such as button, slider, checkbox, radio button, etc. These controls provide interactive interface to a plot. Invoking processing such as modifying plot data, changing plot parameters, etc., can be performed by custom JavaScript functions executed on corresponding events.
Bokeh allows call back functionality to be defined with two methods −
Use the CustomJS callback so that the interactivity will work in standalone HTML documents.
Use Bokeh server and set up event handlers.
In this section, we shall see how to add Bokeh widgets and assign JavaScript callbacks.
Button
This widget is a clickable button generally used to invoke a user defined call back handler. The constructor takes following parameters −
![Bokeh Bokeh](https://4kwallpapers.com/images/wallpapers/sunflowers-flower-vase-wooden-background-teal-640x1136-921.jpg)
![Bokeh Bokeh](https://learn.zoner.com/wp-content/uploads/2019/12/01_umbrella.jpg?fidl=2019-06-mag-en)
The label parameter is a string used as button’s caption and callback is the custom JavaScript function to be called when clicked.
In the following example, a plot and Button widget are displayed in Column layout. The plot itself renders a line glyph between x and y data series.
A custom JavaScript function named ‘callback’ has been defined using CutomJS() function. It receives reference to the object that triggered callback (in this case the button) in the form variable cb_obj.
This function alters the source ColumnDataSource data and finally emits this update in source data.
Output (initial)
Click on the button on top of the plot and see the updated plot figure which looks as follows −
Output (after click)
Slider
With the help of a slider control it is possible to select a number between start and end properties assigned to it.
In the following example, we register a callback function on slider’s on_change event. Slider’s instantaneous numeric value is available to the handler in the form of cb_obj.value which is used to modify the ColumnDatasource data. The plot figure continuously updates as you slide the position.
Output
![Bokeh Bokeh](https://cdn.filtergrade.com/wp-content/uploads/2019/07/22151438/9-Incredible-Bokeh-Overlays-FilterGrade-1024x678.jpg)
RadioGroup
This widget presents a collection of mutually exclusive toggle buttons showing circular buttons to the left of caption.
Where, labels is a list of captions and active is the index of selected option.
Select
This widget is a simple dropdown list of string items, one of which can be selected. Selected string appears at the top window and it is the value parameter.
The list of string elements in the dropdown is given in the form of options list object.
Following is a combined example of radio button and select widgets, both providing three different relationships between x and y data series. The RadioGroup and Select widgets are registered with respective handlers through on_change() method.
Output
Tab widget
Just as in a browser, each tab can show different web page, the Tab widget is Bokeh model providing different view to each figure. In the following example, two plot figures of sine and cosine curves are rendered in two different tabs −
Output
Bokeh comes from the Japanese word ‘boke’, which means fuzzy. In photography, bokeh defines the quality of the blurred lights presented in a photo. We’re not referring to a badly taken photo that’s all out of focus, but rather the aesthetically pleasing background blur. Usually, this type of blur highlights the focused subject even more.
Producing nice bokeh involves creating a shallow depth of field.
Here are some tips to get you started with bokeh photography:
1.) Larger aperture works best, so use a low f-stop number like f1.4, f1.8 or f2.8. I like using the Canon EF 50mm f/1.835mm f1.4 for this project.
2.) Set your camera to aperture priority.
3.) You would need to set the shutter speed faster than 1/50 second. Any slower and I find the background lights getting blurred together, instead of rendering small circles. If it’s too dark, increase the ISO level rather than the f-stop number.
4.) The closer you get to subject, the better. If you’re using a zoom lens, extend it to the longest focal length.
5.) The further away the background, the better.
6.) Ensure that the background is lit. Glowing lights like street lamps and traffic lights work best. While a consistently lit background would just create a regular blur.
7.) If you don’t have a subject and want to create the bokeh effect with the night lights, manually focus your camera.
Get inspired by the photos below and show us your best bokeh shots!
Yuki-chan and the Bokeh by josh.liba
TTL by E-Rocks
The one with the red thread by dsevilla
Taxi by Al Fed
Sheep meadow by orangachang
Kulio’ou’ou by da_godfaddah
I wish I was special by irene gr
Heart by seyed mostafa zamani
Bokeh Lounge
Have a Very Bokeh Christmas by Brandon Christopher Warren
Burst of Life by matthileo
Blur of city lights by Yiie
Ashlin by matt caplin
Aeia Loop by da_godfaddah
Another Journey By Train by Steve Leggat
Bokeh Lights
Bokeh Star by Maschinenraum
:::::::::::::::::::::::::
Bokeh Charting
![Video Video](https://cdn.pixabay.com/photo/2020/05/23/10/28/bokeh-5209009_960_720.jpg)
Bokeh Effect
![Bokeh Bokeh](https://weandthecolor.com/wp-content/uploads/2021/03/Focus-12-experimental-bokeh-effects-as-high-resolution-PNG-files.jpg)
Bokeh Background
Related Posts:
![](https://cdn-ak.f.st-hatena.com/images/fotolife/r/ruriatunifoefec/20200910/20200910011354.png)