Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicit triggerRender #41

Closed
2 tasks
xhluca opened this issue Apr 13, 2021 · 8 comments
Closed
2 tasks

Implicit triggerRender #41

xhluca opened this issue Apr 13, 2021 · 8 comments

Comments

@xhluca
Copy link
Collaborator

xhluca commented Apr 13, 2021

I feel the triggerRender is a bit clunky and makes it impossible to have more than one callback that updates a given view. how much effort would it be to make that implicit?

EDIT: Ok so it already works with the trigger render, so let's remove it from the demos:

  • usage-vtk-cfd
  • slice-rendering
  • [ ]
@xhluca
Copy link
Collaborator Author

xhluca commented Apr 13, 2021

For example, the following approach would not work:

@app.callback(
  [Output("vtk-view", "triggerRender"), Output("mesh", "value")],
  [Input(...)]
)
def update_mesh_nested_in_view(...):
    ...

@app.callback(
  [Output("vtk-view", "triggerRender"), Output("algorithm", "value")],
  [Input(...)]
)
def update_algorithm_nested_in_view(...):
    ...

Since dash doesn't allow having an output being shared across different callbacks. However with an implicit rendering trigger it wouldn't have this problem.

@jourdain
Copy link
Collaborator

It is already the case... You can remove such output

@xhluca
Copy link
Collaborator Author

xhluca commented Apr 13, 2021

@jourdain you are right. i'll update the issue as a reminder to remove those from the tutorials/demos since it's legacy.

@xhluca
Copy link
Collaborator Author

xhluca commented Apr 13, 2021

@jourdain Actually, seems like it's not true for all cases.

With the F1 vehicle geometry app, it seems like it doesn't work when we try to set the visibility, but it only works when we update the mesh color.

Without the triggerrender:
without-trigger

With the trigger render:
with-trigger

@jourdain
Copy link
Collaborator

That is an easy fix... I'll do it tomorrow

@jourdain
Copy link
Collaborator

react-vtk-js@1.4.3 should fix that if you update dash_vtk tomorrow morning before I start my work...

@xhluca
Copy link
Collaborator Author

xhluca commented Apr 27, 2021

I haven't tried this but it doesn't seem to be a problem anymore. Will close it but if it comes back in the future we can reopen

@xhluca xhluca closed this as completed Apr 27, 2021
@MuntherOdeh
Copy link

Hi, I've tried the code app.py but it's still not working with or without the trigger render. It gives me everytime the same error:
Callback error updating vtk-view.triggerRender

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

No branches or pull requests

3 participants