Bokeh Tutorial
Selected Reading
- Bokeh - Discussion
- Bokeh - Useful Resources
- Bokeh - Quick Guide
- Bokeh - Developing with JavaScript
- Bokeh - WebGL
- Bokeh - Extending Bokeh
- Bokeh - Embedding Plots and Apps
- Bokeh - Exporting Plots
- Bokeh - Using Bokeh Subcommands
- Bokeh - Server
- Bokeh - Adding Widgets
- Bokeh - Customising legends
- Bokeh - Styling Visual Attributes
- Bokeh - Plot Tools
- Bokeh - Layouts
- Bokeh - Filtering Data
- Bokeh - ColumnDataSource
- Bokeh - Pandas
- Bokeh - Annotations and Legends
- Bokeh - Axes
- Bokeh - Setting Ranges
- Bokeh - Specialized Curves
- Bokeh - Wedges and Arcs
- Bokeh - Rectangle, Oval and Polygon
- Bokeh - Circle Glyphs
- Bokeh - Area Plots
- Bokeh - Plots with Glyphs
- Bokeh - Basic Concepts
- Bokeh - Jupyter Notebook
- Bokeh - Getting Started
- Bokeh - Environment Setup
- Bokeh - Introduction
- Bokeh - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Bokeh - Using Bokeh Subcommands
Bokeh - Using Bokeh Subcommands
The Bokeh apppcation provides a number of subcommands to be executed from command pne. Following table shows the subcommands −
1 | Html | Create HTML files for one or more apppcations |
2 | info | print information of Bokeh server configuration |
3 | json | Create JSON files for one or more apppcations |
4 | png | Create PNG files for one or more apppcations |
5 | sampledata | Download the bokeh sample data sets |
6 | secret | Create a Bokeh secret key for use with Bokeh server |
7 | serve | Run a Bokeh server hosting one or more apppcations |
8 | static | Serve static assets (JavaScript, CSS, images, fonts, etc.) used by BokeJS pbrary |
9 | svg | Create SVG files for one or more apppcations |
Following command generates a HTML file for Python script having a Bokeh figure.
C:python37>bokeh html -o app.html app.py
Adding show option automatically opens the HTML file in browser. Likewise, Python script is converted to PNG, SVG, JSON files with corresponding subcommand.
To display information of Bokeh server, use info subcommand as follows −
C:python37>bokeh info Python version : 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] IPython version : (not installed) Tornado version : 6.0.3 Bokeh version : 1.3.4 BokehJS static path : c:python37pbsite-packagesokehserverstatic node.js version : (not installed) npm version : (not installed)
In order to experiment with various types of plots, Bokeh website
makes available sample datasets. They can be downloaded to local machine by sampledata subcommand.C:python37>bokeh info
Following datasets are downloaded in C:UsersUser.bokehdata folder −
AAPL.csv airports.csv airports.json CGM.csv FB.csv gapminder_fertipty.csv gapminder_pfe_expectancy.csv gapminder_population.csv gapminder_regions.csv GOOG.csv haarcascade_frontalface_default.xml IBM.csv movies.db MSFT.csv routes.csv unemployment09.csv us_cities.json US_Counties.csv world_cities.csv WPP2012_SA_DB03_POPULATION_QUINQUENNIAL.csv
The secret subcommand generates a secret key to be used along with serve subcommand with SECRET_KEY environment variable.
Advertisements