Skip to main content

MkDocs plugin to add charts from data

Project description

Actions Status PyPI - Python Version PyPI 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.

👉 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 using:

```vegalite
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "A simple bar chart with embedded data.",
  "data": {
    "values": [
      {"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
      {"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
      {"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
    ]
  },
  "mark": "bar",
  "encoding": {
    "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
    "y": {"field": "b", "type": "quantitative"}
  }
}
```

See the vegalite editor for a range of examples you could copy-paste into your mkdocs site

Documentation

See the documentation timvink.github.io/mkdocs-charts-plugin for examples, use cases and options.

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.5.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

mkdocs_charts_plugin-0.0.5-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs-charts-plugin-0.0.5.tar.gz.

File metadata

  • Download URL: mkdocs-charts-plugin-0.0.5.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for mkdocs-charts-plugin-0.0.5.tar.gz
Algorithm Hash digest
SHA256 098e50bec14830d7bd9dc6e97aae44cfd337d7546a8939ee4fc97b7dbafb5f41
MD5 dee7ff79b7ac6088a54c97fca76e5293
BLAKE2b-256 f3b605182d0a50727e9a5c1954620b58c581b1863db2f9ec2c19dc65c0d2af57

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mkdocs_charts_plugin-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for mkdocs_charts_plugin-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 66ebf2f6ba4fff5aa25257b0f59f7f5b8e8d7063eaa707a936b5ece798535461
MD5 32bb4341a0268bacb8fb0da6de20ee9d
BLAKE2b-256 c5f1958ca7916eb435757b44a8e3ad788bb033f0802bf9c5e798f8b673e7eba5

See more details on using hashes here.

Supported by

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