Skip to content

Commit abe7fac

Browse files
authored
Merge pull request #575 from martinRenou/clean_docs
Clean docs
2 parents 9aa0620 + feeaab7 commit abe7fac

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ ipyleaflet/static/
1212
.DS_Store
1313

1414
js/jupyter-leaflet-*.tgz
15+
16+
# Documentation data files
17+
docs/*.csv
18+
docs/*.json
19+
docs/*.nc

docs/source/api_reference/legend_control.rst

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,32 @@ Example
77
.. jupyter-execute::
88

99
from ipyleaflet import Map, LegendControl
10-
mymap = Map(center=(-10,-45), zoom=4)
11-
a_legend = LegendControl({"low":"#FAA", "medium":"#A55", "High":"#500"}, name="Legend", position="bottomright")
12-
mymap.add_control(a_legend)
13-
mymap
10+
11+
m = Map(center=(-10,-45), zoom=4)
12+
13+
legend = LegendControl({"low":"#FAA", "medium":"#A55", "High":"#500"}, name="Legend", position="bottomright")
14+
m.add_control(legend)
15+
16+
m
1417

1518
.. jupyter-execute::
1619

17-
# manipulate the legend
20+
# Manipulate the legend
1821

19-
# legend title
20-
a_legend.name = "Risk" ## set name
21-
a_legend.name # get name
22+
# Set/Get legend title
23+
legend.name = "Risk" # Set name
24+
legend.name # Get name
2225

23-
# legend content
24-
a_legend.legends = {"el1":"#FAA", "el2":"#A55", "el3":"#500"} #set content
25-
a_legend.legends # get content
26-
a_legend.add_legend_element("el5","#000") # add a legend element
27-
a_legend.remove_legend_element("el5") # remove a legend element
26+
# Set/Get legend content
27+
legend.legends = {"el1":"#FAA", "el2":"#A55", "el3":"#500"} # Set content
28+
legend.legends # Get content
2829

30+
legend.add_legend_element("el5","#000") # Add a legend element
31+
legend.remove_legend_element("el5") # Remove a legend element
2932

3033
# legend position
31-
a_legend.positionning ="topright"
32-
a_legend.positionning # get current positionning
34+
legend.position = "topright" # Set position
35+
legend.position # Get current position
3336

3437
Attributes
3538
----------
@@ -38,6 +41,6 @@ Attributes
3841
Attribute Default Value Doc
3942
================ ================ ===
4043
position 'topleft' Position of the control, can be 'bottomleft', 'bottomright', 'topleft', or 'topright'
41-
legend None a dictionnary that represents the legend
42-
title "Legend" LegendControl name
44+
legend None A dictionary containing the name->color mapping that represents the legend
45+
title 'Legend' Legend name
4346
================ ================ ===

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sphinx_rtd_theme
33

44
extensions = [
5-
'jupyter_sphinx.execute',
5+
'jupyter_sphinx',
66
]
77

88
templates_path = ['_templates']

0 commit comments

Comments
 (0)