Skip to content

Commit

Permalink
fix(trame): Use v3
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Jul 21, 2023
1 parent 5884051 commit 4a37615
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .deploy-release/setup/apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ trame:
- -m
- paraview.apps.trame
- --trame-app
- pv_visualizer
- pv_visualizer.app
- --data
- /data
- --host
Expand Down
53 changes: 27 additions & 26 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ Visualizer
:target: https://github.com/Kitware/paraview-visualizer/actions/workflows/test_and_release.yml
:alt: Test and Release

Web frontend to ParaView
Visualizer is a Web frontend to ParaView based on trame. The current project is currently incomplete.
You can see it as an alpha version of what it could be. To make it fully functional we need more time and possibly funding.
But rather than waiting for it to be ready to release it, we are putting it out there as it does provide some very good example of what can be done with ParaView and trame.

If you would like us to push it forward or want some help creating something similar, feel free to reach out to `kitware <https://www.kitware.com/contact/>`_ so we can see how we can help you.

|image_1| |image_2| |image_3|

Expand All @@ -18,15 +22,20 @@ Web frontend to ParaView
:width: 30%


* Free software: BSD license
License
-------

This software is distributed under a BSD-3 license


Development
------------
Installing for Development
--------------------------

Build and install the Vue components

.. code-block:: console
export NODE_OPTIONS=--openssl-legacy-provider
cd vue-components
npm i
npm run build
Expand All @@ -41,43 +50,35 @@ Create a virtual environment to use with your `ParaView 5.10+ <https://www.parav
python -m pip install -U pip
pip install -e .
Run the application using `ParaView: pvpython <https://www.paraview.org/>`_ executable

.. code-block:: console
export PV_VENV=$PWD/.venv
/Applications/ParaView-5.10.0.app/Contents/bin/pvpython \ # Using macOS install path as example
pv_run.py \
--data ~ \
--server --dev
Installing from release
-----------------------

Run application
----------------

Create a virtual environment to use with your `ParaView 5.10.1+ <https://www.paraview.org/download/>`_
Create a virtual environment to use with your `ParaView 5.10+ <https://www.paraview.org/download/>`_

.. code-block:: console
python3.9 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
pip install pv-visualizer
python -m pip install -U pip pv-visualizer
Running the application
-----------------------

Run the application using `ParaView: pvpython <https://www.paraview.org/>`_ executable with environment variables:
Run the application using `ParaView: pvpython <https://www.paraview.org/>`_ executable

.. code-block:: console
export PVPYTHON=/Applications/ParaView-5.10.0.app/Contents/bin/pvpython # Using macOS install path as example
export PV_VENV=$PWD/.venv
export TRAME_APP=pv_visualizer
pvpython -m paraview.apps.trame --data ~
export TRAME_APP=pv_visualizer.app
$PVPYTHON -m paraview.apps.trame --data ~
Or with command line arguments:
Or you can use command line arguments instead of environment variables

.. code-block:: console
pvpython -m paraview.apps.trame \
$PVPYTHON -m paraview.apps.trame \
--venv $PWD/.venv \
--trame-app pv_visualizer \
--trame-app pv_visualizer.app \
--data ~
5 changes: 3 additions & 2 deletions pv_visualizer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os
from trame_client.utils.version import get_version

from .app import main
# Disable warning
os.environ["TRAME_DISABLE_V3_WARNING"] = "1"

__version__ = get_version("pv-visualizer")

__all__ = [
"__version__",
"main",
]
10 changes: 2 additions & 8 deletions pv_visualizer/app/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
from trame.app import get_server, dev
from trame.app import get_server

SERVER = None

Expand All @@ -24,14 +24,8 @@ def main(server=None, data=None, plugins=None, **kwargs):
args, _ = server.cli.parse_known_args()
plugins = args.plugins.split(",") if args.plugins else []

# Make UI auto reload
def _reload():
dev.reload(ui)
ui.initialize(SERVER)

server.controller.on_server_reload.add(_reload)

# Init application
server.client_type = "vue2"
SERVER = server

engine.initialize(server, plugins)
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ packages = find:
include_package_data = True
install_requires =
trame
trame-vuetify
trame-components
trame-vtk
trame-simput

[options.entry_points]
Expand Down

0 comments on commit 4a37615

Please sign in to comment.