openPMD/openPMD-viewer

invisible 'active' checkbox

Closed this issue ยท 9 comments

Hi Remi

I've got an invisible 'active' checkbox in Firefox (in a fresh installation of Debian stretch with conda3)
The bug appears to be sensitive to two things

  • the fact that checkbox is included into widgets.HBox
  • the width fixed

I've got it fix by doing the following modif (for example in to_container of ColorBarSelector class)

        # Set the widget dimensions
#        set_widget_dimensions( self.active, width=20 )
        set_widget_dimensions( self.low_bound, width=60 )
        set_widget_dimensions( self.up_bound, width=60 )
        set_widget_dimensions( self.exponent, width=45 )
        set_widget_dimensions( self.cmap, width=200 )
        # Gather the different widgets on two lines 
        cmap_container = widgets.HBox( children=[  
            widgets.HTML( "<b>Colorbar:</b>"), self.cmap ])
        if ipywidgets_version > 4:
            # For newer version of ipywidgets: add the "x10^" on same line
            range_container = widgets.HBox( children=[             
                add_description("from", self.low_bound, width=30 ),
                add_description("to", self.up_bound, width=20 ),  
                add_description("x 10^", self.exponent, width=45 ) ] )
            final_container = widgets.VBox( 
                children=[ cmap_container, range_container, active_container, self.active ])

in my case, such was needed for all other to_container methods.
The result looks like this -- is not too ugly, so if you wish i could PR this or you may find some elegant solution

opmd_ntbk_bugfix

Hey, thanks a lot for reporting this issue!
Could you let me know which version of jupyter and ipywidgets you have? I'll try to reproduce the issue.

Commenting out the set_widget_dimensions( self.active, width=20 ) could be solution, but it would maybe be problematic for other version of ipywidgets (for some versions, the layout of the widgets is quite different, and this is why I impose a set width.)

right, forgot to type the versions:
ipython 6.1.0
ipywidgets 7.0.0
jupyter 1.0.0 (client 5.1.0)
mozilla firefox ESR 52.4.0 (doubt its relevant)

Its true that the way pywidgets develops is rather messy -- i've also had few widgets-based little apps which started to behave weird after upgrades..

by the way, it was not only commenting the set_widget_dimensions -- I had to also get the checkbox out of HBox, cause even without the fixed width it stayed hidden

Ok, I think I have a solution: basically one needs to set indent=False when creating the CheckBox. I'll do a pull request today.

OK, great! So you was able to reproduce the bug? i'll check tomorrow if this solution works for the distribution on my lab machine and will let you know.
By the way, will this modif get applied directly to conda and pip installers also or this will wait for a new release ?

Yes, I was able to reproduce the bug. But it would still be good if you could confirm that it fixes it also in your case (you will need to use the modified branch for the moment:

pip uninstall openPMD-viewer
git clone https://github.com/RemiLehe/openPMD-viewer.git
cd openPMD-viewer
git checkout better_ipywidgets7
python setup.py install

You will need to wait for the next release for these changes to be available via pip or conda. However, I think I'll do the next release as soon as PR #176 is merged.

confirmation: "the bug is down, i repeat, the bug is down" =)

:)
@hightower8083 The new release is now available on pip and conda.

:)
@hightower8083 The new release is now available on pip and conda.

:)
@hightower8083 The new release is now available on pip and conda.