MkDocs plugin to add charts from data
Project description
mkdocs-charts-plugin
MkDocs plugin to create plots from data using the declarative vegalite syntax. This makes it easier to build reproducible reports with MkDocs.
👉 See it in action on the demo page
Includes supports for mkdocs-material theme features like instant loading and dark color themes.
Installation
Install the plugin using pip3
:
pip3 install mkdocs-charts-plugin
Next, add the following lines to your mkdocs.yml
:
plugins:
- search
- charts
extra_javascript:
- https://cdn.jsdelivr.net/npm/vega@5
- https://cdn.jsdelivr.net/npm/vega-lite@5
- https://cdn.jsdelivr.net/npm/vega-embed@6
markdown_extensions:
- pymdownx.superfences:
custom_fences:
- name: vegalite
class: vegalite
format: !!python/name:mkdocs_charts_plugin.fences.fence_vegalite
If you have no
plugins
entry in your config file yet, you'll likely also want to add thesearch
plugin. MkDocs enables it by default if there is noplugins
entry set.
Usage
You can insert any valid vegalite JSON into a markdown file. But the real magic is that you can visualize .json
or .csv
files:
```vegalite
{
"description": "A simple bar chart with embedded data.",
"data": {"url" : "assets/charts/data/basic_bar_chart.json"},
"mark": {"type": "bar", "tooltip": true},
"encoding": {
"x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
"y": {"field": "b", "type": "quantitative"}
}
}
```
See the vegalite editor for a range of examples.
Documentation
See the documentation timvink.github.io/mkdocs-charts-plugin for examples, use cases and options.
Do checkout the other charting plugins for mkdocs that might suit your specific use-case better.
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
File details
Details for the file mkdocs_charts_plugin-0.0.12.tar.gz
.
File metadata
- Download URL: mkdocs_charts_plugin-0.0.12.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 095150824a966852a4556fe5f501d17c08346acccdd0d43c340e3adcea686314 |
|
MD5 | a02fdbb2b899139c1b429f45425bbb60 |
|
BLAKE2b-256 | 7043b00e9916d96fe62649809104ab49210addc7bcb66415773e3827fbe17dbd |
File details
Details for the file mkdocs_charts_plugin-0.0.12-py3-none-any.whl
.
File metadata
- Download URL: mkdocs_charts_plugin-0.0.12-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3b2c8b06d87903e7f50318dd8c908e44455ea83ffc99c49d518ab0cf93a2ec2 |
|
MD5 | a72b61643d7bc860ef1026fa4ac4e5b5 |
|
BLAKE2b-256 | 09076e960d3d6c19055ec30126eb7df04cd46cccefdca5a03cd1412797177ae0 |