Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 016090a

Browse files
committed
Small modifications and cleanup to heatmap reorg
1 parent af9c983 commit 016090a

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/traces/heatmap/calc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var colorscaleCalc = require('../../components/colorscale/calc');
1818
var hasColumns = require('./has_columns');
1919
var convertColumnXYZ = require('./convert_column_xyz');
2020
var maxRowLength = require('./max_row_length');
21-
var cleanData = require('./clean_data');
21+
var clean2dArray = require('./clean_2d_array');
2222
var interp2d = require('./interp2d');
2323
var findEmpties = require('./find_empties');
2424
var makeBoundArray = require('./make_bound_array');
@@ -66,7 +66,7 @@ module.exports = function calc(gd, trace) {
6666
y0 = trace.y0 || 0;
6767
dy = trace.dy || 1;
6868

69-
z = cleanData(trace.z, trace.transpose);
69+
z = clean2dArray(trace.z, trace.transpose);
7070

7171
if(isContour || trace.connectgaps) {
7272
trace._emptypoints = findEmpties(z);

src/traces/heatmap/clean_data.js renamed to src/traces/heatmap/clean_2d_array.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
var isNumeric = require('fast-isnumeric');
1212

13-
module.exports = function cleanData(zOld, transpose) {
13+
module.exports = function clean2dArray(zOld, transpose) {
1414
var rowlen, collen, getCollen, old2new, i, j;
1515

1616
function cleanZvalue(v) {

src/traces/heatmap/find_empties.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010

1111
var maxRowLength = require('./max_row_length');
1212

13+
/* Return a list of empty points in 2D array z
14+
* each empty point z[i][j] gives an array [i, j, neighborCount]
15+
* neighborCount is the count of 4 nearest neighbors that DO exist
16+
* this is to give us an order of points to evaluate for interpolation.
17+
* if no neighbors exist, we iteratively look for neighbors that HAVE
18+
* neighbors, and add a fractional neighborCount
19+
*/
1320
module.exports = function findEmpties(z) {
14-
// return a list of empty points in 2D array z
15-
// each empty point z[i][j] gives an array [i, j, neighborCount]
16-
// neighborCount is the count of 4 nearest neighbors that DO exist
17-
// this is to give us an order of points to evaluate for interpolation.
18-
// if no neighbors exist, we iteratively look for neighbors that HAVE
19-
// neighbors, and add a fractional neighborCount
2021
var empties = [],
2122
neighborHash = {},
2223
noNeighborList = [],

0 commit comments

Comments
 (0)