A collection of Plotly figure templates with a Bootstrap theme
Project description
Plotly Bootstrap Templates
[!NOTE] has been forked from https://github.com/AnnMarieW/dash-bootstrap-templates. All dependencies on
dashanddash-bootstrap-componentshave been removed from the installable package to allow usage with plain plotly graphing library without the need to install dash. Package management has been modernized touvand the package code has been cleaned up for the targeted purpose.
Figure Template Quickstart
[!TIP] Learn more about Plotly figure templates and themes at: https://plotly.com/python/templates/
Install the package as usual with your favorite Python package manager, the package name is plotly-bootstrap-templates.
Then, use the main package function load_figure_template to load the template.
It is automatically stored in the plotly.io.templates dictionary.
plotly.io.templates.default will be automatically set to the requested template afterwards.
from plotly_bootstrap_templates import load_figure_template
load_figure_template("flatly")
You may load several theme at once by giving a list, the default template will then be the first in this list.
load_figure_template(["flatly", "solar"])
To get a full list of the available templates, print the TEMPLATES constant.
For each of them, also a *_dark variant exists, which are listed in the TEMPLATES_DARK constant.
from plotly_bootstrap_templates import TEMPLATES, TEMPLATES_DARK
print("templates:\n", TEMPLATES)
print("dark templates:\n", TEMPLATES_DARK)
Development
To create the project virtual environment using uv run:
uv sync
To regenerate the template data files, run:
./_create_templates.py
The script is equipped with a respective shebang to tell uv which dependencies to use for that (which are not necessary at runtime of the package).
To run the test suite, use:
uv run pytest
This will generate an example plot of the gapminder test data set for every available theme and open the result in your default browser using the webbrowser package.
Further Information
For further reading visit the original repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plotly_bootstrap_templates-2.1.0.post1.tar.gz.
File metadata
- Download URL: plotly_bootstrap_templates-2.1.0.post1.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad987e5fe2c6ce55f96563b0ae976947b307b01cc9f324d64edaabb5cfc85074
|
|
| MD5 |
823853669faa97799f2722010d935ecf
|
|
| BLAKE2b-256 |
e74820c7ac700cce4e965b9d69351df1f86350021044f36d8a7b9482bff5e06b
|
File details
Details for the file plotly_bootstrap_templates-2.1.0.post1-py3-none-any.whl.
File metadata
- Download URL: plotly_bootstrap_templates-2.1.0.post1-py3-none-any.whl
- Upload date:
- Size: 90.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
babfa4042e14d23b3797f6446d6b5eb25e55d5e2ca08b7dcabac6b6cef67d97a
|
|
| MD5 |
3ac8fdbfee871b7d8c7ae88095ae998c
|
|
| BLAKE2b-256 |
56e6cd12ea023498dc08b5ad79438c864e18f33b503dc8cfb895b0d453a21c58
|