{"action":"created","comment":{"url":"https://api.github.com/repos/onaio/hatti/pulls/comments/90634105","pull_request_review_id":11152871,"id":90634105,"diff_hunk":"@@ -489,6 +475,85 @@\n                    :on-click (click-fn #(om/update! geofield field))}]\n                  (get-label field) [:br]])]]]))))))\n \n+(defn map-hexbin-selector\n+  [{{{:keys [show?]} :hexbins} :map-page :as cursor} owner]\n+  (reify\n+    om/IRenderState\n+    (render-state [_ _]\n+      \"Render hexbin selector component w/css + expansion technique from\n+      leaflet layer control.\"\n+      (html\n+       [:div.leaflet-left.leaflet-bottom.hexbin-selector\n+        [:div.leaflet-control.leaflet-control-layers\n+         [:a\n+          {:title \"Hexbins Layer\"\n+           :class (str \"hexbin-layer-toggle\" (when show? \" active\"))\n+           :on-click\n+           (click-fn\n+            #(om/update! cursor\n+                         [:map-page :hexbins :show?] (not show?)))}]]]))))\n+\n+(defn map-hexbin-slider\n+  [{{{:keys [show? cell-width hide-points?]} :hexbins} :map-page :as cursor}\n+   owner]\n+  (reify\n+    om/IInitState\n+    (init-state [_]\n+      {:slider-value 0\n+       :zoom->bin? true\n+       :value->size {0 500 1 250 2 100 3 50 4 25 5 10 6 5 7 1 8 0.5}})\n+    om/IWillReceiveProps\n+    (will-receive-props [_ next-props]\n+      (when (om/get-state owner :zoom->bin?)\n+        (when-let [map (-> next-props :map-page :mapboxgl-map)]\n+          (let [zoom (.getZoom map)\n+                value (cond\n+                        (<= 0 zoom 2) 0\n+                        (<= 3 zoom 5) 1\n+                        (<= 6 zoom 8) 2\n+                        (<= 9 zoom 11) 3\n+                        (<= 12 zoom 14) 4\n+                        (<= 15 zoom 17) 5\n+                        (<= 18 zoom 20) 6)]\n+            (om/set-state! owner :slider-value value)))))\n+    om/IWillUpdate\n+    (will-update [_ _ {:keys [slider-value value->size]}]\n+      (om/update! cursor [:map-page :hexbins :cell-width]\n+                  (get value->size slider-value)))\n+    om/IRenderState\n+    (render-state [_ {:keys [slider-value value->size]}]\n+      \"Render layer selector component w/css + expansion technique from\n+      leaflet layer control.\"\n+      (html\n+       (when show?\n+         (let [cell-size (or cell-width (get value->size slider-value))\n+               update-cell-width (fn [e]\n+                                   (let\n+                                    [v (js/parseInt (.. e -target -value))]\n+                                     (om/update-state!\n+                                      owner #(assoc % :zoom->bin? false\n+                                                    :slider-value v))))\n+               below-1km? (> 1 cell-size)]\n+           [:div.map-overlay.mapboxgl-ctrl-bottom-left\n+            [:div.map-overlay-inner\n+             [:label.slider \"Cell Width: \"\n+              [:span#slider-value (str (if below-1km?","path":"src/hatti/views/map.cljs","position":248,"original_position":248,"commit_id":"eca9a0f0365bc75aafb9e9d189438303d8210107","original_commit_id":"eca9a0f0365bc75aafb9e9d189438303d8210107","user":{"login":"pld","id":50706,"avatar_url":"https://avatars.githubusercontent.com/u/50706?v=3","gravatar_id":"","url":"https://api.github.com/users/pld","html_url":"https://github.com/pld","followers_url":"https://api.github.com/users/pld/followers","following_url":"https://api.github.com/users/pld/following{/other_user}","gists_url":"https://api.github.com/users/pld/gists{/gist_id}","starred_url":"https://api.github.com/users/pld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pld/subscriptions","organizations_url":"https://api.github.com/users/pld/orgs","repos_url":"https://api.github.com/users/pld/repos","events_url":"https://api.github.com/users/pld/events{/privacy}","received_events_url":"https://api.github.com/users/pld/received_events","type":"User","site_admin":false},"body":"why not always convert to meters?","created_at":"2016-12-02T12:30:53Z","updated_at":"2016-12-02T12:30:53Z","html_url":"https://github.com/onaio/hatti/pull/174#discussion_r90634105","pull_request_url":"https://api.github.com/repos/onaio/hatti/pulls/174","_links":{"self":{"href":"https://api.github.com/repos/onaio/hatti/pulls/comments/90634105"},"html":{"href":"https://github.com/onaio/hatti/pull/174#discussion_r90634105"},"pull_request":{"href":"https://api.github.com/repos/onaio/hatti/pulls/174"}}},"pull_request":{"url":"https://api.github.com/repos/onaio/hatti/pulls/174","id":95295517,"html_url":"https://github.com/onaio/hatti/pull/174","diff_url":"https://github.com/onaio/hatti/pull/174.diff","patch_url":"https://github.com/onaio/hatti/pull/174.patch","issue_url":"https://api.github.com/repos/onaio/hatti/issues/174","number":174,"state":"open","locked":false,"title":"Hexbins","user":{"login":"royrutto","id":1002419,"avatar_url":"https://avatars.githubusercontent.com/u/1002419?v=3","gravatar_id":"","url":"https://api.github.com/users/royrutto","html_url":"https://github.com/royrutto","followers_url":"https://api.github.com/users/royrutto/followers","following_url":"https://api.github.com/users/royrutto/following{/other_user}","gists_url":"https://api.github.com/users/royrutto/gists{/gist_id}","starred_url":"https://api.github.com/users/royrutto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/royrutto/subscriptions","organizations_url":"https://api.github.com/users/royrutto/orgs","repos_url":"https://api.github.com/users/royrutto/repos","events_url":"https://api.github.com/users/royrutto/events{/privacy}","received_events_url":"https://api.github.com/users/royrutto/received_events","type":"User","site_admin":false},"body":"*TODO*\r\n- [x] Bin highlighted points on view-by\r\n- [x] Change Bin size on zoom\r\n- [ ] Add tests\r\n","created_at":"2016-11-25T12:14:03Z","updated_at":"2016-12-02T12:30:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10aed812d19c549d45876027714d9850af9b0307","assignee":{"login":"royrutto","id":1002419,"avatar_url":"https://avatars.githubusercontent.com/u/1002419?v=3","gravatar_id":"","url":"https://api.github.com/users/royrutto","html_url":"https://github.com/royrutto","followers_url":"https://api.github.com/users/royrutto/followers","following_url":"https://api.github.com/users/royrutto/following{/other_user}","gists_url":"https://api.github.com/users/royrutto/gists{/gist_id}","starred_url":"https://api.github.com/users/royrutto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/royrutto/subscriptions","organizations_url":"https://api.github.com/users/royrutto/orgs","repos_url":"https://api.github.com/users/royrutto/repos","events_url":"https://api.github.com/users/royrutto/events{/privacy}","received_events_url":"https://api.github.com/users/royrutto/received_events","type":"User","site_admin":false},"assignees":[{"login":"royrutto","id":1002419,"avatar_url":"https://avatars.githubusercontent.com/u/1002419?v=3","gravatar_id":"","url":"https://api.github.com/users/royrutto","html_url":"https://github.com/royrutto","followers_url":"https://api.github.com/users/royrutto/followers","following_url":"https://api.github.com/users/royrutto/following{/other_user}","gists_url":"https://api.github.com/users/royrutto/gists{/gist_id}","starred_url":"https://api.github.com/users/royrutto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/royrutto/subscriptions","organizations_url":"https://api.github.com/users/royrutto/orgs","repos_url":"https://api.github.com/users/royrutto/repos","events_url":"https://api.github.com/users/royrutto/events{/privacy}","received_events_url":"https://api.github.com/users/royrutto/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/onaio/hatti/pulls/174/commits","review_comments_url":"https://api.github.com/repos/onaio/hatti/pulls/174/comments","review_comment_url":"https://api.github.com/repos/onaio/hatti/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onaio/hatti/issues/174/comments","statuses_url":"https://api.github.com/repos/onaio/hatti/statuses/eca9a0f0365bc75aafb9e9d189438303d8210107","head":{"label":"onaio:4642-hexbins","ref":"4642-hexbins","sha":"eca9a0f0365bc75aafb9e9d189438303d8210107","user":{"login":"onaio","id":5450613,"avatar_url":"https://avatars.githubusercontent.com/u/5450613?v=3","gravatar_id":"","url":"https://api.github.com/users/onaio","html_url":"https://github.com/onaio","followers_url":"https://api.github.com/users/onaio/followers","following_url":"https://api.github.com/users/onaio/following{/other_user}","gists_url":"https://api.github.com/users/onaio/gists{/gist_id}","starred_url":"https://api.github.com/users/onaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onaio/subscriptions","organizations_url":"https://api.github.com/users/onaio/orgs","repos_url":"https://api.github.com/users/onaio/repos","events_url":"https://api.github.com/users/onaio/events{/privacy}","received_events_url":"https://api.github.com/users/onaio/received_events","type":"Organization","site_admin":false},"repo":{"id":33992779,"name":"hatti","full_name":"onaio/hatti","owner":{"login":"onaio","id":5450613,"avatar_url":"https://avatars.githubusercontent.com/u/5450613?v=3","gravatar_id":"","url":"https://api.github.com/users/onaio","html_url":"https://github.com/onaio","followers_url":"https://api.github.com/users/onaio/followers","following_url":"https://api.github.com/users/onaio/following{/other_user}","gists_url":"https://api.github.com/users/onaio/gists{/gist_id}","starred_url":"https://api.github.com/users/onaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onaio/subscriptions","organizations_url":"https://api.github.com/users/onaio/orgs","repos_url":"https://api.github.com/users/onaio/repos","events_url":"https://api.github.com/users/onaio/events{/privacy}","received_events_url":"https://api.github.com/users/onaio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onaio/hatti","description":"It views data!","fork":false,"url":"https://api.github.com/repos/onaio/hatti","forks_url":"https://api.github.com/repos/onaio/hatti/forks","keys_url":"https://api.github.com/repos/onaio/hatti/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onaio/hatti/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onaio/hatti/teams","hooks_url":"https://api.github.com/repos/onaio/hatti/hooks","issue_events_url":"https://api.github.com/repos/onaio/hatti/issues/events{/number}","events_url":"https://api.github.com/repos/onaio/hatti/events","assignees_url":"https://api.github.com/repos/onaio/hatti/assignees{/user}","branches_url":"https://api.github.com/repos/onaio/hatti/branches{/branch}","tags_url":"https://api.github.com/repos/onaio/hatti/tags","blobs_url":"https://api.github.com/repos/onaio/hatti/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onaio/hatti/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onaio/hatti/git/refs{/sha}","trees_url":"https://api.github.com/repos/onaio/hatti/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onaio/hatti/statuses/{sha}","languages_url":"https://api.github.com/repos/onaio/hatti/languages","stargazers_url":"https://api.github.com/repos/onaio/hatti/stargazers","contributors_url":"https://api.github.com/repos/onaio/hatti/contributors","subscribers_url":"https://api.github.com/repos/onaio/hatti/subscribers","subscription_url":"https://api.github.com/repos/onaio/hatti/subscription","commits_url":"https://api.github.com/repos/onaio/hatti/commits{/sha}","git_commits_url":"https://api.github.com/repos/onaio/hatti/git/commits{/sha}","comments_url":"https://api.github.com/repos/onaio/hatti/comments{/number}","issue_comment_url":"https://api.github.com/repos/onaio/hatti/issues/comments{/number}","contents_url":"https://api.github.com/repos/onaio/hatti/contents/{+path}","compare_url":"https://api.github.com/repos/onaio/hatti/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onaio/hatti/merges","archive_url":"https://api.github.com/repos/onaio/hatti/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onaio/hatti/downloads","issues_url":"https://api.github.com/repos/onaio/hatti/issues{/number}","pulls_url":"https://api.github.com/repos/onaio/hatti/pulls{/number}","milestones_url":"https://api.github.com/repos/onaio/hatti/milestones{/number}","notifications_url":"https://api.github.com/repos/onaio/hatti/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onaio/hatti/labels{/name}","releases_url":"https://api.github.com/repos/onaio/hatti/releases{/id}","deployments_url":"https://api.github.com/repos/onaio/hatti/deployments","created_at":"2015-04-15T12:36:42Z","updated_at":"2016-10-27T14:18:39Z","pushed_at":"2016-12-02T12:02:36Z","git_url":"git://github.com/onaio/hatti.git","ssh_url":"git@github.com:onaio/hatti.git","clone_url":"https://github.com/onaio/hatti.git","svn_url":"https://github.com/onaio/hatti","homepage":null,"size":6290,"stargazers_count":8,"watchers_count":8,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":19,"forks":2,"open_issues":19,"watchers":8,"default_branch":"master"}},"base":{"label":"onaio:master","ref":"master","sha":"e79648ab56fb9154c41bf1d95281ec4288fa7eb3","user":{"login":"onaio","id":5450613,"avatar_url":"https://avatars.githubusercontent.com/u/5450613?v=3","gravatar_id":"","url":"https://api.github.com/users/onaio","html_url":"https://github.com/onaio","followers_url":"https://api.github.com/users/onaio/followers","following_url":"https://api.github.com/users/onaio/following{/other_user}","gists_url":"https://api.github.com/users/onaio/gists{/gist_id}","starred_url":"https://api.github.com/users/onaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onaio/subscriptions","organizations_url":"https://api.github.com/users/onaio/orgs","repos_url":"https://api.github.com/users/onaio/repos","events_url":"https://api.github.com/users/onaio/events{/privacy}","received_events_url":"https://api.github.com/users/onaio/received_events","type":"Organization","site_admin":false},"repo":{"id":33992779,"name":"hatti","full_name":"onaio/hatti","owner":{"login":"onaio","id":5450613,"avatar_url":"https://avatars.githubusercontent.com/u/5450613?v=3","gravatar_id":"","url":"https://api.github.com/users/onaio","html_url":"https://github.com/onaio","followers_url":"https://api.github.com/users/onaio/followers","following_url":"https://api.github.com/users/onaio/following{/other_user}","gists_url":"https://api.github.com/users/onaio/gists{/gist_id}","starred_url":"https://api.github.com/users/onaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onaio/subscriptions","organizations_url":"https://api.github.com/users/onaio/orgs","repos_url":"https://api.github.com/users/onaio/repos","events_url":"https://api.github.com/users/onaio/events{/privacy}","received_events_url":"https://api.github.com/users/onaio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onaio/hatti","description":"It views data!","fork":false,"url":"https://api.github.com/repos/onaio/hatti","forks_url":"https://api.github.com/repos/onaio/hatti/forks","keys_url":"https://api.github.com/repos/onaio/hatti/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onaio/hatti/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onaio/hatti/teams","hooks_url":"https://api.github.com/repos/onaio/hatti/hooks","issue_events_url":"https://api.github.com/repos/onaio/hatti/issues/events{/number}","events_url":"https://api.github.com/repos/onaio/hatti/events","assignees_url":"https://api.github.com/repos/onaio/hatti/assignees{/user}","branches_url":"https://api.github.com/repos/onaio/hatti/branches{/branch}","tags_url":"https://api.github.com/repos/onaio/hatti/tags","blobs_url":"https://api.github.com/repos/onaio/hatti/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onaio/hatti/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onaio/hatti/git/refs{/sha}","trees_url":"https://api.github.com/repos/onaio/hatti/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onaio/hatti/statuses/{sha}","languages_url":"https://api.github.com/repos/onaio/hatti/languages","stargazers_url":"https://api.github.com/repos/onaio/hatti/stargazers","contributors_url":"https://api.github.com/repos/onaio/hatti/contributors","subscribers_url":"https://api.github.com/repos/onaio/hatti/subscribers","subscription_url":"https://api.github.com/repos/onaio/hatti/subscription","commits_url":"https://api.github.com/repos/onaio/hatti/commits{/sha}","git_commits_url":"https://api.github.com/repos/onaio/hatti/git/commits{/sha}","comments_url":"https://api.github.com/repos/onaio/hatti/comments{/number}","issue_comment_url":"https://api.github.com/repos/onaio/hatti/issues/comments{/number}","contents_url":"https://api.github.com/repos/onaio/hatti/contents/{+path}","compare_url":"https://api.github.com/repos/onaio/hatti/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onaio/hatti/merges","archive_url":"https://api.github.com/repos/onaio/hatti/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onaio/hatti/downloads","issues_url":"https://api.github.com/repos/onaio/hatti/issues{/number}","pulls_url":"https://api.github.com/repos/onaio/hatti/pulls{/number}","milestones_url":"https://api.github.com/repos/onaio/hatti/milestones{/number}","notifications_url":"https://api.github.com/repos/onaio/hatti/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onaio/hatti/labels{/name}","releases_url":"https://api.github.com/repos/onaio/hatti/releases{/id}","deployments_url":"https://api.github.com/repos/onaio/hatti/deployments","created_at":"2015-04-15T12:36:42Z","updated_at":"2016-10-27T14:18:39Z","pushed_at":"2016-12-02T12:02:36Z","git_url":"git://github.com/onaio/hatti.git","ssh_url":"git@github.com:onaio/hatti.git","clone_url":"https://github.com/onaio/hatti.git","svn_url":"https://github.com/onaio/hatti","homepage":null,"size":6290,"stargazers_count":8,"watchers_count":8,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":19,"forks":2,"open_issues":19,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onaio/hatti/pulls/174"},"html":{"href":"https://github.com/onaio/hatti/pull/174"},"issue":{"href":"https://api.github.com/repos/onaio/hatti/issues/174"},"comments":{"href":"https://api.github.com/repos/onaio/hatti/issues/174/comments"},"review_comments":{"href":"https://api.github.com/repos/onaio/hatti/pulls/174/comments"},"review_comment":{"href":"https://api.github.com/repos/onaio/hatti/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onaio/hatti/pulls/174/commits"},"statuses":{"href":"https://api.github.com/repos/onaio/hatti/statuses/eca9a0f0365bc75aafb9e9d189438303d8210107"}}}}
{"actor":{"display_login":"pld"}}