MCPcopy Index your code
hub / github.com/plotly/dash / args_grouping

Method args_grouping

dash/_callback_context.py:142–167  ·  view source on GitHub ↗

args_grouping is a dict of the inputs used with flexible callback signatures. The keys are the variable names and the values are dictionaries containing: - “id”: (string or dict) the component id. If it’s a pattern matching id, it will be a dict. - “id_str”: (str) fo

(self)

Source from the content-addressed store, hash-verified

140 @property
141 @has_context
142 def args_grouping(self):
143 """
144 args_grouping is a dict of the inputs used with flexible callback signatures. The keys are the variable names
145 and the values are dictionaries containing:
146 - “id”: (string or dict) the component id. If it’s a pattern matching id, it will be a dict.
147 - “id_str”: (str) for pattern matching ids, it’s the stringified dict id with no white spaces.
148 - “property”: (str) The component property used in the callback.
149 - “value”: the value of the component property at the time the callback was fired.
150 - “triggered”: (bool)Whether this input triggered the callback.
151
152 Example usage:
153 @app.callback(
154 Output("container", "children"),
155 inputs=dict(btn1=Input("btn-1", "n_clicks"), btn2=Input("btn-2", "n_clicks")),
156 )
157 def display(btn1, btn2):
158 c = ctx.args_grouping
159 if c.btn1.triggered:
160 return f"Button 1 clicked {btn1} times"
161 elif c.btn2.triggered:
162 return f"Button 2 clicked {btn2} times"
163 else:
164 return "No clicks yet"
165
166 """
167 return getattr(_get_context_value(), "args_grouping", [])
168
169 @property
170 @has_context

Callers

nothing calls this directly

Calls 1

_get_context_valueFunction · 0.85

Tested by

no test coverage detected