A useful function that disable tree label wrapping inside a panel #2456
Unanswered
MaZED-UP
asked this question in
Show and tell
Replies: 1 comment
-
The other way is to put the tree in a table column, but creating a column automatically creates a blank row which is annoying. The good thing about this method is that markup can be used. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Since the
Panel
class does not have theno_wrap
parameter (as opposed to tables), trees in panels with lengthy branch labels will be wrapped.By the help of @willmcgugan, I made this function to help you in making your custom tree:
It is handy when using
live.update(panel)
. If you are usingconsole.print(panel)
, then there is no need to use theunwrap_label
function since the parameters are already there.Here is a (useless) example for demonstration:
This is the output without using the
unwrap_label
function:And this is the output using the
unwrap_label
function:PS: Unfortunately, one style can be used which the one specified in the function (
'bold'
in this case); Markup cannot be used.Please share your thoughts to solve this problem
Beta Was this translation helpful? Give feedback.
All reactions