Bokeh
Finding the right documentation resources
Bokeh is a Python library for creating interactive visualizations for modern web browsers. It helps you build beautiful graphics, ranging from simple plots to complex dashboards with streaming datasets. With Bokeh, you can create JavaScript-powered visualizations without writing any JavaScript yourself.
In photography, bokeh (/ˈboʊkə/ BOH-kə or /ˈboʊkeɪ/ BOH-kay; Japanese: [boke]) is the aesthetic quality of the blur produced in out-of-focus parts of an image. Bokeh has also been defined as “the way the lens renders out-of-focus points of light”. Differences in lens aberrations and aperture shape cause very different bokeh effects. Some lens designs blur the image in a way that is pleasing to the eye, while others produce distracting or unpleasant blurring (“good” and “bad” bokeh, respectively). Photographers may deliberately use a shallow focus technique to create images with prominent out-of-focus regions, accentuating their lens’s bokeh.
Bokeh is often most visible around small background highlights, such as specular reflections and light sources, which is why it is often associated with such areas. However, bokeh is not limited to highlights; blur occurs in all regions of an image which are outside the depth of field.
The opposite of bokeh—an image in which multiple distances are visible and all are in focus—is deep focus.
Connecting with the Bokeh community
There are various ways to get in touch with the Bokeh community:
- The Bokeh Discourse is the best place to ask usage questions and is a great way to get feedback from other users on how to approach a problem.
- Questions involving pandas or other libraries may find a wider audience by posting with the “bokeh” tag on Stack Overflow.
- If you think you’ve found a bug, or would like to request a feature, please report an issue at Bokeh’s GitHub repository.
Bokeh Features:
Some fabulous features that make a difference in visualization:
- Simple commands for statistical plots
-
- You need simple commands to generate statistical plots.
- Data visualization becomes well-organized and creative.
- Easy to create prototypes
-
- The beginner data scientists with the least experience in JavaScript can use it effectively.
- You can create prototypes quickly without using tools like wireframes.
- Get outputs in a variety of medium:
-
- Bokeh pricing is minimal compared to the technical capabilities it offers.
- You can get the outputs in various mediums such as HTML, notebook, and server.
- Convenient embedding with other applications:
-
- You can embed Bokeh visualization to other apps such as Flask and Django.
- This feature makes this tool versatile and user-friendly as well.
Vision
Bokeh is an interactive visualization library for modern web browsers. It provides elegant, concise construction of versatile graphics and affords high-performance interactivity across large or streaming datasets. Bokeh can help anyone who wants to create interactive plots, dashboards, and data applications quickly and easily.
Roadmap
The development pace of Bokeh is contingent on external funding opportunities, so this roadmap does not mean to imply any specific dates or deadlines. Listed below are the major areas of work the Core Team considers important. These are tasks and projects that we would like to do ourselves, when time and resources permit, or that we would be happy to have done by new contributors.
Use WebGL Consistently
Bokeh currently can use WebGL to accelerate plotting for larger datasets in some limited situations. In addition to not fully supporting some use-cases, the internal cost is having to maintain two separate code paths. It would be desirable to convert Bokeh’s rendering to always use WebGL whenever possible, so that better performance for larger data sets is always available, and to streamline maintenance for the future.
Develop BokehJS as a First-class JavaScript Library
By and large none of the core contributors have been JS or front-end experts, and for some time the client side BokehJS library was an implementation detail. There is more interest to use BokehJS directly, and with attention from experienced front-end JS developers, BokehJS could integrate better with existing common web frameworks and tools than it currently does. This includes making much more accessible documentation for BokehJS itself. These improvements would also help increase the potential pool of core developers interested in maintaining BokehJS over the long run.
Improve Accessibility
We need to better serve users and contributors with cognitive, developmental, intellectual, mental, physical, and/or sensory disabilities and better accommodate assistive technologies. Working towards this goal includes updates to Bokeh’s codebase as well as to Bokeh’s documentation and other web assets.
Better Theming Support
Bokeh currently has some minimal theming ability, that can specify properties for types. It would be useful to have more targets and sophisticated ways to theme individual objects, or collections of objects. Additionally some work is needed to improve or create visual assets that work with different themes, and to make DOM elements easily themeable as well.
Visual Design Improvements
Bokeh has never had the benefit of any dedicated web or visual designers, and this is one area where it suffers compared to some other projects. Visually, it looks much less “designed by engineers” than it used to, there is still much room for improvement. Another idea, if Better Theming Support is accomplished is to have visual designers help create a set of attractive themes that can be immediately available to users.
Improve Support of Open Geospatial Data Formats
Open Geospatial Consortium (OGC) standards, such as GeoJSON and TopoJSON, play an important role in sharing and exchanging geo data. Improving Bokeh’s support for those open standards would significantly increase the usability and usefulness of Bokeh’s geo-related features.
Improve Handling of Gridded Data
Bokeh has good basic support for any type of data, but does not include any special optimizations for the common case of scalar, linear, or image data sampled on a regular timebase. Gridded 0D/1D/2D timeseries data of this type arises often in scientific or engineering data-acquisition and analysis contexts involving point, line, or image sensors, such as microphones or temperature probes, electrode arrays, camera or microscope images, and so on. Bokeh’s performance, ease of use, and ease of application can be greatly improved to cover these cases well, building on the existing efficient binary transport mechanisms while improving performance, adding user interface elements to work with streaming data, and showing examples for researchers to follow.
Smooth Animations and Transitions
Some users have expressed interest in the ability to make different views of a plot transform smoothly from one state to another. (Compare to “tween” animations in GGplot). This would afford the ability to create visually attractive “data stories” by scripting smooth transitions that connect one view of data to another.
Simple RPC Mechanism
Bokeh currently allows for users to execute JavaScript code or Python code in response to data changes or various UI events. Some users have requests a more direct “simple remote procedure” capability that would enable them to e.g. execute a JavaScript function directly from Python in a Bokeh server application or vice versa.
Technical Writing Assistance
The Bokeh documentation has grown quite large and has much information, but it seems to be the case that many users still have difficulty finding the appropriate documentation or examples, even when they exist. The project would benefit greatly from experienced help to organize the information architecture of the docs, point out missing areas, etc.
Built-in LaTeX / MathText Support
Bokeh can display mathematical symbols and formulas by creating and using custom extensions. Users have expressed a desire for this capability to be more directly integrated, e.g to draw math text for axis or tick labels, without needing to resort to a custom extension.
Selection and Hover
Bokeh supports various sorts of hit testing for selection and hover on a per-glyph basis. It would be good to make support more uniform by adding the requisite hit testing wherever it is currently missing. Additionally Bokeh needs a policy-based mechanism for dealing with “multiple hits” i.e. if the mouse hovers over 50 points, a way to show just one, or just the top N, or even some aggregation or summary as the hover.
Improve Diversity, Equity, and Inclusion among Contributors and Users
We have repeatedly experienced that diversity, resulting from an inclusive culture, is intrinsically good for the project and a crucial factor in making Bokeh a better tool. We are determined to make Bokeh welcoming and supportive to users and contributors, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. We are aware that working towards this goal is a continual process of learning and improvement.
Best Lens for Bokeh
Although bokeh is actually a characteristic of a photograph, the lens used determines the shape and size of the visible bokeh. Usually seen more in highlights, bokeh is affected by the shape of the diaphragm blades (the aperture) of the lens. A lens with more circular shaped blades will have rounder, softer orbs of out-of-focus highlights, whereas a lens with an aperture that is more hexagonal in shape will reflect that shape in the highlights.
Don’t worry if you don’t own a very fast lens. By increasing the distance between the background and your subject, you can see bokeh in images that are shot at smaller apertures like f/8.
How to Achieve Bokeh
To increase the likelihood of creating visible bokeh in your photographs, increase the distance between your subject and the background. You can do this by decreasing the distance between the camera and subject. The more shallow the depth-of-field, or further the background is, the more out-of-focus it will be. Highlights hitting the background will show more visible bokeh too, so if you’re using a backlight, side light or a hair light, the bokeh may be more pleasing to the eye.
Bokeh Camera Settings
You’ll want to shoot with the lens wide open, so you’ll want to use a shooting mode of Aperture Priority or Manual. Manual gives you the ability to choose both your aperture and shutter speed, whereas Aperture Priority allows you to choose the f/stop while the camera chooses the appropriate shutter speed for the exposure. You could also use the Flexible Program mode, choosing the widest possible aperture/shutter speed combination.
Bokeh in Portraits
The most photographed subjects showing nice examples of bokeh are portraits. Close-up portraits show bokeh very well. Close-up and macro images of flowers and other objects in nature are also popular subjects to photograph that shows off bokeh in the image. An often-photographed subject that is an extreme example of bokeh is photographing a grouping of holiday lights or other highly reflective objects. When purposely photographed out-of-focus, these normally harsh or bright objects become soft, pastel, diffused orbs of glowing light.
Bokeh can add softness to an otherwise brightly lit photograph. Using this technique to separate your subject from the background can also allow you to utilize a not-so-photogenic background in your image—but because of its diffused blur, it helps to “highlight” the subject, not detract from it.