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

Function getWatchedKeys

dash/dash-renderer/src/actions/dependencies.js:1225–1249  ·  view source on GitHub ↗
(id, newProps, graphs)

Source from the content-addressed store, hash-verified

1223 * in one entry.
1224 */
1225export function getWatchedKeys(id, newProps, graphs) {
1226 if (!(id && graphs && newProps.length)) {
1227 return [];
1228 }
1229
1230 if (typeof id === 'string') {
1231 const inputs = graphs.inputMap[id];
1232 return inputs ? newProps.filter(newProp => inputs[newProp]) : [];
1233 }
1234
1235 const keys = Object.keys(id).sort();
1236 const vals = props(keys, id);
1237 const keyStr = keys.join(',');
1238 const keyPatterns = graphs.inputPatterns[keyStr];
1239 if (!keyPatterns) {
1240 return [];
1241 }
1242 return newProps.filter(prop => {
1243 const patterns = keyPatterns[prop];
1244 return (
1245 patterns &&
1246 patterns.some(pattern => idMatch(keys, vals, pattern.values))
1247 );
1248 });
1249}
1250
1251/*
1252 * Return a list of all callbacks referencing a chunk of the layout,

Callers 1

setPropsFunction · 0.90

Calls 4

idMatchFunction · 0.85
filterMethod · 0.80
keysMethod · 0.80
sortMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…