-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add 'BeautifyMarker' marker type to the project. Rework from Pull ID: #776 #819
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
Conversation
Hi @JeremyBYU, I reviewed your PR, it's a good addition. Great that you included tests and some examples. I have some suggestions, let me know what you think. I hope you're still willing to work on this!
|
I'll take a look at it later next week. I think the requests are all doable. |
tests/plugins/test_beautify_icon.py
Outdated
bm1 = folium.Marker(location=[46, -122], | ||
popup='Portland, OR', | ||
icon=ic1 | ||
).add_to(m) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E124 closing bracket does not match visual indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can fix that. However I had no idea that I pushed my changes to the python-visualization/folium repository. Are any changes that I make on my fork automatically pushed to yours (folium)? Or did I accidentally somehow do a push to folium? I'm guessing the later, but not sure.
Delete gitignore and BeautifulMarker.py
Okay @Conengmo, I think this covered what you wanted. The only problem is that a bunch of commits occurred, and I'm not sure how it happened! I think I just realized that any push that I make to my fork will automatically sync up here (specifically because I'm in a pull request)! I had no idea! Let me know if there's anything else I need to change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work @JeremyBYU, it looks great! Code, tests, example in notebook, it's all good. I have some very small comments on the docstring format. Could you take a look at those? Should be easy to fix. After that we're good to go!
folium/plugins/beautify_icon.py
Outdated
class BeautifyIcon(MacroElement): | ||
""" | ||
Create a BeautifyIcon that can be added to a Marker | ||
Parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a blank line before each heading. So before Parameters
, Returns
and Examples
.
folium/plugins/beautify_icon.py
Outdated
Create a BeautifyIcon that can be added to a Marker | ||
Parameters | ||
---------- | ||
icon: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to make this perfect, you could add the default values to each item. Like in the normal Icon
class.
folium/plugins/beautify_icon.py
Outdated
the number of the icon. | ||
Returns | ||
------- | ||
Icon names and HTML in obj.template_vars |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class doesn't return anything, so the Returns
part should be removed. (Technically it returns None
but for a class docstring this is not documented.)
inner_icon_style='font-size:12px;padding-top:-5px;') | ||
>>> Marker(location=[45.5, -122.3], popup=folium.Popup('Portland, OR'), icon=number_icon) | ||
>>> BeautifyIcon(icon='arrow-down', icon_shape='marker').add_to(marker) | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lastly, can you add a link to the plugin website here? It's this one right?
https://github.com/marslan390/BeautifyMarker
CHANGES.txt
Outdated
@@ -10,6 +10,7 @@ | |||
- Added `tooltip` support to all vector layers (ocefpaf #722) | |||
- Added `TimeSliderChoropleth` plugin (halfdanrump #736) | |||
- Added `show` parameter to choose which overlays to show on opening (conengmo #772) | |||
- Added BeautifyIcon Plugin (arthuralvim and jeremybyu #776) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number of this PR is #819, could you add it?
Awesome thanks! |
Thanks @JeremyBYU for the PR and @Conengmo for the review! The |
Hi,
I'm pretty new to doing a pull request so I hope I'm doing this right. This is basically the same pull request #776 from @arthuralvim, however I tried to finish all the requests/comments you gave before merging. I needed this work for my own research so I thought I would give it a go.
Comments/Issues from #776 hopefully resolved:
folium/map.py
to its own pluginexamples\Plugins.ipynb
CHANGES.txt
. Once a pull id is assigned and any fixes you need are done, I will update.Most of this work is exactly from @arthuralvim, so the credit should mostly go to him. I wasn't sure how to pull from a 'pull request' and then resubmit under the same pull ID. So I have just forked master today and updated these changes. Let me know if there is any other work you need.
Thanks,
Jeremy