Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

Fixed show_labels parameter #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixed show_labels parameter #56

wants to merge 1 commit into from

Conversation

jlstevens
Copy link
Member

@jlstevens jlstevens commented May 25, 2018

Fixes the show_labels parameter which wasn't doing anything (#10):

image

I'm not yet sure this is the right fix as I am using an empty string as the label which means the vertical spacing is unchanged. If the labels are truly dropped the widgets should probably be more compressed vertically.

@philippjfr
Copy link
Member

I think this is the correct way to disable them, only other thing you could try is setting it to None.

@jlstevens
Copy link
Member Author

I tried dropping the 'title' keyword but I'm not sure this is what we want either:

@jlstevens
Copy link
Member Author

jlstevens commented May 25, 2018

I think this is the correct way to disable them, only other thing you could try is setting it to None.

Right, that is effectively what the second screenshot shows. The sliders compress but there still seems to be a big gap between the text boxes. The values above the sliders have also vanished!

@philippjfr
Copy link
Member

That's probably fine tbh, I can only see that option being useful if you've only got one or two parameters.

@jlstevens
Copy link
Member Author

jlstevens commented May 25, 2018

Ok. For reference the diff needed is tiny for the latter (getting rid of it now):

modified   parambokeh/__init__.py
@@ -343,7 +343,7 @@ class Widgets(param.ParameterizedFunction):
         kw = dict(value=value)
 
         if self.p.show_labels is False:
-            kw['title'] = ''
+            kw['title'] = None
         elif self.p.label_formatter is not None:
             kw['title'] = self.p.label_formatter(p_name)
         else:

Though StaticText also needs a tiny edit to avoid showing the repr of None.

Ready to review if you agree the current empty string formatter is the right thing to do.

@jbednar
Copy link
Member

jbednar commented May 25, 2018

This doesn't seem like it's working yet; presumably omitting the values above the sliders should be entirely separate from omitting the labels, and omitting the labels should compress the space in all cases. Doesn't seem ready...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants