Skip to main content

A directive for including a plotly figure in a Sphinx document

Project description

sphinx-plotly-directive

pypi badge CI Documentation Status Imports: isort Code style: black

A directive for including a Plotly figure in a Sphinx document.

Based on matplotlib's plot directive.

Install

# pypi
pip install sphinx-plotly-directive

# dev version
pip install git+https://github.com/harupy/sphinx-plotly-directive.git

Usage

Source:

.. plotly::

   import plotly.express as px
   px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])

The last line of a code block must end with an expression that evaluates to a plotly figure.

Output:

See documentation for details.

Development

Install dependencies

pip install -e ".[dev]"

Format code

flake8 .
isort .
black .

Run tests

pytest tests

Build document

cd docs
make html

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

sphinx-plotly-directive-0.1.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

sphinx_plotly_directive-0.1.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file sphinx-plotly-directive-0.1.1.tar.gz.

File metadata

  • Download URL: sphinx-plotly-directive-0.1.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for sphinx-plotly-directive-0.1.1.tar.gz
Algorithm Hash digest
SHA256 91989a5240aa2811ac9c82c617cbf64cb93d8cc7c0aca178dd4388e9d81fa0d1
MD5 328a48df5aa32f7986a85393b43f795c
BLAKE2b-256 082f194534c31db9a5a6eb82e54fdcfa3a2b4b5a4cdb223c9916a065b54445a5

See more details on using hashes here.

File details

Details for the file sphinx_plotly_directive-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sphinx_plotly_directive-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for sphinx_plotly_directive-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dbc39b602557c53ab0d247934db09bc8494a441f3750e68cf7531e679934c3ca
MD5 e70d4164e14ed3fbc41344b67c1c82f6
BLAKE2b-256 1ec2f60ae0ae9e072f8d19e172e08ec2a875b30e4bc7c0a0cf9bb19ea2e41ee2

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