flot-plugins
Advanced tools
Comparing version 3.3.0 to 3.4.0
@@ -105,2 +105,3 @@ /* The MIT License | ||
var x, y; | ||
sDatapoints.points = []; | ||
for (var j = 0; j < sData.length; j++) { | ||
@@ -170,2 +171,3 @@ for (var i = 0; i < dataLen; i++) { | ||
plot.hooks.processRawData.push(processRawData); | ||
plot.hooks.findNearbyItems.push(findNearbyItems); | ||
@@ -520,2 +522,42 @@ opt = options; | ||
}; | ||
function findNearbyItems (plot, canvasX, canvasY, series, seriesIndex, radius, computeDistance, items) { | ||
var ps = series[seriesIndex].datapoints.pointsize; | ||
for (var j = 0; j < series[seriesIndex].data.length; j++) { | ||
for (var i = 0; i < dataLen; i++) { | ||
var x, y; | ||
if (isArrayOfObject) { | ||
x = series[seriesIndex].data[j][i].x; | ||
y = series[seriesIndex].data[j][i].y; | ||
} else if (isObjectOfArray) { | ||
x = series[seriesIndex].data[j].x[i]; | ||
y = series[seriesIndex].data[j].y[i]; | ||
} else if (isArrayOfArray) { | ||
x = series[seriesIndex].data[j][i][0]; | ||
y = series[seriesIndex].data[j][i][1]; | ||
} | ||
var px = series[seriesIndex].xaxis.p2c(x); | ||
var deltaX = px - canvasX; | ||
var py = series[seriesIndex].yaxis.p2c(y); | ||
var deltaY = py - canvasY; | ||
var distance; | ||
if (computeDistance) { | ||
distance = computeDistance(deltaX, deltaY); | ||
} else { | ||
distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); | ||
} | ||
if (distance < radius) { | ||
items.push({ | ||
datapoint: series[seriesIndex].datapoints.points.slice(i * ps, (i + 1) * ps), | ||
dataIndex: i, | ||
series: series[seriesIndex], | ||
seriesIndex: seriesIndex, | ||
distance: distance | ||
}); | ||
} | ||
} | ||
} | ||
}; | ||
}; | ||
@@ -522,0 +564,0 @@ }; |
{ | ||
"name": "flot-plugins", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "A collection of plug-ins for flot charts", | ||
@@ -57,3 +57,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"flot": "^3.2.9", | ||
"flot": "^4.1.0", | ||
"jquery": "^3.1.0", | ||
@@ -60,0 +60,0 @@ "ni-data-types": "^1.0.5" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6116581
159
20210
+ Addedflot@4.2.6(transitive)
- Removedflot@3.2.13(transitive)
Updatedflot@^4.1.0