@@ -1115,21 +1115,23 @@ Plotly.moveTraces = function moveTraces(gd, currentIndices, newIndices) {
1115
1115
* Can be called two ways.
1116
1116
*
1117
1117
* Signature 1:
1118
- * @param {string id or DOM element } gd
1118
+ * @param {String | HTMLDivElement } gd
1119
1119
* the id or DOM element of the graph container div
1120
- * @param {string } astr
1120
+ * @param {String } astr
1121
1121
* attribute string (like `'marker.symbol'`) to update
1122
- * @param {any } val
1122
+ * @param {* } val
1123
1123
* value to give this attribute
1124
- * @param {number or array } traces (optional)
1124
+ * @param {Number[] | Number } [ traces]
1125
1125
* integer or array of integers for the traces to alter (all if omitted)
1126
1126
*
1127
1127
* Signature 2:
1128
- * @param {string id or DOM element } gd (as in signature 1)
1129
- * @param {object } aobj
1128
+ * @param {String | HTMLDivElement } gd
1129
+ * (as in signature 1)
1130
+ * @param {Object } aobj
1130
1131
* attribute object `{astr1: val1, astr2: val2 ...}`
1131
1132
* allows setting multiple attributes simultaneously
1132
- * @param {number or array } traces (optional, as in signature 1)
1133
+ * @param {Number[] | Number } [traces]
1134
+ * (as in signature 1)
1133
1135
*
1134
1136
* `val` (or `val1`, `val2` ... in the object form) can be an array,
1135
1137
* to apply different values to each trace.
@@ -1142,11 +1144,11 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
1142
1144
helpers . clearPromiseQueue ( gd ) ;
1143
1145
1144
1146
var aobj = { } ;
1145
-
1146
1147
if ( typeof astr === 'string' ) aobj [ astr ] = val ;
1147
1148
else if ( Lib . isPlainObject ( astr ) ) {
1149
+ // the 3-arg form
1148
1150
aobj = astr ;
1149
- if ( traces === undefined ) traces = val ; // the 3-arg form
1151
+ if ( traces === undefined ) traces = val ;
1150
1152
}
1151
1153
else {
1152
1154
Lib . warn ( 'Restyle fail.' , astr , val , traces ) ;
@@ -1632,17 +1634,17 @@ function _restyle(gd, aobj, traces) {
1632
1634
* Can be called two ways:
1633
1635
*
1634
1636
* Signature 1:
1635
- * @param {string id or dom element } gd
1637
+ * @param {String | HTMLDivElement } gd
1636
1638
* the id or dom element of the graph container div
1637
- * @param {string } astr
1639
+ * @param {String } astr
1638
1640
* attribute string (like `'xaxis.range[0]'`) to update
1639
- * @param {any } val
1641
+ * @param {* } val
1640
1642
* value to give this attribute
1641
1643
*
1642
1644
* Signature 2:
1643
- * @param {string id or DOM element } gd (as in signature 1)
1644
- * the id or DOM element of the graph container div
1645
- * @param {object } aobj
1645
+ * @param {String | HTMLDivElement } gd
1646
+ * (as in signature 1)
1647
+ * @param {Object } aobj
1646
1648
* attribute object `{astr1: val1, astr2: val2 ...}`
1647
1649
* allows setting multiple attributes simultaneously
1648
1650
*/
@@ -2021,15 +2023,15 @@ function _relayout(gd, aobj) {
2021
2023
/**
2022
2024
* update: update trace and layout attributes of an existing plot
2023
2025
*
2024
- * @param {string id or DOM element } gd
2026
+ * @param {String | HTMLDivElement } gd
2025
2027
* the id or DOM element of the graph container div
2026
- * @param {object } traceUpdate
2028
+ * @param {Object } traceUpdate
2027
2029
* attribute object `{astr1: val1, astr2: val2 ...}`
2028
2030
* corresponding to updates in the plot's traces
2029
- * @param {object } layoutUpdate
2031
+ * @param {Object } layoutUpdate
2030
2032
* attribute object `{astr1: val1, astr2: val2 ...}`
2031
2033
* corresponding to updates in the plot's layout
2032
- * @param {number or array } traces (optional)
2034
+ * @param {Number[] | Number } [ traces]
2033
2035
* integer or array of integers for the traces to alter (all if omitted)
2034
2036
*
2035
2037
*/
0 commit comments