Closed kcpevey closed 5 years ago
When you use Widgets with a class, the default name is the name of the class. When you use it with an instance, it shows the default name of the instance, which has the numbers to distinguish it from other instances of the same class. You can omit the names entirely:
Thanks. That answers the first questions 1 and 2. Question 3 was how can I remove the extra padding between consecutive widgets. Applying what you've mentioned here, I now have the following image which looks good with the exception of the gap between the two widget sets (yellow line). Is there any way to make that seamless so that I can't tell that I have two widget sets (i.e. it just appears to be one set)?
I imagine we could get rid of that space, but offhand I don't know what's generating it.
If you want all of the widgets to appear as one block then would it make sense to create a class that inherits from the other two classes so that it contains all of the widgets?
That would certainly work, but it depends what those widgets are controlling whether that's appropriate. Using multiple inheritance just to eliminate whitespace shouldn't be necessary, so if you tell us that the bit of whitespace is a serious issue, we can certainly investigate and remove it; shouldn't be a big deal.
But I'll rename this issue to be about a more general solution for this problem, namely that I think we need to make it simpler to pick and choose some parameters from a variety of objects and show them all as a single grouping. It should be just a default that paramnb.Widgets dumps out all parameters from one object; instead people are very likely to need to configure multiple different objects to achieve what they want, and it should be simple to group those into a single block of widgets for display. That's a bit bigger job than just eliminating a bit of whitespace, but it should also make lots of things people want to do simpler, so I think it's important to do.
I think we need to make it simpler to pick and choose some parameters from a variety of objects and show them all as a single grouping.
I agree. This would make parts of the dashboard code simpler and it would probably also help me lay things out more nicely too.
@jbednar I agree.
@sdc50 I have a use case where the two classes are not actually related, I just want to visualize the two classes at the same time. The above example isn't a great example of that.
The same whitespace in between classes is also visible in panel objects @philippjfr
Could be related to https://github.com/pyviz/panel/issues/93
Is there a way to remove the param class name from the top of the list? (e.g. "input_param09535")
Yes, the Param pane now has a show_name parameter.
Why is it that when I move my param class to an external file instead of in the notebook, it generates a random number at the end of the param class name (e.g. "09535")?
The numbers are now stripped.
Is it possible to remove any spacing between the two visualized parambokeh widget classes? I like to be able to have separate classes visualize seamlessly (for reusing codebase).
Yes, you can now do something like this:
class A(param.Parameterized):
a = param.Number(default=1)
class B(param.Parameterized):
b = param.Number(default=1)
p1 = pn.panel(A, show_name=False)
p2 = pn.panel(B, show_name=False)
pn.layout.WidgetBox(p1[0], p2[0])
This will merge the tools into a single WidgetBox without any gap.
I have two sets (classes) of parambokeh widgets. They currently visualize like this:
I have 3 questions/comments/requests:
To summarize, what I'd like to see is this:
Is that possible now or how much effort would that require?