markmarkoh / datamaps

Customizable SVG map visualizations for the web in a single Javascript file using D3.js
http://datamaps.github.io
MIT License
3.78k stars 1.01k forks source link

D3 Hexbin Plugin #48

Closed ramnathv closed 8 years ago

ramnathv commented 10 years ago

I am working on a hexbin plugin for datamaps. Here is my work so far. It is still work-in-progress, but I thought I would share it with you to see if you had any early comments/feedback. Once, the plugin is complete, I will submit a pull request, if you think this would be an interesting feature for datamaps.

markmarkoh commented 10 years ago

I like it, I'd definitely like to add this to the core.

A few notes:

ramnathv commented 10 years ago

Thanks! I will keep these in mind, while I prepare to submit my pull request. I just need to figure out how to let the user customize size and color from outside the plugin. Do you think allowing users to specify the radius and color functions as options will be the best way to allow this plugin to be customizable?

markmarkoh commented 10 years ago

To stay consistent with bubbles, probably radius and fillKey that refers back to the fills object.

ramnathv commented 10 years ago

That makes sense. For hexbin, I think radius and fillKey could be passed as functions, since the user might want to customize stuff. I am not sure how consistent that would be with bubbles. Let me come up with a few options that you can then comment on.

markmarkoh commented 10 years ago

Bubbles should allow functions too. That even stays consistent with d3, which I like. I can port whatever hexbin does into bubbles if it makes sense at that point.

ramnathv commented 10 years ago

Perfect. Will keep you posted.

ramnathv commented 10 years ago

I enhanced the example by trying to add hoverovers using the bubbles plugin, but was unable to get it working.

http://jsbin.com/abeXErat/33/edit?html,output

Any pointers would be useful.