Software Architecture
The architecture of the Bokeh system — depicted in the figure below — involves the decoupling of an application programming interface (API), written using the Bokeh Python library, from the browser-side rendering of JavaScript objects, supported by the BokehJS backend. The Bokeh library enables programmers to construct figures and layouts, process data, and specify various forms of data interaction. From that Python code, JSON objects are generated and communicated to BokehJS for rendering in a browser backend, such as HTML Canvas, WebGL, or SVG. The default backend is HTML Canvas, but other backends can be specified for particular use cases.
This architecture provides several useful features:
- It allows developers to write their visualization code in Python, a higher-level language with a rich ecosystem of additional packages, rather than in JavaScript.
- It allows for some aspects of user interaction to take place directly in the browser, without requiring return communication to the Python frontend.
- It enables programmers to develop application frontends in other languages, such as R, Scala, and Julia, which only need to be able to generate BokehJS-compatible JSON objects in the same manner that the default Python library does.