Metadata-Version: 2.1
Name: whitecanvas
Version: 0.1.0
Summary: A type safe and backend independent plotting library for Python.
Project-URL: Documentation, https://github.com/unknown/whitecanvas#readme
Project-URL: Issues, https://github.com/unknown/whitecanvas/issues
Project-URL: Source, https://github.com/unknown/whitecanvas
Author-email: Hanjin Liu <liuhanjin-sc@g.ecc.u-tokyo.ac.jp>
License: BSD 3-Clause License
        
        Copyright (c) 2021, hanjinliu
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.9
Requires-Dist: cmap>=0.1.2
Requires-Dist: numpy>=1.23.2
Requires-Dist: psygnal>=0.9.4
Requires-Dist: typing-extensions>=4.5.0
Provides-Extra: bokeh
Requires-Dist: bokeh>=3.3.1; extra == 'bokeh'
Provides-Extra: matplotlib
Requires-Dist: matplotlib!=3.8.0,>=3.4.3; extra == 'matplotlib'
Provides-Extra: plotly
Requires-Dist: kaleido>=0.2.1; extra == 'plotly'
Requires-Dist: plotly>=5.3.1; extra == 'plotly'
Provides-Extra: pyqtgraph
Requires-Dist: pyqtgraph>=0.13.3; extra == 'pyqtgraph'
Requires-Dist: qtpy>=2.4.1; extra == 'pyqtgraph'
Provides-Extra: testing
Requires-Dist: matplotlib>=3.8.2; extra == 'testing'
Requires-Dist: pyqtgraph>=0.13.3; extra == 'testing'
Requires-Dist: pytest; extra == 'testing'
Requires-Dist: pytest-qt; extra == 'testing'
Provides-Extra: vispy
Requires-Dist: vispy>=0.14.1; extra == 'vispy'
Description-Content-Type: text/markdown

# whitecanvas

[![PyPI - Version](https://img.shields.io/pypi/v/whitecanvas.svg)](https://pypi.org/project/whitecanvas)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/whitecanvas.svg)](https://pypi.org/project/whitecanvas)

A type safe and backend independent plotting library for Python.

&rarr; [Documentation](https://hanjinliu.github.io/whitecanvas/)

|**matplotlib**||**pyqtgraph**|
|:--------:|:-:|:-------:|
|![](https://github.com/hanjinliu/whitecanvas/blob/main/images/raincloud_matplotlib.png)|**Rain-cloud plot** in different backends ([Source code](https://github.com/hanjinliu/whitecanvas/blob/main/examples/raincloud_plot.py))|![](https://github.com/hanjinliu/whitecanvas/blob/main/images/raincloud_pyqtgraph.png)|
|**vispy**|**plotly**|**bokeh**|
![](https://github.com/hanjinliu/whitecanvas/blob/main/images/raincloud_vispy.png)|![](https://github.com/hanjinliu/whitecanvas/blob/main/images/raincloud_plotly.png)|![](https://github.com/hanjinliu/whitecanvas/blob/main/images/raincloud_bokeh.png)|

-----

## Installation

```console
pip install whitecanvas -U
```

## Type safety

In `whitecanvas`, each component is configured separately by `with_*` methods.
This architecture makes function arguments highly consistent and allows you to
write type-safe codes.

```python
import numpy as np
from whitecanvas import new_canvas

canvas = new_canvas()  # make a new canvas

# sample data
N = 10
xdata = np.linspace(0, np.pi * 2, N)
ydata = np.sin(xdata)

# add layer
layer = (
    canvas
    .add_line(xdata, ydata, color="blue")
    .with_markers(color="violet", symbol="s")
    .with_edge(color="blue")
    .with_yerr(np.ones(N) / 3, capsize=0.2, color="black")
)

canvas.show()  # show canvas
```

![](https://github.com/hanjinliu/whitecanvas/blob/main/images/sin_with_err_matplotlib.png)

## Backend independency

One of the ultimate goal of `whitecanvas` is "visualize data everywhere".
Currently supported backends are:

- `matplotlib`
- `pyqtgraph`
- `vispy`
- `plotly`
- `bokeh`

If you want other backends, please feel free to [open an issue](https://github.com/hanjinliu/whitecanvas/issues).
