Create a Dash app with one callback using ``component`` as Input.
(component, input_prop="value", output_id="out")
| 68 | |
| 69 | |
| 70 | def _app_with_callback(component, input_prop="value", output_id="out"): |
| 71 | """Create a Dash app with one callback using ``component`` as Input.""" |
| 72 | app = Dash(__name__) |
| 73 | app.layout = html.Div([component, html.Div(id=output_id)]) |
| 74 | |
| 75 | @app.callback(Output(output_id, "children"), Input(component.id, input_prop)) |
| 76 | def update(val): |
| 77 | return f"got: {val}" |
| 78 | |
| 79 | return _setup_mcp(app) |
| 80 | |
| 81 | |
| 82 | def _schema_for(tool, param_name=None): |
no test coverage detected
searching dependent graphs…