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

Function __execute

dash/dash-renderer/src/actions/callbacks.ts:932–1158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

930 }
931
932 const __execute = async (): Promise<CallbackResult> => {
933 const loadingOutputs = flatten(outputs).map(out => ({
934 path: getPath(paths, out.id),
935 property: out.property?.split('@')[0],
936 id: stringifyId(out.id)
937 }));
938 dispatch(loading(loadingOutputs));
939 try {
940 const changedPropIds = keys<string>(cb.changedPropIds);
941 const parsedChangedPropsIds = changedPropIds.map(propId => {
942 if (propId.startsWith('{')) {
943 return parsePMCId(propId)[0];
944 }
945 return propId;
946 });
947 const payload: ICallbackPayload = {
948 output,
949 outputs: isMultiOutputProp(output) ? outputs : outputs[0],
950 inputs: inVals,
951 changedPropIds,
952 parsedChangedPropsIds,
953 state: cb.callback.state.length
954 ? fillVals(paths, layout, cb, state, 'State')
955 : undefined
956 };
957
958 if (clientside_function) {
959 try {
960 let data = await handleClientside(
961 dispatch,
962 clientside_function,
963 config,
964 payload
965 );
966 // Patch methodology: always run through parsePatchProps for each output
967 const currentLayout = getState().layout;
968 flatten(outputs).forEach((out: any) => {
969 const propName = cleanOutputProp(out.property);
970 const outputPath = getPath(paths, out.id);
971 const dataPath = [stringifyId(out.id), propName];
972 const outputValue = path(dataPath, data);
973 if (outputValue === undefined) {
974 return;
975 }
976 const oldProps =
977 path(
978 outputPath.concat(['props']),
979 currentLayout
980 ) || {};
981 const newProps = parsePatchProps(
982 {[propName]: outputValue},
983 oldProps
984 );
985 data = assocPath(
986 dataPath,
987 newProps[propName],
988 data
989 );

Callers 1

executeCallbackFunction · 0.85

Calls 15

getPathFunction · 0.90
stringifyIdFunction · 0.90
loadingFunction · 0.90
parsePMCIdFunction · 0.90
isMultiOutputPropFunction · 0.90
parsePatchPropsFunction · 0.90
isWebSocketEnabledFunction · 0.90
isWebSocketAvailableFunction · 0.90
requestDependenciesFunction · 0.90
fillValsFunction · 0.85
handleClientsideFunction · 0.85
getStateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…