Metadata-Version: 2.4
Name: ninejs
Version: 0.0.2
Summary: Bringing interactivity to plotnine
Author-email: Joseph Barbier <joseph@ysunflower.com>
License-Expression: MIT
Project-URL: Documentation, https://y-sunflower.github.io/ninejs/
Project-URL: Homepage, https://y-sunflower.github.io/ninejs/
Project-URL: Issues, https://github.com/y-sunflower/ninejs/issues
Project-URL: Repository, https://github.com/y-sunflower/ninejs
Keywords: D3,browser,interactivity,plotnine,visualization,web
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jinja2>=3.0.0
Requires-Dist: narwhals>=2.0.0
Requires-Dist: plotnine>=0.13.0
Dynamic: license-file

# ninejs

Bring interactivity to [plotnine](https://plotnine.org/) charts.

`ninejs` lets you add tooltips and hover grouping to plotnine plots directly from `aes(...)`, then export the result as standalone HTML.

<br>

## Quick start

```python
from plotnine import aes, geom_point, ggplot, theme_minimal
from plotnine.data import anscombe_quartet

from ninejs import css, interactive, save

gg = (
  ggplot(
      anscombe_quartet,
      aes(x="x", y="y", color="dataset", tooltip="dataset", data_id="dataset")
  )
  + geom_point(size=7, alpha=0.5)
  + theme_minimal()
)

(
  interactive(gg)
  + css(from_dict={".tooltip": {"font-size": "2em"}})
  + save("plot.html")
)
```

![](./quick-start.png)

<br>

## Installation

```bash
pip install ninejs
```

<br>

## Documentation

See the full documentation and examples [here](https://y-sunflower.github.io/ninejs/).
