Skip to content

Features #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Sep 11, 2015
Merged

Features #203

merged 36 commits into from
Sep 11, 2015

Conversation

BibMartin
Copy link
Contributor

This is another version of #170 .
This is not ready for merge. But I would like to share it and have your point of view.

At the cost of scrambling things in version 2, I think this is a more robust implementation of #170's ideas.

The main new thing is a Feature object that has _parent and _children attributes, and a render method. Everything inherits from this (Map, Figure, Layer, ...).

  • The _parent is either another Feature, or None (if this is the root of the tree).
  • The _children is an OrdredDict of Features.
  • The render method calls the render method of each children, it can have a bodre effect on the parent, and it returns a string.

@ocefpaf
Copy link
Member

ocefpaf commented Aug 27, 2015

@BibMartin this is looking awesome. I really like the clarity of things. I will take a more careful review once I get back home (I am travelling now).

@themiurgo
Copy link
Contributor

👍 I am not so sure of including Figure as a Feature (I would follow more closely what Leaflet is doing, and keep features being only markers and the likes) but the general direction is great.

@BibMartin BibMartin mentioned this pull request Aug 27, 2015
@BibMartin
Copy link
Contributor Author

Hi all ! I'm almost finished with what I had in mind.
If you want to have a look at the result : http://nbviewer.ipython.org/github/bibmartin/folium/blob/features/examples/Features.ipynb
Of course, this is only a skeleton. I guess we can create straightforward functions to do things in one line -- and to ensure compatibility with previous version.

@BibMartin
Copy link
Contributor Author

@themiurgo : Sorry, I realize that a former post I did here has not been recorded.
You're true, Feature is not a good name for the object I've written, because everything is a Feature here while feature has another meaning in Leaflet.
Can we rename Feature into something else ? Maybe Node or Nodus, provided that they are the nodes of the folium tree.

@ocefpaf
Copy link
Member

ocefpaf commented Aug 28, 2015

Maybe Node or Nodus, provided that they are the nodes of the folium tree.

😸 I like the analogy, but I am not sure if Node is a a catchy name, but since I cannot come up with a better one I am OK with it. @andrewgiessel Wanna to join the discussing? Any name suggestion?

@BibMartin
Copy link
Contributor Author

There's still a lot of work to do here:

  • Plug what's missing (geojson, choropleth, imageoverlay, ...)
  • Organize code into files/subfiles ...
  • Compute tests and adapt them to test.py

We can :

  • Wait a while that I finish the biggest part of it, and merge then,
  • Merge as it is, to let further contributions be in this mindset,
  • Merge in another branch,

any point of view ?

@ocefpaf
Copy link
Member

ocefpaf commented Aug 30, 2015 via email

@BibMartin
Copy link
Contributor Author

I think I'm done (for the moment) and ready to merge.

As told before there's still a lot to do for recomputing plugins (see https://github.com/BibMartin/folium/blob/features/examples/Features.ipynb for the list) and for binding today's API with this structure.

For the moment, I've splitted the code into 3 files only :

  • element.py stores all the root objects (Element, Figure, Link, MacroElement, ...)
  • map.py stores the basics of leaflet maps (Map, Marker, Layer, ...)
  • features.py stores future plugins

@themiurgo @ocefpaf ; if you have time to review... ☕

@ocefpaf
Copy link
Member

ocefpaf commented Sep 1, 2015

I am teaching a workshop this week, but I will try to take a look at it tomorrow.

@themiurgo If you think this is OK do not wait for me.

@ocefpaf
Copy link
Member

ocefpaf commented Sep 5, 2015

@BibMartin I just gave this a more through review and I am 👍

However, I really want @themiurgo's option and,if possible, some of @wrobstory's too.

This is a big change we and all need to be on the same page before merging.

@BibMartin
Copy link
Contributor Author

Well, in fact this PR does not break anything (if you do import folium, you still get the former version of the code.)

I will create another PR aiming at plugging the API back ; so that when you import folium you get the new objects, with backward compatibility and deprecation warnings.

@ocefpaf
Copy link
Member

ocefpaf commented Sep 9, 2015

I am planing to merge this next Friday... Speak now or forever hold your peace!

ocefpaf added a commit that referenced this pull request Sep 11, 2015
@ocefpaf ocefpaf merged commit 725c0bb into python-visualization:master Sep 11, 2015
@ocefpaf
Copy link
Member

ocefpaf commented Sep 11, 2015

And done!

@andrewgiessel
Copy link
Contributor

👏

On Fri, Sep 11, 2015 at 9:01 AM Filipe [email protected] wrote:

And done!


Reply to this email directly or view it on GitHub
#203 (comment)
.

@BibMartin
Copy link
Contributor Author

Thanks @ocefpaf ; sorry I forgot to squash. Is there a way to repair ?

@ocefpaf
Copy link
Member

ocefpaf commented Sep 11, 2015

No problem. There are several commits but, for most of them, it is actually better to be separated.

@BibMartin BibMartin deleted the features branch December 7, 2015 11:03
@ocefpaf ocefpaf added the enhancement Feature request or idea about how to make folium better label Feb 12, 2016
@ocefpaf ocefpaf added this to the v0.2.0 milestone Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or idea about how to make folium better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants