Skip to content

Commit

Permalink
Fixed overly broad event clustering. Re: elastic#854
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Jan 21, 2014
1 parent 93b6c69 commit 1f4d399
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/vendor/jquery/jquery.flot.events.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@
//TODO: support custom types
var groups, clusters = [], newEvents = [];


// split into same evenType groups
groups = _groupEvents(events);

Expand Down Expand Up @@ -539,11 +538,13 @@

// middle points
for (var i = 1; i < events.length; i++) {
var leftDiff = events[i].min - events[i - 1].min;
var leftDiff = events[i - 1].min - events[i].min;

density = leftDiff / space;

if (leftDiff > avg * sens && density > 0.05) {
var avgSens = avg * sens

if (leftDiff > avgSens && density > 0.05) {
clusters.push(cluster);
cluster = [ events[i] ];
} else {
Expand Down

0 comments on commit 1f4d399

Please sign in to comment.