@@ -33,7 +33,7 @@ class WmsTileLayer(Layer):
33
33
transparent: bool, default True
34
34
Whether the layer shall allow transparency.
35
35
attr: str, default None
36
- The attribution of the service. Will be displayed in the bottom right corner.
36
+ The attribution of the service. Displayed in the bottom right corner.
37
37
name : string, default None
38
38
The name of the Layer, as it will appear in LayerControls
39
39
overlay : bool, default False
@@ -44,7 +44,8 @@ class WmsTileLayer(Layer):
44
44
def __init__ (self , url , format = None , layers = None ,
45
45
transparent = True , attr = None ,
46
46
name = None , overlay = True , control = True ):
47
- super (WmsTileLayer , self ).__init__ (overlay = overlay , control = control , name = name )
47
+ super (WmsTileLayer , self ).__init__ (overlay = overlay ,
48
+ control = control , name = name )
48
49
self ._name = 'WmsTileLayer'
49
50
self .tile_name = name if name is not None else 'WmsTileLayer_' + self ._id
50
51
self .url = url
@@ -157,8 +158,8 @@ class Vega(Element):
157
158
----------
158
159
data: JSON-like str or object
159
160
The Vega description of the chart.
160
- It can also ba any object that has a method `to_json`, so that you can (for instance)
161
- provide a `vincent` chart.
161
+ It can also be any object that has a method `to_json`,
162
+ so that you can (for instance) provide a `vincent` chart.
162
163
width: int or str, default None
163
164
The width of the output element.
164
165
If None, either data['width'] (if available) or '100%' will be used.
@@ -168,11 +169,11 @@ class Vega(Element):
168
169
If None, either data['width'] (if available) or '100%' will be used.
169
170
Ex: 120, '120px', '80%'
170
171
left: int or str, default '0%'
171
- The horizontal distance of the output with respect to the parent HTML object.
172
- Ex: 120, '120px', '80%'
172
+ The horizontal distance of the output with respect to the parent
173
+ HTML object. Ex: 120, '120px', '80%'
173
174
top: int or str, default '0%'
174
- The vertical distance of the output with respect to the parent HTML object.
175
- Ex: 120, '120px', '80%'
175
+ The vertical distance of the output with respect to the parent
176
+ HTML object. Ex: 120, '120px', '80%'
176
177
position: str, default 'relative'
177
178
The `position` argument that the CSS shall contain.
178
179
Ex: 'relative', 'absolute'
@@ -278,8 +279,10 @@ class GeoJson(Layer):
278
279
... '#00ff00'}
279
280
>>> GeoJson(geojson, style_function=style_function)
280
281
"""
281
- def __init__ (self , data , style_function = None , name = None , overlay = True , control = True ):
282
- super (GeoJson , self ).__init__ (name = name , overlay = overlay , control = control )
282
+ def __init__ (self , data , style_function = None , name = None ,
283
+ overlay = True , control = True ):
284
+ super (GeoJson , self ).__init__ (name = name , overlay = overlay ,
285
+ control = control )
283
286
self ._name = 'GeoJson'
284
287
if hasattr (data , 'read' ):
285
288
self .embed = True
@@ -309,7 +312,8 @@ def __init__(self, data, style_function=None, name=None, overlay=True, control=T
309
312
raise ValueError ('Unhandled object {!r}.' .format (data ))
310
313
311
314
if style_function is None :
312
- def style_function (x ): return {}
315
+ def style_function (x ):
316
+ return {}
313
317
self .style_function = style_function
314
318
315
319
self ._template = Template (u"""
@@ -322,8 +326,10 @@ def style_function(x): return {}
322
326
""" ) # noqa
323
327
324
328
def style_data (self ):
325
- """Applies self.style_function to each feature of self.data and returns a corresponding
326
- JSON output.
329
+ """
330
+ Applies `self.style_function` to each feature of `self.data` and
331
+ returns a corresponding JSON output.
332
+
327
333
"""
328
334
if 'features' not in self .data .keys ():
329
335
# Catch case when GeoJSON is just a single Feature or a geometry.
@@ -409,7 +415,8 @@ class TopoJson(Layer):
409
415
"""
410
416
def __init__ (self , data , object_path , style_function = None ,
411
417
name = None , overlay = True , control = True ):
412
- super (TopoJson , self ).__init__ (name = name , overlay = overlay , control = control )
418
+ super (TopoJson , self ).__init__ (name = name , overlay = overlay ,
419
+ control = control )
413
420
self ._name = 'TopoJson'
414
421
if 'read' in dir (data ):
415
422
self .embed = True
@@ -424,7 +431,8 @@ def __init__(self, data, object_path, style_function=None,
424
431
self .object_path = object_path
425
432
426
433
if style_function is None :
427
- def style_function (x ): return {}
434
+ def style_function (x ):
435
+ return {}
428
436
self .style_function = style_function
429
437
430
438
self ._template = Template (u"""
@@ -440,8 +448,10 @@ def style_function(x): return {}
440
448
""" ) # noqa
441
449
442
450
def style_data (self ):
443
- """Applies self.style_function to each feature of self.data and returns a corresponding
444
- JSON output.
451
+ """
452
+ Applies self.style_function to each feature of self.data and returns
453
+ a corresponding JSON output.
454
+
445
455
"""
446
456
def recursive_get (data , keys ):
447
457
if len (keys ):
@@ -510,7 +520,8 @@ class MarkerCluster(Layer):
510
520
Whether the Layer will be included in LayerControls
511
521
"""
512
522
def __init__ (self , name = None , overlay = True , control = True ):
513
- super (MarkerCluster , self ).__init__ (name = name , overlay = overlay , control = control )
523
+ super (MarkerCluster , self ).__init__ (name = name , overlay = overlay ,
524
+ control = control )
514
525
self ._name = 'MarkerCluster'
515
526
self ._template = Template (u"""
516
527
{% macro script(this, kwargs) %}
@@ -640,8 +651,11 @@ def __init__(self, location, radius=500, color='black',
640
651
641
652
642
653
class LatLngPopup (MacroElement ):
643
- """When one clicks on a Map that contains a LatLngPopup, a popup is shown that displays
644
- the latitude and longitude of the pointer."""
654
+ """
655
+ When one clicks on a Map that contains a LatLngPopup,
656
+ a popup is shown that displays the latitude and longitude of the pointer.
657
+
658
+ """
645
659
def __init__ (self ):
646
660
super (LatLngPopup , self ).__init__ ()
647
661
self ._name = 'LatLngPopup'
0 commit comments