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

Function getPriority

dash/dash-renderer/src/actions/dependencies_ts.ts:107–154  ·  view source on GitHub ↗
(
    graphs: any,
    paths: any,
    callback: ICallback
)

Source from the content-addressed store, hash-verified

105 * to create a sortable priority hash.
106 */
107export function getPriority(
108 graphs: any,
109 paths: any,
110 callback: ICallback
111): string {
112 let callbacks: ICallback[] = [callback];
113 const touchedOutputs: {[key: string]: boolean} = {};
114 const touchedCbIds: {[key: string]: boolean} = {};
115 const priority: number[] = [];
116
117 while (callbacks.length) {
118 callbacks = filter(c => {
119 const touched = touchedCbIds[c.resolvedId];
120 touchedCbIds[c.resolvedId] = true;
121 return touched;
122 }, callbacks);
123
124 const outputs = filter(
125 o => !touchedOutputs[combineIdAndProp(o)],
126 flatten(map(cb => flatten(cb.getOutputs(paths)), callbacks))
127 );
128
129 outputs.forEach(o => (touchedOutputs[combineIdAndProp(o)] = true));
130
131 callbacks = flatten(
132 map(
133 ({id, property}: any) =>
134 getCallbacksByInput(
135 graphs,
136 paths,
137 id,
138 property,
139 INDIRECT,
140 false
141 ),
142 outputs
143 )
144 );
145
146 if (callbacks.length) {
147 priority.push(callbacks.length);
148 }
149 }
150
151 priority.unshift(priority.length);
152
153 return map(i => Math.min(i, 35).toString(36), priority).join('');
154}
155
156export function getAllSubsequentOutputsForCallback(
157 graphs: any,

Callers 2

getCallbacksByInputFunction · 0.85

Calls 4

combineIdAndPropFunction · 0.85
getCallbacksByInputFunction · 0.85
pushMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…