@@ -69,7 +69,7 @@ def __init__(self, location, popup=None,
69
69
self .rotation = rotation
70
70
self .radius = radius
71
71
if popup is not None :
72
- self .add_children (popup )
72
+ self .add_child (popup )
73
73
74
74
self ._template = Template (u"""
75
75
{% macro script(this, kwargs) %}
@@ -98,8 +98,14 @@ def render(self, **kwargs):
98
98
assert isinstance (figure , Figure ), ("You cannot render this Element "
99
99
"if it's not in a Figure." )
100
100
101
+ < << << << HEAD
101
102
figure .header .add_children (
102
103
JavascriptLink ("https://cdnjs.cloudflare.com/ajax/libs/leaflet-dvf/0.2/leaflet-dvf.markers.min.js" ),
104
+ == == == =
105
+ figure .header .add_child (\
106
+ JavascriptLink ("https://cdnjs.cloudflare.com/ajax/libs/leaflet-dvf"
107
+ "/0.2/leaflet-dvf.markers.min.js" ),
108
+ >> >> >> > fb52791 ... Renaming add_children -> add_child
103
109
name = 'dvf_js' )
104
110
105
111
@@ -122,19 +128,19 @@ def __init__(self, data, width='100%', height='100%',
122
128
def render (self , ** kwargs ):
123
129
self .json = json .dumps (self .data )
124
130
125
- self ._parent .html .add_children (Element (Template ("""
131
+ self ._parent .html .add_child (Element (Template ("""
126
132
<div id="{{this.get_name()}}"></div>
127
133
""" ).render (this = self , kwargs = kwargs )), name = self .get_name ())
128
134
129
- self ._parent .script .add_children (Element (Template ("""
135
+ self ._parent .script .add_child (Element (Template ("""
130
136
vega_parse({{this.json}},{{this.get_name()}});
131
137
""" ).render (this = self )), name = self .get_name ())
132
138
133
139
figure = self .get_root ()
134
140
assert isinstance (figure , Figure ), ("You cannot render this Element "
135
141
"if it's not in a Figure." )
136
142
137
- figure .header .add_children (Element (Template ("""
143
+ figure .header .add_child (Element (Template ("""
138
144
<style> #{{this.get_name()}} {
139
145
position : {{this.position}};
140
146
width : {{this.width[0]}}{{this.width[1]}};
@@ -144,6 +150,7 @@ def render(self, **kwargs):
144
150
</style>
145
151
""" ).render (this = self , ** kwargs )), name = self .get_name ())
146
152
153
+ << < << << HEAD
147
154
figure .header .add_children (
148
155
JavascriptLink ("https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" ),
149
156
name = 'd3' )
@@ -157,6 +164,21 @@ def render(self, **kwargs):
157
164
name = 'jquery' )
158
165
159
166
figure .script .add_children (
167
+ == == == =
168
+ figure .header .add_child (\
169
+ JavascriptLink ("https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" ),
170
+ name = 'd3' )
171
+
172
+ figure .header .add_child (\
173
+ JavascriptLink ("https://cdnjs.cloudflare.com/ajax/libs/vega/1.4.3/vega.min.js" ),
174
+ name = 'vega' )
175
+
176
+ figure .header .add_child (\
177
+ JavascriptLink ("https://code.jquery.com/jquery-2.1.0.min.js" ),
178
+ name = 'jquery' )
179
+
180
+ figure .script .add_child (\
181
+ >> >> >> > fb52791 ... Renaming add_children -> add_child
160
182
Template ("""function vega_parse(spec, div) {
161
183
vg.parse.spec(spec, function(chart) { chart({el:div}).update(); });}""" ),
162
184
name = 'vega_parse' )
@@ -233,7 +255,11 @@ def render(self, **kwargs):
233
255
assert isinstance (figure , Figure ), ("You cannot render this Element "
234
256
"if it's not in a Figure." )
235
257
258
+ << << < << HEAD
236
259
figure .header .add_children (
260
+ == == == =
261
+ figure .header .add_child (\
262
+ >> >> >> > fb52791 ... Renaming add_children -> add_child
237
263
JavascriptLink ("https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.9/topojson.min.js" ),
238
264
name = 'topojson' )
239
265
@@ -305,7 +331,11 @@ def render(self, **kwargs):
305
331
assert isinstance (figure , Figure ), ("You cannot render this Element "
306
332
"if it's not in a Figure." )
307
333
334
+ << < << << HEAD
308
335
figure .header .add_children (
336
+ == == == =
337
+ figure .header .add_child (\
338
+ >> >> >> > fb52791 ... Renaming add_children -> add_child
309
339
JavascriptLink ("https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" ),
310
340
name = 'd3' )
311
341
@@ -333,7 +363,11 @@ def render(self, **kwargs):
333
363
assert isinstance (figure , Figure ), ("You cannot render this Element "
334
364
"if it's not in a Figure." )
335
365
366
+ << < << << HEAD
336
367
figure .header .add_children (
368
+ == == == =
369
+ figure .header .add_child (\
370
+ >> >> >> > fb52791 ... Renaming add_children -> add_child
337
371
JavascriptLink ("https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" ),
338
372
name = 'd3' )
339
373
@@ -342,7 +376,7 @@ class MarkerCluster(MacroElement):
342
376
"""Adds a MarkerCluster layer on the map."""
343
377
def __init__ (self ):
344
378
"""Creates a MarkerCluster element to append into a map with
345
- Map.add_children .
379
+ Map.add_child .
346
380
347
381
Parameters
348
382
----------
@@ -360,6 +394,7 @@ def render(self, **kwargs):
360
394
super (MarkerCluster , self ).render ()
361
395
362
396
figure = self .get_root ()
397
+ << < << << HEAD
363
398
assert isinstance (figure , Figure ), ("You cannot render this Element "
364
399
"if it's not in a Figure." )
365
400
figure .header .add_children (
@@ -375,6 +410,25 @@ def render(self, **kwargs):
375
410
name = 'marker_cluster_css' )
376
411
377
412
figure .header .add_children (
413
+ == == == =
414
+ assert isinstance (figure ,Figure ), ("You cannot render this Element "
415
+ "if it's not in a Figure." )
416
+ figure .header .add_child (\
417
+ JavascriptLink ("https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster"
418
+ "/0.4.0/leaflet.markercluster-src.js" ),
419
+ name = 'marker_cluster_src' )
420
+
421
+ figure .header .add_child (\
422
+ JavascriptLink ("https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster"
423
+ "/0.4.0/leaflet.markercluster.js" ),
424
+ name = 'marker_cluster' )
425
+
426
+ figure .header .add_child (\
427
+ CssLink ("https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/0.4.0/MarkerCluster.css" ),
428
+ name = 'marker_cluster_css' )
429
+
430
+ figure .header .add_child (\
431
+ >> >> >> > fb52791 ... Renaming add_children -> add_child
378
432
CssLink ("https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/0.4.0/MarkerCluster.Default.css" ),
379
433
name = "marker_cluster_default_css" )
380
434
@@ -411,7 +465,7 @@ def __init__(self, location, radius=500, color='black',
411
465
self .fill_color = fill_color
412
466
self .fill_opacity = fill_opacity
413
467
if popup is not None :
414
- self .add_children (popup )
468
+ self .add_child (popup )
415
469
416
470
self ._template = Template (u"""
417
471
{% macro script(this, kwargs) %}
@@ -480,10 +534,15 @@ def __init__(self, popup=None):
480
534
481
535
482
536
class PolyLine (MacroElement ):
537
+ << << << < HEAD
483
538
def __init__ (self , locations , color = None , weight = None ,
484
539
opacity = None , latlon = True ):
485
540
"""Creates a PolyLine object to append into a map with
486
541
Map.add_children.
542
+ =======
543
+ def __init__(self, locations, color=None, weight=None, opacity=None, latlon=True):
544
+ """ Creates a PolyLine object to append into a map with Map .add_child .
545
+ >> > >> > > fb52791 ... Renaming add_children -> add_child
487
546
488
547
Parameters
489
548
- - - - - - - - - -
@@ -521,10 +580,15 @@ def __init__(self, locations, color=None, weight=None,
521
580
522
581
523
582
class MultiPolyLine(MacroElement):
583
+ <<<<<<< HEAD
524
584
def __init__(self, locations, color=None, weight=None,
525
585
opacity=None, latlon=True):
526
586
""" Creates a MultiPolyLine object to append into a map with
527
587
Map .add_children .
588
+ == == == =
589
+ def __init__ (self , locations , color = None , weight = None , opacity = None , latlon = True ):
590
+ """Creates a MultiPolyLine object to append into a map with Map.add_child.
591
+ >>>>>>> fb52791... Renaming add_children -> add_child
528
592
529
593
Parameters
530
594
----------
0 commit comments