From a20b65a6c46a6a893181ecdadcc3c9d3107ff89b Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Tue, 1 Mar 2016 11:07:49 -0700 Subject: [PATCH 1/2] backport PR 5236 --- .../public/vislib/__tests__/visualizations/tile_maps/markers.js | 2 +- src/ui/public/vislib/visualizations/marker_types/heatmap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/public/vislib/__tests__/visualizations/tile_maps/markers.js b/src/ui/public/vislib/__tests__/visualizations/tile_maps/markers.js index 9bdcb96d8ec2e..86fe2edf38d34 100644 --- a/src/ui/public/vislib/__tests__/visualizations/tile_maps/markers.js +++ b/src/ui/public/vislib/__tests__/visualizations/tile_maps/markers.js @@ -301,7 +301,7 @@ describe('Marker Tests', function () { var arr = markerLayer._dataToHeatArray(max); var index = _.random(mapData.features.length - 1); var feature = mapData.features[index]; - var featureValue = parseInt(feature.properties.value / max * 100); + var featureValue = parseInt(feature.properties.value / max); var featureArr = feature.geometry.coordinates.slice(0).concat(featureValue); expect(arr[index]).to.eql(featureArr); }); diff --git a/src/ui/public/vislib/visualizations/marker_types/heatmap.js b/src/ui/public/vislib/visualizations/marker_types/heatmap.js index 2ce548f57c6cb..9aa3bc0105a12 100644 --- a/src/ui/public/vislib/visualizations/marker_types/heatmap.js +++ b/src/ui/public/vislib/visualizations/marker_types/heatmap.js @@ -199,7 +199,7 @@ define(function (require) { heatIntensity = feature.properties.value; } else { // show bucket value normalized to max value - heatIntensity = parseInt(feature.properties.value / max * 100); + heatIntensity = parseInt(feature.properties.value / max); } return [lat, lng, heatIntensity]; From 41b32cdaa1953396862ad7b566e4641f15f5e668 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Tue, 1 Mar 2016 11:25:45 -0700 Subject: [PATCH 2/2] remove use of parseInt --- .../public/vislib/__tests__/visualizations/tile_maps/markers.js | 2 +- src/ui/public/vislib/visualizations/marker_types/heatmap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/public/vislib/__tests__/visualizations/tile_maps/markers.js b/src/ui/public/vislib/__tests__/visualizations/tile_maps/markers.js index 86fe2edf38d34..a81ec200150bb 100644 --- a/src/ui/public/vislib/__tests__/visualizations/tile_maps/markers.js +++ b/src/ui/public/vislib/__tests__/visualizations/tile_maps/markers.js @@ -301,7 +301,7 @@ describe('Marker Tests', function () { var arr = markerLayer._dataToHeatArray(max); var index = _.random(mapData.features.length - 1); var feature = mapData.features[index]; - var featureValue = parseInt(feature.properties.value / max); + var featureValue = feature.properties.value / max; var featureArr = feature.geometry.coordinates.slice(0).concat(featureValue); expect(arr[index]).to.eql(featureArr); }); diff --git a/src/ui/public/vislib/visualizations/marker_types/heatmap.js b/src/ui/public/vislib/visualizations/marker_types/heatmap.js index 9aa3bc0105a12..343b817a1e119 100644 --- a/src/ui/public/vislib/visualizations/marker_types/heatmap.js +++ b/src/ui/public/vislib/visualizations/marker_types/heatmap.js @@ -199,7 +199,7 @@ define(function (require) { heatIntensity = feature.properties.value; } else { // show bucket value normalized to max value - heatIntensity = parseInt(feature.properties.value / max); + heatIntensity = feature.properties.value / max; } return [lat, lng, heatIntensity];