{"id":20399911,"url":"https://github.com/kitware/paraview-trame-components","last_synced_at":"2025-04-12T13:50:25.843Z","repository":{"id":232883485,"uuid":"785311795","full_name":"Kitware/paraview-trame-components","owner":"Kitware","description":"High level trame components for ParaView","archived":false,"fork":false,"pushed_at":"2025-04-03T22:59:23.000Z","size":2791,"stargazers_count":6,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T23:29:28.829Z","etag":null,"topics":["paraview","trame","trame-app"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kitware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-11T16:22:13.000Z","updated_at":"2024-12-03T06:41:59.000Z","dependencies_parsed_at":"2024-06-10T19:01:32.242Z","dependency_job_id":"08e19dac-d5f3-4fd6-b200-685dc3ac34c4","html_url":"https://github.com/Kitware/paraview-trame-components","commit_stats":null,"previous_names":["kitware/paraview-trame-components"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitware%2Fparaview-trame-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitware%2Fparaview-trame-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitware%2Fparaview-trame-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitware%2Fparaview-trame-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kitware","download_url":"https://codeload.github.com/Kitware/paraview-trame-components/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248575442,"owners_count":21127186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["paraview","trame","trame-app"],"created_at":"2024-11-15T04:35:05.227Z","updated_at":"2025-04-12T13:50:25.819Z","avatar_url":"https://github.com/Kitware.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ParaView Trame Components\n\nThis project gather helper classes that can be used with ParaView to create quickly and simply web solution for interacting with your data.\n\n## Usage example\n\nThe `./examples/` directory gather simple Python scripts using ParaView and exposing them as standalone trame applications.\n\n## Virtual Environment setup\n\nSince ParaView does not come with trame, you need to create a virtual environment that brings all the missing dependency for paraview to use.\n\n```bash\n# Create and activate venv\npython3.10 -m venv .venv\nsource .venv/bin/activate\n\n# Install published package\npip install paraview-trame-components\n\n# Let ParaView know about the location of that venv\nexport PV_VENV=$PWD/.venv\n```\n\n## Running examples\n\n```bash\n# Adjust path to point to your ParaView executable\nexport PVPYTHON=/Applications/ParaView-5.12.0.app/Contents/bin/pvpython\n\n# Run the scripts\n$PVPYTHON --force-offscreen-rendering ./examples/cone.py\n$PVPYTHON --force-offscreen-rendering ./examples/cone-with-slider.py\n$PVPYTHON --force-offscreen-rendering ./examples/wavelet-contour-state.py\n$PVPYTHON --force-offscreen-rendering ./examples/pipeline.py\n$PVPYTHON --force-offscreen-rendering ./examples/selection.py\n```\n\n## Scripts structure\n\nEach script add `import paraview.web.venv` at the top to enable your virtual environment via the `PV_VENV` environment variable.\n\nThen we use the ptc (ParaView Trame Components) package to quickly create a trame application to view the data.\n\nThe `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.\n\n## Check code\n\n```bash\n# one time\npip install \".[dev]\"\npre-commit install\n\n# check but automatic on commit\npre-commit run --all-files\n```\n\n## ParaView code example\n\n```python\nimport paraview.web.venv\nfrom ptc import Viewer\nfrom paraview import simple\n\ncone = simple.Cone()\nsimple.Show()\nsimple.Render()\n\n# Make it a web app\nweb_app = Viewer()\nweb_app.start()\n```\n\nAnd if you want to add some UI\n\n```python\nimport paraview.web.venv\nfrom paraview import simple\n\nfrom ptc import Viewer\nfrom trame.widgets.vuetify3 import VSlider\n\ncone = simple.Cone()\nsimple.Show()\nsimple.Render()\n\n# Make it a web app\nweb_app = Viewer()\n\nwith web_app.side_top:\n    VSlider(\n        v_model=(\"resolution\", 6),\n        min=3, max=60, step=1,\n    )\n\n@web_app.state.change(\"resolution\")\ndef on_resolution_change(resolution, **kwargs):\n    cone.Resolution = resolution\n    web_app.update()\n\nweb_app.start()\n```\n\n## Example in image\n\n| ![Code](https://raw.githubusercontent.com/Kitware/paraview-trame-components/main/.web-app-input.png) | ![Web App](https://raw.githubusercontent.com/Kitware/paraview-trame-components/main/.web-app-output.png) |\n| :-------------------------: |  :----------------------------: | \n| Write some python code      |  And get a web app              | ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitware%2Fparaview-trame-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitware%2Fparaview-trame-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitware%2Fparaview-trame-components/lists"}