Closed BeastyBlacksmith closed 1 year ago
Hi @BeastyBlacksmith - nice to see someone making a feature PR to Dash.jl !
Does the python version of dash expose something similar from its public API or its testing API?
If so, I think we could safely merge your PR.
If not, I (not a Plotly employee, I'm just a Dash.jl user with write rights to this repo) wouldn't be comfortable making the Dash.jl API diverge from the python version of dash.
I don't think it gets a lot of use, but Python Dash does allow you to find components within any component tree by ID:
>>> from dash import html
>>> container = html.Div([html.Div(id="a"), html.Div(id="b")])
>>> container['a']
Div(id='a')
It's a little funny to me that what you have here is app[id]
though, would it make sense to change to app.layout[id]
?
It's a little funny to me that what you have here is
app[id]
though, would it make sense to change toapp.layout[id]
?
They work both
bump.
They work both
Should I add a test for this?
Hi @BeastyBlacksmith, if you were to remove the Base.getindex(app::Dash.DashApp, id::AbstractString)
method while keeping functionally for app.layout[id]
, I could merge this PR and include it into Dash.jl v1.3.0 that I'd like to release at some point this week.
I don't think it does any harm, but I removed it.
Thanks for the PR @BeastyBlacksmith - merging !
This adds the ability to index into
DashApp
,Components
and collections ofComponents
by id. LikeThis is mainly useful for testing purposes and a convenience feature.