Skip to content

Commit 4ba0249

Browse files
committed
rename and document appendArrayMultiPointValues
1 parent e08e37a commit 4ba0249

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/components/fx/helpers.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ exports.quadrature = function quadrature(dx, dy) {
8989
*
9090
* @param {object} pointData : point data object (gets mutated here)
9191
* @param {object} trace : full trace object
92-
* @param {number} pointNumber : point number
92+
* @param {number|Array(number)} pointNumber : point number. May be a length-2 array
93+
* [row, col] to dig into 2D arrays
9394
*/
9495
exports.appendArrayPointValue = function(pointData, trace, pointNumber) {
9596
var arrayAttrs = trace._arrayAttrs;
@@ -111,7 +112,17 @@ exports.appendArrayPointValue = function(pointData, trace, pointNumber) {
111112
}
112113
};
113114

114-
exports.appendArrayPointValues = function(pointData, trace, pointNumbers) {
115+
/**
116+
* Appends values inside array attributes corresponding to given point number array
117+
* For use when pointData references a plot entity that arose (or potentially arose)
118+
* from multiple points in the input data
119+
*
120+
* @param {object} pointData : point data object (gets mutated here)
121+
* @param {object} trace : full trace object
122+
* @param {Array(number)|Array(Array(number))} pointNumbers : Array of point numbers.
123+
* Each entry in the array may itself be a length-2 array [row, col] to dig into 2D arrays
124+
*/
125+
exports.appendArrayMultiPointValues = function(pointData, trace, pointNumbers) {
115126
var arrayAttrs = trace._arrayAttrs;
116127

117128
if(!arrayAttrs) {

src/traces/pie/event_data.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

12-
var appendArrayPointValues = require('../../components/fx/helpers').appendArrayPointValues;
12+
var appendArrayMultiPointValues = require('../../components/fx/helpers').appendArrayMultiPointValues;
1313

1414

1515
// Note: like other eventData routines, this creates the data for hover/unhover/click events
@@ -35,7 +35,7 @@ module.exports = function eventData(pt, trace) {
3535
// Add extra data arrays to the output
3636
// notice that this is the multi-point version ('s' on the end!)
3737
// so added data will be arrays matching the pointNumbers array.
38-
appendArrayPointValues(out, trace, pt.pts);
38+
appendArrayMultiPointValues(out, trace, pt.pts);
3939

4040
return out;
4141
};

0 commit comments

Comments
 (0)