Skip to content

feat: add the ability to pass additional data arguments LocalView.update()#71

Closed
ansbbrooks wants to merge 1 commit into
Kitware:masterfrom
ansbbrooks:local-view-update-args-1
Closed

feat: add the ability to pass additional data arguments LocalView.update()#71
ansbbrooks wants to merge 1 commit into
Kitware:masterfrom
ansbbrooks:local-view-update-args-1

Conversation

@ansbbrooks

Copy link
Copy Markdown

Occasionally we need to send additional arbitrary data to the frontend when we make a call to LocalView.update() on the server. This PR adds the ability to pass arguments to the call to Server.js_call() that LocalView.update() makes internally.

@ansbbrooks ansbbrooks changed the title Add the ability to pass additional data arguments LocalView.update() feat: add the ability to pass additional data arguments LocalView.update() Jun 22, 2026
Comment thread src/trame_vtklocal/widgets/vtklocal.py Outdated
return self._update_throttle

def update(self, push_camera=False):
def update(self, push_camera=False, *args: Any):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather use kwargs and just send it as a single object to the method call.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks but looking at the JS side, we have an issue.

https://github.com/Kitware/trame-vtklocal/blob/master/vue-components/src/components/VtkLocal.js#L270

I will need to do that change with the new version of vtk-wasm. But I'll keep that in mind once I do the code change.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pushed a commit that should fix this.

@jourdain

jourdain commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

I'm ok with those changes for now to solve your needs, but ideally, I want to provide a better solution. But I'll tackle it with the latest version of vtk-wasm.

You have to use semantic release for your commit and fix the Any annotation.

@ansbbrooks ansbbrooks force-pushed the local-view-update-args-1 branch from c8d7cd9 to 960a8b9 Compare June 23, 2026 18:23
…LocalView.update() method.

Pass one object instead of unwrapping it into multiple arguments.

Ensure the "bindCanvas" JS portion still works correctly with the optional data payload.

fixed "any" annotation
@ansbbrooks ansbbrooks force-pushed the local-view-update-args-1 branch from 960a8b9 to b8f903f Compare June 23, 2026 18:24
@ansbbrooks

Copy link
Copy Markdown
Author

You have to use semantic release for your commit and fix the Any annotation.

Done, let me know if that looks good.

@jourdain

Copy link
Copy Markdown
Collaborator

I'm currently in the process of updating trame-vtklocal to use @kitware/vtk-wasm>=2.1 that will include the update call to pass additional parameters. I'm hopping to wrap up my changes today (or tomorrow).

Should I squeeze you change before, or are you ok to wait?

@ansbbrooks

Copy link
Copy Markdown
Author

I'm currently in the process of updating trame-vtklocal to use @kitware/vtk-wasm>=2.1 that will include the update call to pass additional parameters. I'm hopping to wrap up my changes today (or tomorrow).

Should I squeeze you change before, or are you ok to wait?

I can wait, no problem.

@jourdain

Copy link
Copy Markdown
Collaborator

Closing as #72 includes the needed change.

@jourdain jourdain closed this Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants