MCPcopy Index your code
hub / github.com/plotly/plotly.js / storeCurrent

Function storeCurrent

src/plot_api/plot_api.js:1335–1353  ·  view source on GitHub ↗
(attr, val, newVal, preGUI)

Source from the content-addressed store, hash-verified

1333}
1334
1335function storeCurrent(attr, val, newVal, preGUI) {
1336 if (Array.isArray(val) || Array.isArray(newVal)) {
1337 var arrayVal = Array.isArray(val) ? val : [];
1338 var arrayNew = Array.isArray(newVal) ? newVal : [];
1339 var maxLen = Math.max(arrayVal.length, arrayNew.length);
1340 for (var i = 0; i < maxLen; i++) {
1341 storeCurrent(attr + '[' + i + ']', arrayVal[i], arrayNew[i], preGUI);
1342 }
1343 } else if (Lib.isPlainObject(val) || Lib.isPlainObject(newVal)) {
1344 var objVal = Lib.isPlainObject(val) ? val : {};
1345 var objNew = Lib.isPlainObject(newVal) ? newVal : {};
1346 var objBoth = Lib.extendFlat({}, objVal, objNew);
1347 for (var key in objBoth) {
1348 storeCurrent(attr + '.' + key, objVal[key], objNew[key], preGUI);
1349 }
1350 } else if (preGUI[attr] === undefined) {
1351 preGUI[attr] = undefinedToNull(val);
1352 }
1353}
1354
1355/**
1356 * storeDirectGUIEdit: for routines that skip restyle/relayout and mock it

Callers 2

makeNPFunction · 0.85
_storeDirectGUIEditFunction · 0.85

Calls 1

undefinedToNullFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…