Conversation
|
@BibMartin this looks great. I will try to review it as soon as possible. (Unless someone beats me to it.) |
|
@ocefpaf @themiurgo We have 3 commits here:
I'm not really sure about the third point, but I guess this can help refactoring former Please try some examples in a notebook: |
|
There is a type in the notebook |
There was a problem hiding this comment.
I wonder if someone should create a tiny library with that...
|
@BibMartin I made some minor comments. I'd really appreciate if someone else could take a look too. Even though I really like this PR a lot I cannot shake the feeling that this is too much for |
I was thinking of it when programming the first commit ae0bf14 ; in fact in this commit the module It could be another (tiny) library supported by But on the other hand:
Finally, I'm quite open to discuss that point, and would also appreciate other inputs (ping @themiurgo, @andrewgiessel ?)
I like having simple and explicit kwarg names ; but I will trust your wise opinion. As for your other comments, I'm okay and will apply changes asap. |
I get that. That is why I said someone else. You not included 😉
Wise? No so sure 😄 Note that I am biased here. I guess that matplotlib uses |
|
I agree with the wise @ocefpaf on this. This functionality is great, but it feels a bit out of place here. Why don't you make a small library out of it? Something that seems to be missing from scientific python community is a d3-like python library. There is d3py but the project looks abandoned. This library would be a good building block for something like that, which converts values to other scales or to colors. |
Just to be clear I am OK merging it. I would like to see this code as external library, but the maintenance burden would be too much on @BibMartin shoulders. (And I am selfish! I want to keep him focused on folium 😝)
Indeed!
I guess we should make some twitter noise: "folium submodule for sale!" |
|
Let's merge it then! |
Yes, but it cannot be restricted to d3 ; d3 is often a brick among others to create a nice report (another example could be #251). This would be a python-visualization library based on HTML and JS. I'm split between 3 scenarios: 1. Folium is python-visualizationAs a folium user and contributor, I'm glad not needing to install fancy dependencies with folium. By fancy, I mean something that risk to be buggy, not to evolve anymore or evolve too fast etc. In a word, I would keep everything in folium as much as possible ; at the cost of doing a big split when mature. 2. Folium is the map plugin of python-visualizationFolium's goal is to enable easy map generation with Leaflet. We could factor-out everything that's not map-specific: Finally, python-visualization would implement the core of the mindset (objects added the one to the other, render methods outputing result in a file or an iframe). And folium would focus on providing the leaflet-specific objects : Other libraries could be created based on python-visualization (GeoJson, Crossfilter, NVD3, bootstrap...) but without involving folium. 3. Folium depends on an existing visualization libraryThere are several visualization libraies available in python community (matplotlib, mpld3, bokeh, plot.ly...). No one is perfect today, nor dominating (except for matplotlib ; but not really notebook-interactive), but I'm not sure it worth trying to create another competitor. We can decide to let folium depend on one of these and use their colormap function, ... Anyway, I think these reflections are useful (and necessary), but they are middle or long-term thoughts. I would vote for merging colormap as-is today and finish After that piece of (silly?) text, I looking forward for your reactions. 😧 |
|
Sorry I didn't get a chance to look at this over the week- these larger issues deserve some thought. I think colormap is a clear case of something that can be (and should be) either refactored out to another python-visualization project or use an existing library. :+1 to merge for now, and include in v0.2 |
I might have been unclear. What I meant by d3-like library is "something that converts values and ranges into geometrical objects". It might not be at all related to JS, HTML and it might use matplotlib, folium or anything as a backend. |
|
@BibMartin I see a future where we are 90% (2) + 10% (3). Folium is not python-visualization. I guess that, when @wrobstory created the organization, he wanted to add his other projects here too (vincent, bearcart, etc).
Maybe yes. Definitely not now! Bare in mind that, if we re-factor, then folium would depend on those and we would start entering the 10% of (3) I mentioned above. PS: Bokeh is improving their map support. However, I believe folium is very different from bokeh by providing easy maps (just a few lines of code) and close integration with Leaflet. |
|
Thank you @ocefpaf @themiurgo @andrewgiessel for your comments. For now it seems we are close to |
Hi everybody! My biggest goal was largely to move Folium out of the One option is to rename the organization from |
Create a colormap module, to help generating choropleth and other colouring jobs (like ImageOverlay ?).
It can address #289 (?)
I know there are plenty existing libs doing this (among which matplotlib), but I guess this will be rather simple to maintain and brings no new dependency.
Please see http://nbviewer.ipython.org/github/bibmartin/folium/blob/colormap/examples/Colormaps.ipynb for examples.