Metadata-Version: 2.4
Name: e360_charting
Version: 2.0.0
Summary: Create charts for E360 Plotly Visualisations.
Author-email: IQVIA <e360pypi@iqvia.com>
License: Copyright 2023 IQVIA Ltd
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
             http://www.apache.org/licenses/LICENSE-2.0
        
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
License-File: LICENSE.txt
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.12
Requires-Dist: marshmallow-dataclass
Requires-Dist: marshmallow-enum
Requires-Dist: marshmallow<4,>=3.21
Requires-Dist: typeguard<5,>=4
Requires-Dist: ujson<6,>=5
Provides-Extra: full
Requires-Dist: pandas<3,>=2.1; extra == 'full'
Requires-Dist: plotly<6,>=5; extra == 'full'
Description-Content-Type: text/markdown

E360 Charting (VRS)
===

_Create charts for E360 Plotly Visualisations._

## Introduction

- Creates payloads for E360 Visualisation Resource Service (VRS).
- VRS payloads have a Plotly-like structure, but are significantly different.
- Merge multiple charts into a single report.
- Convert visualisation instances to pure Plotly payloads.

## Requirements

- **Python 3.12+**
- Runtime dependencies are declared in `pyproject.toml`. Optional Plotly/pandas integration: `pip install e360_charting[full]` (or `uv sync` with the `full` extra when using uv).

This package does **not** depend on `clients_core`; no sibling `clients-core` checkout is required.

## Development

Requires **Python 3.12+** and [**uv**](https://docs.astral.sh/uv/). Runtime dependencies resolve from **PyPI** only (no internal E360 wheels). If a future release adds internal dependencies, pin them in **`[project.dependencies]`** with version bounds and **`[tool.uv.sources]`** `index = "e360-pypi"` (see **`clients-core`**). On the corporate network you can set:

```shell
export UV_INDEX_URL=https://rwes-artifactory01.internal.imsglobal.com/artifactory/api/pypi/e360-pypi/simple
```

before `uv lock` / `uv sync` when locking against Artifactory.

From the repository root:

```bash
uv sync --group dev
uv run pytest
uv run ruff check e360_charting tests
uv run ruff format e360_charting tests
```

> Install pre-commit hooks into this git repository

```bash
pre-commit install --install-hooks --overwrite
```

## Quick start

```python
from e360_charting import PieVisualisation
from e360_charting import AnnotationModel  # Optional

# Create a simple visualisation instance
vis = PieVisualisation(
    report_title='My Pie Chart',
    labels=['a', 'b', 'c'],
    values=[33, 66, 1],
    annotations=[AnnotationModel(text='Some Text', x=0.5, y=0.5)]  # Optional
)

# Get a payload from the instance as a dictionary
vis.dump()  # -> {...}

# Convert to a pure Plotly payload
vis.as_plotly().dump()  # -> {...}

```


## Grouping

```python
from e360_charting import GroupedVisualisations

"""Extends previous example"""

# Instance for holding multiple reports
group = GroupedVisualisations()

# Add a visualisation to the group
group += vis  # This way multiple instances can be merged

# Use the group to dump to a VRS payload
group.dump()  # -> {...}

```


## Charting classes available

- `e360_charting.BarStackStratifiedVisualisation`
- `e360_charting.BarStackVisualisation`
- `e360_charting.BarStratifiedVisualisation`
- `e360_charting.BarVisualisation`
- `e360_charting.DonutVisualisation`
- `e360_charting.FallenTreePlotStratifiedVisualisation`
- `e360_charting.FallenTreePlotVisualisation`
- `e360_charting.MultiChartAxesVisualisation`
- `e360_charting.MultiLineStratifiedVisualisation`
- `e360_charting.MultiLineVisualisation`
- `e360_charting.MultiSteppedLineStratifiedVisualisation`
- `e360_charting.MultiSteppedLineVisualisation`
- `e360_charting.MultiStraightLineStratifiedVisualisation`
- `e360_charting.PieVisualisation`
- `e360_charting.RelativeBarStackStratifiedVisualisation`
- `e360_charting.RelativeBarStackVisualisation`
- `e360_charting.SankeyVisualisation`
- `e360_charting.StaticSankeyVisualisation`
- `e360_charting.SunburstVisualisation`
- `e360_charting.TableStratifiedVisualisation`
- `e360_charting.TableVisualisation`
- `e360_charting.WaterfallStratifiedVisualisation`
- `e360_charting.WaterfallVisualisation`

