MCPcopy
hub / github.com/plotly/dash / updateComponent

Function updateComponent

dash/dash-renderer/src/actions/callbacks.ts:355–387  ·  view source on GitHub ↗
(component_id: any, props: any, cb: ICallbackPayload)

Source from the content-addressed store, hash-verified

353}
354
355function updateComponent(component_id: any, props: any, cb: ICallbackPayload) {
356 return function (dispatch: any, getState: any) {
357 const {paths, config} = getState();
358 const componentPath = getPath(paths, component_id);
359 if (!componentPath) {
360 if (!config.suppress_callback_exceptions) {
361 dispatchError(dispatch)(
362 'ID running component not found in layout',
363 [
364 'Component defined in running keyword not found in layout.',
365 `Component id: "${stringifyId(component_id)}"`,
366 'This ID was used in the callback(s) for Output(s):',
367 `${cb.output}`,
368 'You can suppress this exception by setting',
369 '`suppress_callback_exceptions=True`.'
370 ]
371 );
372 }
373 // We need to stop further processing because functions further on
374 // can't operate on an 'undefined' object, and they will throw an
375 // error.
376 return;
377 }
378 dispatch(
379 updateProps({
380 props,
381 itempath: componentPath,
382 renderType: 'callback'
383 })
384 );
385 dispatch(notifyObservers({id: component_id, props}));
386 };
387}
388
389/**
390 * Update a component props with `running`/`progress`/`set_props` calls.

Callers 1

sideUpdateFunction · 0.85

Calls 6

getPathFunction · 0.90
stringifyIdFunction · 0.90
updatePropsFunction · 0.90
notifyObserversFunction · 0.90
getStateFunction · 0.85
dispatchErrorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…