MCPcopy Index your code
hub / github.com/plotly/plotly.py / performRelayoutLike

Function performRelayoutLike

js/src/widget.ts:1759–1776  ·  view source on GitHub ↗

* Reform a Plotly.relayout like operation on an input object * * @param {Object} parentObj * The object that the relayout operation should be applied to * @param {Object} relayoutData * An relayout object as accepted by Plotly.relayout * * Examples: * var d = {foo {bar [5, 10]}}; *

(parentObj: any, relayoutData: any)

Source from the content-addressed store, hash-verified

1757 *
1758 */
1759function performRelayoutLike(parentObj: any, relayoutData: any) {
1760 // Perform a relayout style operation on a given parent object
1761 for (var rawKey in relayoutData) {
1762 if (!relayoutData.hasOwnProperty(rawKey)) {
1763 continue;
1764 }
1765
1766 // Extract value for this key
1767 var relayoutVal = relayoutData[rawKey];
1768
1769 // Set property value
1770 if (relayoutVal === null) {
1771 _.unset(parentObj, rawKey);
1772 } else {
1773 _.set(parentObj, rawKey, relayoutVal);
1774 }
1775 }
1776}
1777
1778/**
1779 * Perform a Plotly.restyle like operation on an input object array

Callers 3

do_relayoutMethod · 0.85
do_updateMethod · 0.85
do_animateMethod · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected