@@ -39,7 +39,8 @@ class WmsTileLayer(Layer):
39
39
version : str, default '1.1.1'
40
40
Version of the WMS service to use.
41
41
attr : str, default None
42
- The attribution of the service. Will be displayed in the bottom right corner.
42
+ The attribution of the service.
43
+ Will be displayed in the bottom right corner.
43
44
overlay : bool, default False
44
45
Adds the layer as an optional overlay (True) or the base layer (False).
45
46
control : bool, default True
@@ -52,7 +53,7 @@ class WmsTileLayer(Layer):
52
53
def __init__ (self , url , name = None , layers = None , styles = None , format = None ,
53
54
transparent = True , version = '1.1.1' , attr = None , overlay = True ,
54
55
control = True ):
55
- super (WmsTileLayer , self ).__init__ (overlay = overlay , control = control , name = name )
56
+ super (WmsTileLayer , self ).__init__ (overlay = overlay , control = control , name = name ) # noqa
56
57
self .url = url
57
58
self .attribution = attr if attr is not None else ''
58
59
# Options.
@@ -169,8 +170,8 @@ class Vega(Element):
169
170
----------
170
171
data: JSON-like str or object
171
172
The Vega description of the chart.
172
- It can also ba any object that has a method `to_json`, so that you can (for instance)
173
- provide a `vincent` chart.
173
+ It can also be any object that has a method `to_json`,
174
+ so that you can (for instance) provide a `vincent` chart.
174
175
width: int or str, default None
175
176
The width of the output element.
176
177
If None, either data['width'] (if available) or '100%' will be used.
@@ -180,11 +181,11 @@ class Vega(Element):
180
181
If None, either data['width'] (if available) or '100%' will be used.
181
182
Ex: 120, '120px', '80%'
182
183
left: int or str, default '0%'
183
- The horizontal distance of the output with respect to the parent HTML object.
184
- Ex: 120, '120px', '80%'
184
+ The horizontal distance of the output with respect to the parent
185
+ HTML object. Ex: 120, '120px', '80%'
185
186
top: int or str, default '0%'
186
- The vertical distance of the output with respect to the parent HTML object.
187
- Ex: 120, '120px', '80%'
187
+ The vertical distance of the output with respect to the parent
188
+ HTML object. Ex: 120, '120px', '80%'
188
189
position: str, default 'relative'
189
190
The `position` argument that the CSS shall contain.
190
191
Ex: 'relative', 'absolute'
@@ -290,8 +291,10 @@ class GeoJson(Layer):
290
291
... '#00ff00'}
291
292
>>> GeoJson(geojson, style_function=style_function)
292
293
"""
293
- def __init__ (self , data , style_function = None , name = None , overlay = True , control = True ):
294
- super (GeoJson , self ).__init__ (name = name , overlay = overlay , control = control )
294
+ def __init__ (self , data , style_function = None , name = None ,
295
+ overlay = True , control = True ):
296
+ super (GeoJson , self ).__init__ (name = name , overlay = overlay ,
297
+ control = control )
295
298
self ._name = 'GeoJson'
296
299
if hasattr (data , 'read' ):
297
300
self .embed = True
@@ -321,7 +324,8 @@ def __init__(self, data, style_function=None, name=None, overlay=True, control=T
321
324
raise ValueError ('Unhandled object {!r}.' .format (data ))
322
325
323
326
if style_function is None :
324
- def style_function (x ): return {}
327
+ def style_function (x ):
328
+ return {}
325
329
self .style_function = style_function
326
330
327
331
self ._template = Template (u"""
@@ -334,8 +338,10 @@ def style_function(x): return {}
334
338
""" ) # noqa
335
339
336
340
def style_data (self ):
337
- """Applies self.style_function to each feature of self.data and returns a corresponding
338
- JSON output.
341
+ """
342
+ Applies `self.style_function` to each feature of `self.data` and
343
+ returns a corresponding JSON output.
344
+
339
345
"""
340
346
if 'features' not in self .data .keys ():
341
347
# Catch case when GeoJSON is just a single Feature or a geometry.
@@ -421,7 +427,8 @@ class TopoJson(Layer):
421
427
"""
422
428
def __init__ (self , data , object_path , style_function = None ,
423
429
name = None , overlay = True , control = True ):
424
- super (TopoJson , self ).__init__ (name = name , overlay = overlay , control = control )
430
+ super (TopoJson , self ).__init__ (name = name , overlay = overlay ,
431
+ control = control )
425
432
self ._name = 'TopoJson'
426
433
if 'read' in dir (data ):
427
434
self .embed = True
@@ -436,7 +443,8 @@ def __init__(self, data, object_path, style_function=None,
436
443
self .object_path = object_path
437
444
438
445
if style_function is None :
439
- def style_function (x ): return {}
446
+ def style_function (x ):
447
+ return {}
440
448
self .style_function = style_function
441
449
442
450
self ._template = Template (u"""
@@ -452,8 +460,10 @@ def style_function(x): return {}
452
460
""" ) # noqa
453
461
454
462
def style_data (self ):
455
- """Applies self.style_function to each feature of self.data and returns a corresponding
456
- JSON output.
463
+ """
464
+ Applies self.style_function to each feature of self.data and returns
465
+ a corresponding JSON output.
466
+
457
467
"""
458
468
def recursive_get (data , keys ):
459
469
if len (keys ):
@@ -522,7 +532,8 @@ class MarkerCluster(Layer):
522
532
Whether the Layer will be included in LayerControls
523
533
"""
524
534
def __init__ (self , name = None , overlay = True , control = True ):
525
- super (MarkerCluster , self ).__init__ (name = name , overlay = overlay , control = control )
535
+ super (MarkerCluster , self ).__init__ (name = name , overlay = overlay ,
536
+ control = control )
526
537
self ._name = 'MarkerCluster'
527
538
self ._template = Template (u"""
528
539
{% macro script(this, kwargs) %}
@@ -652,8 +663,11 @@ def __init__(self, location, radius=500, color='black',
652
663
653
664
654
665
class LatLngPopup (MacroElement ):
655
- """When one clicks on a Map that contains a LatLngPopup, a popup is shown that displays
656
- the latitude and longitude of the pointer."""
666
+ """
667
+ When one clicks on a Map that contains a LatLngPopup,
668
+ a popup is shown that displays the latitude and longitude of the pointer.
669
+
670
+ """
657
671
def __init__ (self ):
658
672
super (LatLngPopup , self ).__init__ ()
659
673
self ._name = 'LatLngPopup'
0 commit comments