Metadata-Version: 2.3
Name: paraview-trame-components
Version: 0.1.1
Summary: Macro components for ParaView
Author-email: Sebastien Jourdain <sebastien.jourdain@kitware.com>
Maintainer-email: Sebastien Jourdain <sebastien.jourdain@kitware.com>
License: Copyright 2024 Kitware Inc.
        
        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
Keywords: components,paraview,trame,web
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.10
Requires-Dist: trame
Requires-Dist: trame-vtk
Requires-Dist: trame-vuetify
Provides-Extra: ci
Requires-Dist: build; extra == 'ci'
Requires-Dist: pre-commit; extra == 'ci'
Provides-Extra: dev
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: python-semantic-release; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# ParaView Trame Components

This project gather helper classes that can be used with ParaView to create quickly and simply web solution for interacting with your data.

## Usage example

The `./examples/` directory gather simple Python scripts using ParaView and exposing them as standalone trame applications.

## Virtual Environment setup

Since ParaView does not come with trame, you need to create a virtual environment that brings all the missing dependency for paraview to use.

```bash
# Create and activate venv
python3.10 -m venv .venv
source .venv/bin/activate

# Install published package
pip install ptc

# Let ParaView know about the location of that venv
export PV_VENV=$PWD/.venv
```

## Running examples

```bash
# Adjust path to point to your executable
export PVPYTHON=/Applications/ParaView-5.12.0.app/Contents/bin/pvpython

# Run the scripts
$PVPYTHON --force-offscreen-rendering ./examples/cone.py
$PVPYTHON --force-offscreen-rendering ./examples/cone_width_slider.py
$PVPYTHON --force-offscreen-rendering ./examples/wavelet-contour-state.py
```

## Scripts structure

Each script add `import paraview.web.venv` at the top to enable your virtual environment via the `PV_VENV` environment variable.

Then we use the ptc (ParaView Trame Components) package to quickly create a trame application to view the data.

The `wavelet-contour-state.py` script was created by ParaView when saving its state as a Python file. Then we added few lines at the end to create an interactive web viewer.

## Check code

`pre-commit run --all-files`