{"id":20399874,"url":"https://github.com/kitware/trame-vtklocal","last_synced_at":"2026-01-30T03:32:47.315Z","repository":{"id":234525877,"uuid":"760145891","full_name":"Kitware/trame-vtklocal","owner":"Kitware","description":"Local Rendering using VTK.wasm to match server side rendering pipeline on the client side.","archived":false,"fork":false,"pushed_at":"2026-01-22T21:47:40.000Z","size":21339,"stargazers_count":29,"open_issues_count":18,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-23T14:30:04.857Z","etag":null,"topics":["trame","trame-maintenance-program"],"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.rst","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.rst","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-19T21:40:38.000Z","updated_at":"2026-01-22T21:47:43.000Z","dependencies_parsed_at":"2024-04-19T18:03:05.651Z","dependency_job_id":"8afa32a9-121e-4fa6-901f-7fc2f596833f","html_url":"https://github.com/Kitware/trame-vtklocal","commit_stats":null,"previous_names":["kitware/trame-vtklocal"],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/Kitware/trame-vtklocal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitware%2Ftrame-vtklocal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitware%2Ftrame-vtklocal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitware%2Ftrame-vtklocal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitware%2Ftrame-vtklocal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kitware","download_url":"https://codeload.github.com/Kitware/trame-vtklocal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kitware%2Ftrame-vtklocal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28796966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["trame","trame-maintenance-program"],"created_at":"2024-11-15T04:34:45.804Z","updated_at":"2026-01-27T02:19:20.792Z","avatar_url":"https://github.com/Kitware.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. |pypi_download| image:: https://img.shields.io/pypi/dm/trame-vtklocal\n\n========================================================\ntrame-vtklocal  |pypi_download|\n========================================================\n\nLocal Rendering using VTK.wasm to match server side rendering pipeline on the client side.\nThe current code base is still at its infancy but we aim to make it the default implementation for local rendering using VTK/ParaView with trame.\nThis WASM capability is starting to be available with VTK 9.4 but major improvement are happening in VTK 9.6.\n\nAdditional documentation can be found on [vtk-wasm documentation](https://kitware.github.io/vtk-wasm/).\n\nVTK `9.4`, `9.5` and `9.6` are compatible with `trame-vtklocal\u003e=0.16,\u003c1` while `trame-vtklocal\u003e=1` will only be compatible with `VTK 10`.\nWhat we envision with VTK 10 is the completion of the main work with WASM and WebGPU. We will take that opportunity to cleanup\nthe code in trame-vtklocal by removing legacy setup that were needed for VTK 9.4 and 9.5.\n\nA simple demo can be executed like so\n\n.. code-block:: console\n\n    # Using the local repository file\n    uv run ./examples/demo/widget.py\n\n    # Or from the url\n    uv run https://raw.githubusercontent.com/Kitware/trame-vtklocal/refs/heads/master/examples/demo/widget.py\n\nTo get the following\n\n.. image:: https://raw.githubusercontent.com/Kitware/trame-vtklocal/refs/heads/master/trame-vtklocal.png\n  :alt: Usage example of trame-vtklocal\n\nLicense\n----------------------------------------\n\nThis library is OpenSource and follow the Apache Software License\n\nInstallation\n----------------------------------------\n\n.. code-block:: console\n\n    # to install VTK yourself\n    pip install trame-vtklocal\n\n    # for the latest VTK capabilities\n    pip install \"vtk\u003e=9.6\" --pre --index-url https://wheels.vtk.org\n\n\nDevelopment\n----------------------------------------\n\nBuild and install the Vue components\n\n.. code-block:: console\n\n    cd vue-components\n    npm i\n    npm run build\n    cd -\n\nInstall the library\n\n.. code-block:: console\n\n    # Create venv and install all dependencies\n    uv sync --all-extras --dev\n\n    # Activate environment\n    source .venv/bin/activate\n\n    # Install commit analysis\n    pre-commit install\n    pre-commit install --hook-type commit-msg\n\n    # Allow live code edit\n    uv pip install -e .\n\nOptionally, you can develop with bleeding edge VTK by following these steps. Make sure you've these tools\n\n1. git\n2. CMake\n3. Ninja\n4. Python\n5. NodeJS \u003e= 24.0.1: https://nodejs.org/en/download/package-manager\n6. Emscripten SDK version 4.0.10: See https://emscripten.org/docs/getting_started/downloads.html#download-and-install\n\n.. code-block:: console\n\n    # Compile VTK for wasm32 architecture using emscripten. Build artifacts can be found in dev/vtk/build/wasm\n    python ./utils/build_vtk.py -u https://gitlab.kitware.com/vtk/vtk.git -b master -t wasm32 -c RelWithDebInfo\n\n    # Compile VTK with python wrappings using system C++ compiler. Build artifacts can be found in dev/vtk/build/py\n    python ./utils/build_vtk.py -u https://gitlab.kitware.com/vtk/vtk.git -b master -t py -c RelWithDebInfo\n\n    # Windows: Set environment variables\n    ./utils/dev_environment.ps1 -b master -c RelWithDebInfo\n\n    # Unix: Set environment variables\n    source ./utils/dev_environment.sh -b master -c RelWithDebInfo\n\n\nRunning examples\n----------------------------------------\n\n.. code-block:: console\n\n    pip install trame \"trame-vtklocal[vtk]\" trame-vuetify trame-vtk\n\n    # regular trame app\n    python ./examples/vtk/cone.py\n\n\nSome example are meant to test and validate WASM rendering.\nSome will default for remote rendering but if you want to force them to use WASM just run `export USE_WASM=1` before executing them.\n\nProgress events\n----------------------------------------\n\nThe client-side VtkLocal component emits a `progress` event while wasm sync is happening.\nThis can be used to keep a global loader visible until the first sync completes.\n\n.. code-block:: python\n\n    from trame.widgets import vtklocal, vuetify\n\n    state.app_loading = True\n    state._vtklocal_seen_active = False\n\n    def on_vtklocal_progress(event):\n        if event.get(\"active\"):\n            state._vtklocal_seen_active = True\n            state.app_loading = True\n        elif state._vtklocal_seen_active:\n            state.app_loading = False\n\n    with vuetify.VOverlay(v_model=(\"app_loading\",), absolute=True):\n        vuetify.VProgressCircular(indeterminate=True, size=64)\n\n    view = vtklocal.LocalView(\n        render_window,\n        progress=(on_vtklocal_progress, \"[$event]\"),\n    )\n\nIf you are using the Vue component directly, you can override the built-in loader\nwith the `loader` slot.\n\n.. code-block:: html\n\n    \u003cvtk-local\u003e\n      \u003ctemplate #loader=\"{ progress, wasmLoading, statePercent, hashPercent }\"\u003e\n        \u003cdiv v-if=\"wasmLoading\"\u003eLoading wasm...\u003c/div\u003e\n        \u003cdiv v-else\u003e\n          States: {{ progress.state.current }}/{{ progress.state.total }}\n          Blobs: {{ progress.hash.current }}/{{ progress.hash.total }}\n        \u003c/div\u003e\n      \u003c/template\u003e\n    \u003c/vtk-local\u003e\n\nSharedArrayBuffer\n----------------------------------------\n\nTo enable SharedArrayBuffer within trame you can just set the following on the server.\nThis option is not required anymore but still available if needed.\n\n.. code-block:: console\n\n    server.http_headers.shared_array_buffer = True\n\n\nThis will download the threaded WASM version. Otherwise, the non-threaded version will be used as it does not require SharedArrayBuffer.\n\n\nVTK.wasm vs trame-vtklocal\n----------------------------------------\n\nThis repository `trame-vtklocal` focus on providing a web component that is capable of mirroring a `vtkRenderWindow` defined on the server side.\nThis include a JavaScript section for the browser and a Python section for the server.\n\nThe server include a definition of a custom network protocol over our WebSocket (wslink/trame) and some helper class to ease the vtkRenderWindow binding with a web component in the browser.\nWhile the Python package include a Vue.js component for a seamless integration with trame, we also publish a `npm package \u003chttps://www.npmjs.com/package/@kitware/vtk-wasm\u003e`_.\nThat pure JavaScript library let you still use the trame infrastructure on the server side but with your own stack on the client side. A usage example of that pure JavaScript option is covered `in that directory \u003chttps://github.com/Kitware/trame-vtklocal/tree/master/examples/pure-js\u003e`_.\n\nFor the pure Python trame usage, you can find the `documented API \u003chttps://trame.readthedocs.io/en/latest/trame.widgets.vtklocal.html\u003e`_.\n\nBy design there is a nice separation between VTK.wasm and trame-vtklocal which should make trame-vtklocal fairly independent of VTK.wasm version.\nBut since we are still building capabilities, when the C++ API expend, we will also expand the Python/JavaScript component properties/methods.\nHopefully we should be able to evolve trame-vtklocal with some reasonable fallback when the version of VTK is not in par with what is exposed in trame-vtklocal.\n\nAlso most the testing of VTK.wasm is in VTK repository as many validation can be done in pure C++ or `Python \u003chttps://gitlab.kitware.com/vtk/vtk/-/tree/master/Serialization/Manager/Testing/Python\u003e`_.\nThen we have `the WASM module API \u003chttps://gitlab.kitware.com/vtk/vtk/-/blob/master/Web/WebAssembly/vtkWasmSceneManagerEmBinding.cxx\u003e`_  with its `node/chrome testing \u003chttps://gitlab.kitware.com/vtk/vtk/-/tree/master/Web/WebAssembly/Testing/JavaScript\u003e`_.\n\nThe documented API of `vtkWasmSceneManager \u003chttps://vtk.org/doc/nightly/html/classvtkWasmSceneManager.html\u003e`_ and `vtkObjectManager parent of vtkWasmSceneManager \u003chttps://vtk.org/doc/nightly/html/classvtkObjectManager.html\u003e`_\n\nFor the moment we rely on manual testing for when we change the network and/or API at the trame-vtklocal by going over a specific set of `examples \u003chttps://github.com/Kitware/trame-vtklocal/tree/master/examples\u003e`_.\n\nCurrently the WASM implementation is used in the following set of projects:\n\n- `Pan3D \u003chttps://github.com/Kitware/pan3d/\u003e`_: Pan3D aims to be an utility package for viewing and processing a wide variety of multidimensional datasets. Any dataset that can be interpreted with xarray can be explored and rendered with Pan3D.\n\n\nProfessional Support\n--------------------------------------------------------------------------\n\n* `Training \u003chttps://www.kitware.com/courses/trame/\u003e`_: Learn how to confidently use trame from the expert developers at Kitware.\n* `Support \u003chttps://www.kitware.com/trame/support/\u003e`_: Our experts can assist your team as you build your web application and establish in-house expertise.\n* `Custom Development \u003chttps://www.kitware.com/trame/support/\u003e`_: Leverage Kitware’s 25+ years of experience to quickly build your web application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitware%2Ftrame-vtklocal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitware%2Ftrame-vtklocal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitware%2Ftrame-vtklocal/lists"}