{"action":"created","issue":{"url":"https://api.github.com/repos/kronick/HexgridHeatmap/issues/1","repository_url":"https://api.github.com/repos/kronick/HexgridHeatmap","labels_url":"https://api.github.com/repos/kronick/HexgridHeatmap/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/kronick/HexgridHeatmap/issues/1/comments","events_url":"https://api.github.com/repos/kronick/HexgridHeatmap/issues/1/events","html_url":"https://github.com/kronick/HexgridHeatmap/issues/1","id":248222237,"number":1,"title":"Heatmap based on values instead density","user":{"login":"ktugan","id":266548,"avatar_url":"https://avatars3.githubusercontent.com/u/266548?v=4","gravatar_id":"","url":"https://api.github.com/users/ktugan","html_url":"https://github.com/ktugan","followers_url":"https://api.github.com/users/ktugan/followers","following_url":"https://api.github.com/users/ktugan/following{/other_user}","gists_url":"https://api.github.com/users/ktugan/gists{/gist_id}","starred_url":"https://api.github.com/users/ktugan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktugan/subscriptions","organizations_url":"https://api.github.com/users/ktugan/orgs","repos_url":"https://api.github.com/users/ktugan/repos","events_url":"https://api.github.com/users/ktugan/events{/privacy}","received_events_url":"https://api.github.com/users/ktugan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-06T03:02:53Z","updated_at":"2017-08-07T16:10:00Z","closed_at":null,"body":"I love the library and would like to make a feature request to build a heatmap from values. Here a superior argument from somebody else (from https://github.com/mapbox/mapbox-gl-js/issues/4756):\r\n\r\n> by default, heatmaps render according to point density (so two points in the same spot are twice as intense as one). But there are cases where we want a different behavior — imagine an air pollution map that shows measurements from spots around the country. Multiple measure points clustered close together shouldn't cause the area to appear many times more polluted compared to an area with the same pollution but only one measure spot.[...]\r\n\r\n\r\nI can imagine it would work like this:\r\n```\r\n    var heatmap = new HexgridHeatmap(map, \"hexgrid-heatmap\", \"waterway-label\");\r\n    heatmap.setType('value'); // or 'density' which is default\r\n    heatmap.setWeightProperty('airPollutionLevel'); // a property in each Feature of the FeatureCollection\r\n    heatmap.setReduceFunction('mean'); // 'median' or even a function which accepts values\r\n\r\n    //normal init from before\r\n    heatmap.setIntensity(6);\r\n    heatmap.setSpread(0.15); //\r\n    heatmap.setCellDensity(0.5); // small value == bigger hexagons\r\n    heatmap.setData(berlinData);\r\n    heatmap.update();\r\n```\r\n\r\nI assume clustering logic would need little or no changing, but instead of counting all objects are iterated through, the value from the property extracted and the reduce function called.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kronick/HexgridHeatmap/issues/comments/320707637","html_url":"https://github.com/kronick/HexgridHeatmap/issues/1#issuecomment-320707637","issue_url":"https://api.github.com/repos/kronick/HexgridHeatmap/issues/1","id":320707637,"user":{"login":"ktugan","id":266548,"avatar_url":"https://avatars3.githubusercontent.com/u/266548?v=4","gravatar_id":"","url":"https://api.github.com/users/ktugan","html_url":"https://github.com/ktugan","followers_url":"https://api.github.com/users/ktugan/followers","following_url":"https://api.github.com/users/ktugan/following{/other_user}","gists_url":"https://api.github.com/users/ktugan/gists{/gist_id}","starred_url":"https://api.github.com/users/ktugan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktugan/subscriptions","organizations_url":"https://api.github.com/users/ktugan/orgs","repos_url":"https://api.github.com/users/ktugan/repos","events_url":"https://api.github.com/users/ktugan/events{/privacy}","received_events_url":"https://api.github.com/users/ktugan/received_events","type":"User","site_admin":false},"created_at":"2017-08-07T16:10:00Z","updated_at":"2017-08-07T16:10:00Z","body":"I implemented my own version of a value based heatmap in a fork without any regards for keeping any guidelines (since I am not familiar with the javascript ecosystem).\r\n\r\nhere the diff: https://github.com/ktugan/HexgridHeatmap/commit/7cfa0ec222f72c4abe30c3c74223bbcb0079c615"}}
{"actor":{"display_login":"ktugan"}}