/sphinx-plotly-directive

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

Primary LanguagePythonMIT LicenseMIT

sphinx-plotly-directive

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

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

This package is 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])

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