-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add tree component #460
base: master
Are you sure you want to change the base?
Add tree component #460
Conversation
Test Environment for snehilvj/dash-mantine-components-460 |
Hi @Godisemo Thanks so much for this PR! 🚀 Nice example app too. Here it is hosted on PyCafe I'll take a closer look in the next couple days and get back to you with more comments and feedback. In the meantime, since you obviously know a lot about both Mantine and Dash, I hope you don't mind if I ask you a question about an open item in an unrelated PR. (#458) that I'm working on right now:
|
Thank you @AnnMarieW , unfortunately I don't have experience in the part of dash related to your other PR. I updated this PR with the rest of the upstream mantine component properties as well as updated the example app in the first comment. Let me know if there is anything else that is needed when you have had time to look at it. |
A Tree component like this has been a popular request and will make a great addition to Dash. 🎉 When adding components to DMC, our goal is to be aligned as closely as possible with the features and prop names of the upstream Mantine component. It can be a little tricky to get this right. Let's take for example, the expanded feature: Here, the
However the Mantine Tree component. has the following:
And the following functions:
In the example app, if you click on a node with no children it toggles on and off the There are also similar features for the It would be great to get some feedback on the API, prop names etc from @alexcjohnson I think it's best to take a little time with the design now so we don't have breaking changes later. Update: @callback(
Output("tree", "expanded"),
Input("expand-all", "n_clicks"),
Input("collapse-all", "n_clicks")
)
def update(e,c):
if ctx.triggered_id == "expand-all":
return "*"
if ctx.triggered_id =="collapse-all":
return []
return dash.no_update
|
@Godisemo - quick update. Haven't forgotten about this PR. Just getting caught up after the holidays and will get back to this soon. Thanks for your patience 🙂 |
Add tree component.
Example app below