Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/trame_vtklocal/widgets/vtklocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import warnings
import zipfile
from pathlib import Path
from typing import Any

from trame_client.widgets.core import AbstractElement
from trame_common.exec.throttle import Throttle
Expand Down Expand Up @@ -213,13 +214,13 @@ def update_throttle(self):
"""
return self._update_throttle

def update(self, push_camera=False):
def update(self, push_camera=False, **kwargs: Any):
"""Sync view by pushing updates to client"""
self.api.update(
push_camera=push_camera,
obj_to_update=[self._render_window, *self.__registered_obj],
)
self.server.js_call(self.__ref, "update")
self.server.js_call(self.__ref, "update", kwargs)

def register_vtk_object(self, vtk_instance):
"""Register external element (i.e. widget) into the scene so it can be managed and return its wasm_id"""
Expand Down
9 changes: 8 additions & 1 deletion vue-components/src/components/VtkLocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,14 @@ export default {

return {
container,
update,
async update(){
// Server.js_call("update") could potentially send a
// payload, so wrap the inner update() function in order
// to control the method signature for the Trame callback.
// This way, payload arguments to the Trame callback do not
// interfere with the internal "bindCanvas" argument.
await update(false);
},
resetCamera,
render,
evalStateExtract,
Expand Down
Loading