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

Preloader element for viz.ui #1611

Closed
wants to merge 5 commits into
base: master
from

Conversation

Projects
6 participants
@karandeepSJ
Copy link
Contributor

karandeepSJ commented Aug 8, 2018

This PR adds an animated element to viz.ui, a Preloader. It consists of three concentric, multi-colored arcs rotating about their centre. A repeating timer is used to call the rotation callback whenever the timer ends and restarts.
The following script can be used to run it:

import dipy.viz.ui as ui
import dipy.viz.window as window
loader = ui.Preloader(outer_radius=100, center=(300, 300))
sm=window.ShowManager(size=(600, 600))
sm.initialize()
sm.iren.CreateRepeatingTimer(10)
loader.add_callback(sm.iren, 'TimerEvent', loader.rotation_callback)
sm.ren.add(loader)
sm.start()

loader

@arokem

This comment has been minimized.

Copy link
Member

arokem commented Aug 8, 2018

So pretty! I could watch that forever ❤️

@dmreagan dmreagan added the gsoc2018 label Aug 8, 2018

@dmreagan

This comment has been minimized.

Copy link
Contributor

dmreagan commented Aug 8, 2018

Looks like there's an error with test_ui_preloader on Travis. Could be a VTK 5.8 problem.

@skoudoro

This comment has been minimized.

Copy link
Member

skoudoro commented Aug 8, 2018

many chances. We have to take a decision on this problem (VTK version).

@karandeepSJ

This comment has been minimized.

Copy link
Contributor Author

karandeepSJ commented Aug 9, 2018

Yeah this is a version problem. vtkArcSource did not have the polar form of coordinates in older versions.

@dmreagan dmreagan added this to PR needs a review in Viz Module Aug 9, 2018

@dmreagan

This comment has been minimized.

Copy link
Contributor

dmreagan commented Aug 9, 2018

A few thoughts:

  • I think the setup is too complex for what is just a placeholder. I wonder if there is a way to make it just a line or two.
  • It needs to be simple and obvious how to show/create and hide/destroy the preloader.
  • The arcs are cool, but maybe we should start by simply loading an image and rotating it.
@Garyfallidis

This comment has been minimized.

Copy link
Member

Garyfallidis commented Aug 9, 2018

Agree with all 3. And definitely an image will be much easier to change. More generic.

@karandeepSJ

This comment has been minimized.

Copy link
Contributor Author

karandeepSJ commented Aug 10, 2018

I can create a function initialize_loader that takes the ShowManager object and executes the three commands:

sm.initialize()
sm.iren.CreateRepeatingTimer(10)
loader.add_callback(sm.iren, 'TimerEvent', loader.rotation_callback)
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Aug 13, 2018

Codecov Report

Merging #1611 into master will decrease coverage by 10.43%.
The diff coverage is 13.22%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1611       +/-   ##
===========================================
- Coverage   87.34%   76.91%   -10.44%     
===========================================
  Files         246      246               
  Lines       32266    32384      +118     
  Branches     3504     3508        +4     
===========================================
- Hits        28184    24908     -3276     
- Misses       3247     6814     +3567     
+ Partials      835      662      -173
Impacted Files Coverage Δ
dipy/viz/ui.py 20.3% <15.29%> (-68.92%) ⬇️
dipy/viz/tests/test_ui.py 13.73% <8.33%> (-68.42%) ⬇️
dipy/viz/tests/test_window.py 12% <0%> (-81.6%) ⬇️
dipy/viz/widget.py 6.71% <0%> (-81.35%) ⬇️
dipy/viz/interactor.py 19.01% <0%> (-79.15%) ⬇️
dipy/viz/actor.py 4.94% <0%> (-77.86%) ⬇️
dipy/viz/tests/test_interactor.py 18.39% <0%> (-71.27%) ⬇️
dipy/viz/colormap.py 17.85% <0%> (-68.58%) ⬇️
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 606739b...2a9f203. Read the comment docs.

@karandeepSJ karandeepSJ force-pushed the karandeepSJ:Preloader branch from e023f66 to 98bcba6 Sep 6, 2018

@karandeepSJ karandeepSJ force-pushed the karandeepSJ:Preloader branch from 98bcba6 to 9b8fb1b Sep 8, 2018

@skoudoro

This comment has been minimized.

Copy link
Member

skoudoro commented Oct 9, 2018

Hi @karandeepSJ,

Can you move this PR on this repo : https://github.com/fury-gl/fury ?

Thank you!

@skoudoro

This comment has been minimized.

Copy link
Member

skoudoro commented Oct 15, 2018

Closing. This PR was moved to fury-gl/fury#19

@skoudoro skoudoro closed this Oct 15, 2018

@skoudoro skoudoro moved this from PR needs a review to Done in Viz Module Oct 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment