datamade / crimearound.us

:police_car: A tool for browsing crime reports from the Chicago Police Department.
http://crimearound.us
MIT License
5 stars 3 forks source link

Use some kind of point clustering for points at the same location #28

Closed evz closed 10 years ago

evz commented 10 years ago

When there is more than one crime in the map view that was reported at the same location, it ends up looking kinda like the points on the left side here:

screenshot 2014-04-11 12 13 30

It's subtle but you can see that it's not as transparent. I was thinking one way around this might be to use something like Leaflet Marker Clusterer to make it possible to expand them.

fgregg commented 10 years ago

How about adding a little jitter http://stat.ethz.ch/R-manual/R-devel/library/base/html/jitter.html

On Fri, Apr 11, 2014 at 12:20 PM, Eric van Zanten notifications@github.comwrote:

When there is more than one crime in the map view that was reported at the same location, it ends up looking kinda like the points on the left side here:

[image: screenshot 2014-04-11 12 13 30]https://cloud.githubusercontent.com/assets/551491/2682558/d93021dc-c19c-11e3-9f5f-2069740c8b15.png

It's subtle but you can see that it's not as transparent. I was thinking one way around this might be to use something like Leaflet Marker Clusterer https://github.com/Leaflet/Leaflet.markercluster to make it possible to expand them.

— Reply to this email directly or view it on GitHubhttps://github.com/datamade/crimearound.us/issues/28 .

773.888.2718 2231 N. Monticello Ave Chicago, IL 60647

evz commented 10 years ago

Just got an email from Taryn with some feedback I think is directly related to this. Apparently, one of their users was trying to find Battery and Homicide for Beat 422 for all of 2013 (a query which takes an embarrassingly long time to complete). When you run that query, you get something that looks a little like this:

screenshot 2014-04-30 14 02 25

Even when you zoom in, you can see where there are exactly overlapping points, in some cases probably more than two.

evz commented 10 years ago

@derekeder I just pushed up something that addresses this into the marker-clusters branch. If you're in a position to check this out before you're back in town, that would be cool.

derekeder commented 10 years ago

Cool I see how this works:

Two reports on top of each other screen shot 2014-04-30 at 4 19 28 pm

Clicking on them splits them up screen shot 2014-04-30 at 4 19 32 pm

I think this is a decent approach. I think we need to make the UI more obvious. Could we add the number of clustered points or make the cluster circles bigger than the default ones?

fgregg commented 10 years ago

I would just add some jitter. You don't need very much.

On Wed, Apr 30, 2014 at 4:21 PM, Derek Eder notifications@github.comwrote:

Cool I see how this works:

Two reports on top of each other [image: screen shot 2014-04-30 at 4 19 28 pm]https://cloud.githubusercontent.com/assets/919583/2847343/278deb06-d0ad-11e3-815a-34977891d138.png

Clicking on them splits them up [image: screen shot 2014-04-30 at 4 19 32 pm]https://cloud.githubusercontent.com/assets/919583/2847344/2939e856-d0ad-11e3-9ce4-336ae8b21a0f.png

I think this is a decent approach. I think we need to make the UI more obvious. Could we add the number of clustered points or make the cluster circles bigger than the default ones?

— Reply to this email directly or view it on GitHubhttps://github.com/datamade/crimearound.us/issues/28#issuecomment-41852357 .

773.888.2718 2231 N. Monticello Ave Chicago, IL 60647

evz commented 10 years ago

Attempting the jitter approach here: https://github.com/datamade/crimearound.us/tree/jitter

Zoomed out:

screenshot 2014-05-01 16 37 35

Slightly zoomed in:

screenshot 2014-05-01 16 38 01

Looks like it preserves enough of the accuracy to be informative. We'll probably want to play around with the amount of jitter we add.

derekeder commented 10 years ago

Using jitter