-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Move Map and Plugin object to a tree structure #170
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
I forgot ; for the moment, the tree structure is:
The idea is to move progressively |
I feel like this PR is actually 2PRs, one part is the plugin render idea, the other is the tree structure. Some questions:
|
I chose
A plugin generally adds something on the map. But you're true, it can require to add somthing to the overall figure. This is why I have designed the thing so that each node knows who is his parent, and can have an effect on it. For example, if you have something like
Then each boatmarker will do something like
But as it is the same Figure object, they will simply overwrite the former header. |
Let's say that |
💚 At last ! |
self.map.figure.header['jquery'] = JavascriptLink("https://code.jquery.com/jquery-2.1.0.min.js") | ||
self.map.figure.script['vega_parse'] = Template("""function vega_parse(spec, div) { | ||
vg.parse.spec(spec, function(chart) { chart({el:div}).update(); });}""") | ||
|
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.
With this approach it should be relatively easy to create mpld3 (pr even bokeh) popups.
This is outdated. Replaced by #203 |
3 simple commits, and an important one (561f060).
The goal of the latter is to move progressively the Map and Plugin objects into a tree structure.
What I have in mind is a tree like :
Each node of the tree would have a
render
method that can have an effect on his parents.This would have several positive effects:
marker
,popup
,divIcon
andawesomeMarker
need that kind of interactions (see Avoid code duplication in div marker #169). In my mind, this corresponds to the idea of aFoliumDataSource
, as @wrobstory mentioned in Support GeoPandas #34.render
method, it can be a leaf in that tree. This may help today's plugins and @themiurgo's Rationalize Templates #147 to converge.Well, discussion is open... ;-)