MCPcopy
hub / github.com/plotly/plotly.js / toggle

Function toggle

test/jasmine/tests/polar_test.js:390–404  ·  view source on GitHub ↗
(astr, vals, exps, selector, fn)

Source from the content-addressed store, hash-verified

388 }
389
390 function toggle(astr, vals, exps, selector, fn) {
391 return function() {
392 return Plotly.relayout(gd, astr, vals[0]).then(function() {
393 fn(selector, exps[0], astr + ' ' + vals[0]);
394 return Plotly.relayout(gd, astr, vals[1]);
395 })
396 .then(function() {
397 fn(selector, exps[1], astr + ' ' + vals[1]);
398 return Plotly.relayout(gd, astr, vals[0]);
399 })
400 .then(function() {
401 fn(selector, exps[0], astr + ' ' + vals[0]);
402 });
403 };
404 }
405
406 Plotly.newPlot(gd, fig)
407 .then(toggle(

Callers 1

polar_test.jsFile · 0.70

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…