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.

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"}
  }
}
```

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.3.tar.gz (7.6 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.3-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs-charts-plugin-0.0.3.tar.gz
  • Upload date:
  • Size: 7.6 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.3.tar.gz
Algorithm Hash digest
SHA256 8b44eafc895d3c6cbe28e7d6d768b5e359b52d2d61fda32505c9e8a5fde1358f
MD5 f3d24d53d8a04d411b344429d1f72995
BLAKE2b-256 d08606c4d2321776982dc64602dfe6ea5474df22356e4af8ba435ce971e277a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mkdocs_charts_plugin-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 04450cafc56da1d23f8b99c4d68578f87cc86fe41461b3e0bd73bed1277789c7
MD5 e8d1e58338854e8cb9f2fa52b1f82ca4
BLAKE2b-256 239fdc08f352bb1d16e3c86f1181037ad25c5eebc4a2e9b8f6c0c7930aa2e17a

See more details on using hashes here.

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