diff --git a/_posts/reference_pages/2016-06-03-plotly_js_function_ref.html b/_posts/reference_pages/2016-06-03-plotly_js_function_ref.html index 998fff66b9d8..2fa4fc566f0b 100644 --- a/_posts/reference_pages/2016-06-03-plotly_js_function_ref.html +++ b/_posts/reference_pages/2016-06-03-plotly_js_function_ref.html @@ -156,6 +156,18 @@

Plotly.restyle

See the Pen Plotly.restyle Attribute strings by plotly (@plotly) on CodePen.

+Finally, you may wish to selectively reset or ignore certain properties when restyling. This may be useful when specifying multiple properties for multiple traces so that you can carefully target what is and is not affected. In general `null` resets a property to the default while `undefined` applies no change to the current state. + +

+// Set the first trace's line to red, the second to the default, and ignore the third
+Plotly.restyle(graphDiv, {
+  'line.color': ['red', null, undefined]
+}, [0, 1, 2])
+
+ +

See the Pen null vs. undefined in Plotly.restyle by plotly (@plotly) on CodePen.

+ +

Plotly.relayout

A more efficient means of updating just the layout in a graphDiv. The call signature and arguments for relayout are similar (but simpler) to restyle. Because there are no indices to deal with, arrays need not be wrapped. Also, no argument specifying applicable trace indices is passed in.