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

[Bug] Widget Text Not Hiding When Changing Slice in VTK.js ShapeWidget Example #2932

Open
rajajms opened this issue Oct 10, 2023 · 8 comments
Labels
module: example Affect example module: widget Gaps and errors in interactive widgets type: bug 🐞 Errors in functionality

Comments

@rajajms
Copy link

rajajms commented Oct 10, 2023

Bug description

In the VTK.js ShapeWidget example, when adding any widget, such as the ellipse widget, and then changing the slice using the range slider widget, the widget itself disappears on other slices as expected. However, the text associated with the widget remains visible. This behavior is unexpected, as the text should also hide when the widget disappears on different slices.

image

Steps to reproduce

  1. Go to the VTK.js ShapeWidget example: https://kitware.github.io/vtk-js/examples/ShapeWidget.html
  2. Add a widget, for example, an ellipse widget, by clicking the dropdown button.
  3. Use the range slider widget to change the slice.

Detailed Behavior

After step 3, when changing the slice using the range slider widget, the widget (ellipse) correctly disappears on other slices, but the associated text remains visible. This behavior creates a visual inconsistency where the text is displayed without the widget.

Expected Behavior

When changing the slice using the range slider widget, both the widget and its associated text should hide on slices where the widget is not intended to be displayed. This behavior would ensure visual consistency and a more intuitive user experience.

Environment

  • vtk.js version:
  • Browsers:
  • OS:
@rajajms rajajms added the type: bug 🐞 Errors in functionality label Oct 10, 2023
@finetjul finetjul added module: widget Gaps and errors in interactive widgets module: example Affect example labels Oct 17, 2023
@finetjul
Copy link
Member

My naive guess is that it is typically a bug at "application level" (here in the example). It is not a bug at the "widget level"

@rajajms
Copy link
Author

rajajms commented Oct 17, 2023

My naive guess is that it is typically a bug at "application level" (here in the example). It is not a bug at the "widget level"

How can this issue be resolved, and is there a plan to address it in the next release? As a beginner, I'm wondering if this issue will be resolved for me. @finetjul

@finetjul
Copy link
Member

Unfortunately I do not have much "free" time those days. So I do not have unpaid time to work on this.

@rajajms
Copy link
Author

rajajms commented Oct 17, 2023

@floryst @jourdain

@jourdain
Copy link
Collaborator

@rajajms PR are welcome

@rajajms
Copy link
Author

rajajms commented Oct 18, 2023

@jourdain Couldn't find the example code in GitHub. I found the index from here

Screenshot 2023-10-18 at 17-49-04 File not found · Kitware_vtk-js

@jourdain
Copy link
Collaborator

@floryst
Copy link
Collaborator

floryst commented Oct 18, 2023

bindSVGRepresentation only listens to the widget state and does not handle the case when the widget visibility is toggled. The fix would be to change that function to accept widget rather than widgetState and additionally listen to modification changes on the widget itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: example Affect example module: widget Gaps and errors in interactive widgets type: bug 🐞 Errors in functionality
Projects
None yet
Development

No branches or pull requests

4 participants