Skip to main content

MkDocs plugin to add charts from data

Project description

Actions Status PyPI - Python Version PyPI PyPI - Downloads GitHub contributors PyPI - License

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 the search plugin. MkDocs enables it by default if there is no plugins 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_charts_plugin-0.0.13.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_charts_plugin-0.0.13-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_charts_plugin-0.0.13.tar.gz.

File metadata

  • Download URL: mkdocs_charts_plugin-0.0.13.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mkdocs_charts_plugin-0.0.13.tar.gz
Algorithm Hash digest
SHA256 7de0a74a2ecc8a5a17ce49ebf84c3175ec03a17725e85b970c0b2c3d59faa311
MD5 b670e5fff7f177112ad9eeccfb02db96
BLAKE2b-256 1584d3c731390478a6f9dea0a4517e24287a317a015d85bde7342ba60ddac3e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_charts_plugin-0.0.13.tar.gz:

Publisher: pythonpublish.yml on timvink/mkdocs-charts-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkdocs_charts_plugin-0.0.13-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_charts_plugin-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 cef515bb3b4acb3dfea45787d7db3a6f39bf649dbb369a73416c6a1386cac258
MD5 80c327cc5938e3066336f4e3cf71db28
BLAKE2b-256 316f4015dbb4c26bf1fc4b5b637188fc47ec2f1781baccc2e13b0c48887ae9b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_charts_plugin-0.0.13-py3-none-any.whl:

Publisher: pythonpublish.yml on timvink/mkdocs-charts-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page