Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ability to scale Tilemap heatmap intensity values #6014

Closed
wants to merge 24 commits into from

Conversation

stormpython
Copy link
Contributor

Closes #5946.

At times, data displayed in Tile maps needs to be log transformed in order to properly visualize the results. For a better explanation on this, please read the comments on issue #5946.

The pull requests adds the ability to scale heatmap intensity values using either a linear (default), logarithmic (base 10), or square root scale.

Please Note: With log transformed data, all data points must be greater than or equal to 1 as the log(0) is -Infinity and the log(negative number) is NaN. Also, see here.

This pull accomplishes creating scales using d3 quantitative scales. For more info on the API, please see the documentation.

@trevan
Copy link
Contributor

trevan commented Jan 26, 2016

Make sure the heatIntensity is between 0 and 1 as that is the scale that Leaflet.heat uses. #5236 has more information.

@stormpython
Copy link
Contributor Author

@trevan thanks. Will make that correction right now.

@stormpython
Copy link
Contributor Author

Thanks to @trevan's comments regarding heatIntensity value needing to be between 0 and 1, I have removed the previous logic which results in heatIntensity values greater than 1. From now on, all metric values are normalized to a range between 0 (inclusive) and 1 (inclusive). The tests have also been changed to reflect this.

@epixa
Copy link
Contributor

epixa commented Feb 8, 2016

This needs to be rebased on master or have master merged into it.

* @param max {Number}
* @return {Array}
*/
HeatmapMarker.prototype._dataToHeatArray = function (max) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The max value is no longer being used, and can be removed

@epixa
Copy link
Contributor

epixa commented Mar 1, 2016

This has conflicts again

@stormpython
Copy link
Contributor Author

Yeah, I am working on fixing these.

@stormpython
Copy link
Contributor Author

jenkins, test it.

@stormpython
Copy link
Contributor Author

@jbudz passing this back to you.

@@ -18,7 +18,7 @@ var bounds = {};
var MarkerType;
var map;

angular.module('MarkerFactory', ['kibana']);
// angular.module('MarkerFactory', ['kibana']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove this line?

@jbudz
Copy link
Member

jbudz commented Mar 28, 2016

LGTM

@jbudz jbudz assigned stormpython and unassigned jbudz Mar 28, 2016
@stormpython
Copy link
Contributor Author

jenkins, test it

@stormpython
Copy link
Contributor Author

Failure due to a breaking change in elasticsearch master.

@stormpython stormpython assigned w33ble and unassigned stormpython Mar 29, 2016
@stormpython
Copy link
Contributor Author

@w33ble would you mind being the second reviewer here?

@w33ble
Copy link
Contributor

w33ble commented Mar 29, 2016

@stormpython this looks fine, the changes are pretty small and the values that come out seem correct. My dataset doesn't look any different with different scales though... do you have an example or use case or something where I can see the varying results?

@stormpython
Copy link
Contributor Author

@tbragin would you mind checking out this PR? I figure you have an appropriate dataset which needs a log scale for visualizing heat intensities. Its really hard to test the difference without an appropriate dataset.

@stormpython stormpython assigned tbragin and unassigned w33ble Mar 29, 2016
@tbragin
Copy link
Contributor

tbragin commented Apr 1, 2016

I tried it on a dataset that has some variability in concentration. I don't see any effect - screenshots below. I shared my dataset with @stormpython so he can play with it some more.
screen shot 2016-04-01 at 1 33 26 pm
screen shot 2016-04-01 at 1 33 38 pm

@tbragin tbragin assigned stormpython and unassigned tbragin Apr 1, 2016
@stormpython
Copy link
Contributor Author

Thanks @tbragin

@panda01 panda01 self-assigned this May 11, 2016
@tbragin tbragin added the Feature:Visualizations Generic visualization features (in case no more specific feature label is available) label Nov 12, 2016
@thomasneirynck
Copy link
Contributor

The current heatmap has issues beyond this, e.g. #8763. Heatmaps already just give only a rough approximation of the underlying quantities of the data points. Rescaling the inputs only compounds possible mispreresentation. To avoid single-color blobs, the intensity of the heatmap should be under the control of the user, but not sure if we should do this by skewing the underlying values.

I will close this for now. We're looking at an overhaul of the mapping visualizations and can pick up #5946 in that context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) help wanted adoptme updates_needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants