Skip to content

Commit 85ba352

Browse files
committed
Update build
1 parent 0d954fd commit 85ba352

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

Diff for: build/heatmap.js

+19-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
2-
* heatmap.js v2.0.2 | JavaScript Heatmap Library
2+
* heatmap.js v2.0.5 | JavaScript Heatmap Library
33
*
44
* Copyright 2008-2016 Patrick Wied <[email protected]> - All rights reserved.
55
* Dual licensed under MIT and Beerware license
66
*
7-
* :: 2016-02-04 21:25
7+
* :: 2016-09-05 01:16
88
*/
99
;(function (name, context, factory) {
1010

@@ -38,7 +38,7 @@ var Store = (function StoreClosure() {
3838
this._coordinator = {};
3939
this._data = [];
4040
this._radi = [];
41-
this._min = 0;
41+
this._min = 10;
4242
this._max = 1;
4343
this._xField = config['xField'] || config.defaultXField;
4444
this._yField = config['yField'] || config.defaultYField;
@@ -74,15 +74,23 @@ var Store = (function StoreClosure() {
7474
} else {
7575
store[x][y] += value;
7676
}
77+
var storedVal = store[x][y];
7778

78-
if (store[x][y] > max) {
79+
if (storedVal > max) {
7980
if (!forceRender) {
80-
this._max = store[x][y];
81+
this._max = storedVal;
8182
} else {
82-
this.setDataMax(store[x][y]);
83+
this.setDataMax(storedVal);
8384
}
8485
return false;
85-
} else{
86+
} else if (storedVal < min) {
87+
if (!forceRender) {
88+
this._min = storedVal;
89+
} else {
90+
this.setDataMin(storedVal);
91+
}
92+
return false;
93+
} else {
8694
return {
8795
x: x,
8896
y: y,
@@ -133,6 +141,10 @@ var Store = (function StoreClosure() {
133141
// add to store
134142
var organisedEntry = this._organiseData(arguments[0], true);
135143
if (organisedEntry) {
144+
// if it's the first datapoint initialize the extremas with it
145+
if (this._data.length === 0) {
146+
this._min = this._max = organisedEntry.value;
147+
}
136148
this._coordinator.emit('renderpartial', {
137149
min: this._min,
138150
max: this._max,

0 commit comments

Comments
 (0)