Skip to content

Ports RingSlider2D to v2 architecture#1121

Open
medha-14 wants to merge 8 commits intofury-gl:v2from
medha-14:ringslider2d
Open

Ports RingSlider2D to v2 architecture#1121
medha-14 wants to merge 8 commits intofury-gl:v2from
medha-14:ringslider2d

Conversation

@medha-14
Copy link

@medha-14 medha-14 commented Feb 23, 2026

Issue: #1116
Ports RingSlider2D to the v2 branch following the new UI architecture.

Changes

  • Migrated core logic from legacy implementation to v2 structure
  • Adapted implementation to match current UI component patterns
  • Added associated tests
  • Ensured API and user experience remain consistent with the original component
image

Base Branch

v2

@medha-14
Copy link
Author

I’ve pushed the initial changes for this. Would really appreciate it if you could take a look and share any feedback or suggestions.I’d be happy to iterate and refine it further .
Thank you!

@ganimtron-10
Copy link
Contributor

Hi @medha-14 ,

Thanks for the PR. I am currently working on #1118 and will review your PR once that is done as it would lay out the foundation and you can adapt according to it.

@m-agour m-agour requested a review from ganimtron-10 February 23, 2026 19:56
@maharshi-gor
Copy link
Contributor

Hello @medha-14 Thanks for the work.

I have merged #1118 from @ganimtron-10 . Please rebase the PR.

Also provide an example for the same to try and test the changes.

@medha-14
Copy link
Author

medha-14 commented Feb 27, 2026

Hi @maharshi-gor, @ganimtron-10

I’ve completed the required changes and also added the corresponding examples and tests. Could you please review the updates when you get a chance and let me know if anything needs further improvement or fixes? Thanks!

Copy link
Contributor

@maharshi-gor maharshi-gor left a comment

Choose a reason for hiding this comment

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

Hello @medha-14 Thank you for the work. Looks good.

I strongly believe that we are repeating work from lineslider2D. @ganimtron-10 should be able to assess better.

I think RingSlider2D should inherit LineSlider2D and just override the methods which are absolutely necessary.

Please provide your view @ganimtron-10 .

Again @medha-14 thanks for work it works as expected, but I think we might need to consider the maintenance as well.

# self.on_change = lambda ui: None
# self.on_value_changed = lambda ui: None
# self.on_moving_slider = lambda ui: None
# Offer some standard hooks to the user.
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove comment

# # Slider's handle.
# self.handle = Disk2D(outer_radius=1)
# self.handle.color = self.default_color
# Final update
Copy link
Contributor

Choose a reason for hiding this comment

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

Here as well.

Create the slider's circle (Disk2D), the handle (Disk2D) and
the text (TextBlock2D).
"""
# Slider's track
Copy link
Contributor

Choose a reason for hiding this comment

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

Here.

# def _get_actors(self):
# """Get the actors composing this UI component."""
# return self.track.actors + self.handle.actors + self.text.actors
# Slider's handle
Copy link
Contributor

Choose a reason for hiding this comment

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

Here

# """Get the actors composing this UI component."""
# return self.track.actors + self.handle.actors + self.text.actors
# Slider's handle
self.handle = Disk2D(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we not provide option to select the handle type like LineSlider2D?


# def _add_to_scene(self, scene):
# """Add all subcomponents or VTK props that compose this UI component.
# Slider Text
Copy link
Contributor

Choose a reason for hiding this comment

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

here

# Parameters
# ----------
# scene : scene
# Add default events listener for this UI component.
Copy link
Contributor

Choose a reason for hiding this comment

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

here

# self.on_value_changed(self)
def _update_actors_position(self):
"""Update the position of the internal actors."""
# Position the ring center based on the widget's anchor position.
Copy link
Contributor

Choose a reason for hiding this comment

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

here

@ganimtron-10
Copy link
Contributor

Hi @medha-14 ,
I agree with @maharshi-gor, all the sliders have a common functionality and can be abstracted similar to the Button2D. Can you try to refactor and abstract out common functionality from all sliders into a base class something like Slider2D and then the LineSlider, DoubleLineSlider, RingSlider can inherit it and differ according to the functionality.

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.

3 participants