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

Function makeNP

src/plot_api/plot_api.js:1320–1333  ·  view source on GitHub ↗

* Factory function to wrap nestedProperty with GUI edits if necessary * with GUI edits we add an optional prefix to the nestedProperty constructor * to prepend to the attribute string in the preGUI store.

(preGUI, guiEditFlag)

Source from the content-addressed store, hash-verified

1318 * to prepend to the attribute string in the preGUI store.
1319 */
1320function makeNP(preGUI, guiEditFlag) {
1321 if (!guiEditFlag) return nestedProperty;
1322
1323 return function (container, attr, prefix) {
1324 var np = nestedProperty(container, attr);
1325 var npSet = np.set;
1326 np.set = function (val) {
1327 var fullAttr = (prefix || '') + attr;
1328 storeCurrent(fullAttr, np.get(), val, preGUI);
1329 npSet(val);
1330 };
1331 return np;
1332 };
1333}
1334
1335function storeCurrent(attr, val, newVal, preGUI) {
1336 if (Array.isArray(val) || Array.isArray(newVal)) {

Callers 3

_restyleFunction · 0.85
doextraFunction · 0.85
_relayoutFunction · 0.85

Calls 2

storeCurrentFunction · 0.85
npSetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…