Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
pa7 committed Sep 5, 2016
1 parent 0d954fd commit 85ba352
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
26 changes: 19 additions & 7 deletions build/heatmap.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* heatmap.js v2.0.2 | JavaScript Heatmap Library
* heatmap.js v2.0.5 | JavaScript Heatmap Library
*
* Copyright 2008-2016 Patrick Wied <heatmapjs@patrick-wied.at> - All rights reserved.
* Dual licensed under MIT and Beerware license
*
* :: 2016-02-04 21:25
* :: 2016-09-05 01:16
*/
;(function (name, context, factory) {

Expand Down Expand Up @@ -38,7 +38,7 @@ var Store = (function StoreClosure() {
this._coordinator = {};
this._data = [];
this._radi = [];
this._min = 0;
this._min = 10;
this._max = 1;
this._xField = config['xField'] || config.defaultXField;
this._yField = config['yField'] || config.defaultYField;
Expand Down Expand Up @@ -74,15 +74,23 @@ var Store = (function StoreClosure() {
} else {
store[x][y] += value;
}
var storedVal = store[x][y];

if (store[x][y] > max) {
if (storedVal > max) {
if (!forceRender) {
this._max = store[x][y];
this._max = storedVal;
} else {
this.setDataMax(store[x][y]);
this.setDataMax(storedVal);
}
return false;
} else{
} else if (storedVal < min) {
if (!forceRender) {
this._min = storedVal;
} else {
this.setDataMin(storedVal);
}
return false;
} else {
return {
x: x,
y: y,
Expand Down Expand Up @@ -133,6 +141,10 @@ var Store = (function StoreClosure() {
// add to store
var organisedEntry = this._organiseData(arguments[0], true);
if (organisedEntry) {
// if it's the first datapoint initialize the extremas with it
if (this._data.length === 0) {
this._min = this._max = organisedEntry.value;
}
this._coordinator.emit('renderpartial', {
min: this._min,
max: this._max,
Expand Down
Loading

0 comments on commit 85ba352

Please sign in to comment.