Skip to content

Commit de4ff4f

Browse files
committed
refactor heatmap convertColumnData
1 parent 2a4f20e commit de4ff4f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/traces/heatmap/convert_column_xyz.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,21 @@ module.exports = function convertColumnData(trace, ax1, ax2, var1Name, var2Name,
3030
var text;
3131
var hovertext;
3232

33+
var nI = col2vals.length;
34+
var nJ = col1vals.length;
35+
3336
for(i = 0; i < arrayVarNames.length; i++) {
34-
newArrays[i] = Lib.init2dArray(col2vals.length, col1vals.length);
37+
newArrays[i] = Lib.init2dArray(nI, nJ);
3538
}
3639

3740
if(hasColumnText) {
38-
text = Lib.init2dArray(col2vals.length, col1vals.length);
41+
text = Lib.init2dArray(nI, nJ);
3942
}
4043
if(hasColumnHoverText) {
41-
hovertext = Lib.init2dArray(col2vals.length, col1vals.length);
44+
hovertext = Lib.init2dArray(nI, nJ);
4245
}
4346

44-
var after2before = Lib.init2dArray(col2vals.length, col1vals.length);
47+
var after2before = Lib.init2dArray(nI, nJ);
4548

4649
for(i = 0; i < colLen; i++) {
4750
if(col1[i] !== BADNUM && col2[i] !== BADNUM) {

0 commit comments

Comments
 (0)