Mkdocs Plotly Plugin
MkDocs plugin to create interactive charts from data using the declarative plotly's json syntax.
Includes supports for mkdocs-material theme features like instant loading and dark color themes.
Installation
Install the plugin using pip3:
pip install mkdocs-plotly-plugin
And then add the plugin into plugins and the custome fence
plugins:
- plotly
markdown_extensions:
- pymdownx.superfences:
custom_fences:
- name: plotly
class: mkdocs-plotly
format: !!python/name:mkdocs_plotly_plugin.fences.fence_plotly
Usage
You can insert any valid plotly JSON as a codeblock using:
``` plotly
{
"data": [
{
"x": ["giraffes", "orangutans", "monkeys"],
"y": [20, 14, 23],
"type": "bar"
}
]
}
```
This is compatiable with snipplets as well
```plotly
--8<-- "assets/data.json"
```
or you can insert any plotly JSON through URLs
```plotly
{"file_path": "./assets/data.json"}
```
Using snipplets will insert the json content into the output HTML file, which is more suitable for smaller datasets. Using file_path will fetch the json content once the page is loaded.
Plotly has its own eco-system for creating charts in most statistical languages. You can output the plot as a json file through fig.to_json().
Options
| Option | Default | Description |
|---|---|---|
| lib_path | |
Relative path to local plotly.js file, or leave it blank to use CDN. |
| template_default | plotly_min |
template for plotly charts in light mode |
| template_slate | plotly_dark_min |
template for plotly charts in dark mode |
| enable_template | True | use template to automatically change theme |
Available Plotly templates are ["plotly_min", "plotly_dark_min", "plotly", "plotly_white", "plotly_dark", "ggplot2", "seaborn", "simple_white", "none"]. If you want to customize your own template, you can export it as a JSON file and provide its relative path in options.
Metadata
Release files for mkdocs-plotly-plugin 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mkdocs-plotly-plugin-0.1.3.tar.gz | 10.7 kB | Without provenance | Details for mkdocs-plotly-plugin-0.1.3.tar.gz |
Release files / mkdocs-plotly-plugin-0.1.3.tar.gz
| Download URL | mkdocs-plotly-plugin-0.1.3.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86a133ecef92da2d41045cfa6f143fd77f7e064d7a1558d7fb764e1efb82dbca
|
|
BLAKE2b-256 checksum How to use checksums |
df2101431251720764246970a0bb9359fd8734007b518773a5102b089c46aec2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for mkdocs-plotly-plugin 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.