allow Custom Wildcard
Is your feature request related to a problem? Please describe. I want to create my own custom _Wildcard class such that I don't have to rely on the pre-defined ones for cases where I need extra flexibility.
A use-case I keep coming up to is the following:
STARTSWITH = _Wildcard("STARTSWITH")
@app.callback(
Output({"type": "row", "index": STARTSWITH}, "hidden"),
[Input({"type": "collapse-button", "index": STARTSWITH}, "n_clicks")],
[State({"type": "row", "index": STARTSWITH}, "hidden")]
)
def callback(btn, rows)This is really just a way to identify a parent-children relationship (1-n) such that when clicking the parent button, the relevant children row components get retrieved at the same time. This is useful because components can't have the same ID and so not currently easy to do AFAIK.
Describe the solution you'd like I would like to be able to define a _Wildcard class with my own callable, which would essentially work as a custom comparator, to filter out Dash Components I don't need in a given callback.
Describe alternatives you've considered
- I tried using
ALLand thecontextsuch that I iterate through and update the changed components - this is extremely inefficient as the number of buttons grow (1k+) regardless of callback time complexity - page slows down to unusable levels. - I tried dynamically creating multiple specific callbacks at runtime (~5k) for each combination of components by wrapping a callable which can work on a singular piece of data at a time. This in combination with
prevent_initial_updateseems to alleviate the performance issues.
Source: plotly/dash