Skip to content

Commit

Permalink
Merge pull request #953 from HaudinFlorence/dev
Browse files Browse the repository at this point in the history
Updates on ipyleaflet documentation
  • Loading branch information
martinRenou authored Apr 1, 2022
2 parents 235f7e8 + 1b0a040 commit a54fbb4
Show file tree
Hide file tree
Showing 44 changed files with 272 additions and 520 deletions.
9 changes: 9 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2

build:
os: "ubuntu-20.04"
tools:
python: "mambaforge-4.10"

conda:
environment: docs/environment.yml
20 changes: 20 additions & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ipyleaflet-docs

channels:
- conda-forge

dependencies:
- yarn
- jupyterlab
- jupyter-packaging
- jupyter-sphinx
- scipy
- netcdf4
- geopandas
- xarray
- branca
- shapely
- pip:
- ..


8 changes: 0 additions & 8 deletions docs/requirements.txt

This file was deleted.

5 changes: 5 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
API Reference
----------

.. automodule:: ipyleaflet.leaflet
:members:
16 changes: 2 additions & 14 deletions docs/source/api_reference/antpath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,5 @@ Like most widgets in ipyleaflet, the ``AntPath`` can be dynamically updated from
Attributes
----------

===================== ===================== ===
Attribute Default Value Doc
===================== ===================== ===
locations [] List of path points as (lat, lng) couples
color '#0000FF' Background color for the path
pulse_color '#FFFFFF' Color of the moving ants on the path
paused False Whether the ants are moving or not
reverse False Whether the ants are moving in reverse or not
use 'polyline' Which shape is drawn, possible values are 'polyline', 'polygon', 'rectangle' and 'circle'
dash_array [10, 20] Dash pattern for lines as a list of non-negative numbers
weight 5 Lines weight
delay 400 Ants speed
radius 10 Radius of the circle, if ``use`` is set to 'circle'
===================== ===================== ===
.. autoclass:: ipyleaflet.leaflet.AntPath
:members:
10 changes: 2 additions & 8 deletions docs/source/api_reference/awesome_icon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,5 @@ Unlike other widgets in ipyleaflet, the ``AwesomeIcon`` widget is not dynamic. I
Attributes
----------

===================== ===================== ===
Attribute Default Value Doc
===================== ===================== ===
name 'home' Name of the Font-Awesome icon
marker_color 'blue' Marker background color
icon_color 'white' Icon color
spin False Whether the icon is spinning or not
===================== ===================== ===
.. autoclass:: ipyleaflet.leaflet.AwesomeIcon
:members:
15 changes: 2 additions & 13 deletions docs/source/api_reference/choropleth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,5 @@ The ``Choropleth`` layer is then created specifying on which key the colormap is
Attributes
----------

============== ========================== ===========
Attribute Default Doc
============== ========================== ===========
geo_data {} Data dictionary
choro_data {} Mapping key -> float data for constructing the colormap
key_on 'id' Key used for the colormap construction
value_min Color scale minimum value
value_max Color scale maximum value
colormap OrRd_06 Map of color from branca
style Style dictionary
hover_style Hover style dictionary
style_callback Styling function that is called for each feature, and should return the feature style. This styling function takes the feature, the colormap function and the key data as arguments.
============== ========================== ===========
.. autoclass:: ipyleaflet.leaflet.Choropleth
:members:
18 changes: 2 additions & 16 deletions docs/source/api_reference/circle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,5 @@ Example
Attributes
----------

============== ================ ===
Attribute Default Value Doc
============== ================ ===
location (0.0, 0.0) Circle location
radius 10 Circle radius in meters
stroke True Set it to `false` to disable borders
color "#0033FF" Stroke color
opacity 1.0 Stroke opacity
weight 5 Stroke width in pixels
fill True Whether to fill the circle or not
fill_color None
fill_opacity 0.2
dash_array
line_cap "round"
line_join "round"
============== ================ ===
.. autoclass:: ipyleaflet.leaflet.Circle
:members:
18 changes: 2 additions & 16 deletions docs/source/api_reference/circle_marker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,5 @@ Example
Attributes
----------

============== ================ ===
Attribute Default Value Doc
============== ================ ===
location (0.0, 0.0) Circle location
radius 10 Circle radius in pixels
stroke True Set it to `false` to disable borders
color "#0033FF" Stroke color
opacity 1.0 Stroke opacity
weight 5 Stroke width in pixels
fill True Whether to fill the circle or not
fill_color None
fill_opacity 0.2
dash_array
line_cap "round"
line_join "round"
============== ================ ===
.. autoclass:: ipyleaflet.leaflet.CircleMarker
:members:
11 changes: 2 additions & 9 deletions docs/source/api_reference/divicon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,5 @@ Example
Attributes
----------

===================== ===================== ===
Attribute Default Value Doc
===================== ===================== ===
html '' Custom HTML code to put inside the div element,
bg_pos (0, 0) Optional relative position of the background, in pixels.
icon_size (10, 10) size icon will be rendered
icon_anchor (0, 0) anchor point of icon
popup_anchor (0, 0) anchor point of popup
===================== ===================== ===
.. autoclass:: ipyleaflet.leaflet.DivIcon
:members:
2 changes: 2 additions & 0 deletions docs/source/api_reference/draw_control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Draw Control

The ``DrawControl`` allows one to draw shapes on the map such as ``Rectangle`` ``Circle`` or lines.

Example
-------
.. jupyter-execute::

from ipyleaflet import Map, basemaps, basemap_to_tiles, DrawControl
Expand Down
9 changes: 4 additions & 5 deletions docs/source/api_reference/fullscreen_control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ Example

m

Attribute
-------

================ ================ ===
Attribute Default Value Doc
================ ================ ===
position 'topleft' Position of the control, can be 'bottomleft', 'bottomright', 'topleft', or 'topright'
================ ================ ===
.. autoclass:: ipyleaflet.leaflet.FullScreenControl
:members:
25 changes: 5 additions & 20 deletions docs/source/api_reference/geo_json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,9 @@ The ``GeoJSON`` layer is a widget, which means that you can update the ``data``
geo_json.hover_style = new_hover_style
Attributes
----------

============== ===
Attribute Doc
============== ===
data Data dictionary
style Style dictionary
hover_style Hover style dictionary
style_callback Styling function that is called for each feature, and should return the feature style. This styling function takes the feature as argument.
============== ===

Methods
-------
Attributes and methods
----------------------

.. autoclass:: ipyleaflet.leaflet.GeoJSON
:members:

========= ===================================== ===
Method Arguments Doc
========= ===================================== ===
on_click Callable object Adds a callback on click event
on_hover Callable object Adds a callback on hover event
========= ===================================== ===
10 changes: 2 additions & 8 deletions docs/source/api_reference/geodata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,5 @@ Points example:
Attributes
----------

============ ========================== ===========
Attribute Doc Description
============ ========================== ===========
geo_data Data dictionary GeoDataFrame
style Style dictionary
hover_style Hover style dictionary
point_style Point decorations Used to represent point data on the map as CircleMarkers. If absent, points will be represented by Markers.
============ ========================== ===========
.. autoclass:: ipyleaflet.leaflet.GeoData
:members:
13 changes: 2 additions & 11 deletions docs/source/api_reference/heatmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ Example
Attributes
----------

============== =================================================================== ====
Attribute Default Value Doc
============== =================================================================== ====
locations [] List of center locations
min_opacity 0.05 Minimum opacity the heat will start at
max_zoom 18 Zoom level where max intensity is reached
max 1.0 Maximum point intensity
radius 25.0 Radius of each "point" of the heatmap
blur 15.0 Amount of blur
gradient {0.4: 'blue', 0.6: 'cyan', 0.7: 'lime', 0.8: 'yellow', 1.0: 'red'} Color gradient config
============== =================================================================== ====
.. autoclass:: ipyleaflet.leaflet.Heatmap
:members:

13 changes: 2 additions & 11 deletions docs/source/api_reference/icon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,5 @@ Example
Attributes
----------

===================== ===================== ===
Attribute Default Value Doc
===================== ===================== ===
icon_url '' url for icon
shadow_url None url for icon shadow
icon_size (10, 10) size icon will be rendered
shadow_size (10, 10) size icon shadow will be rendered
icon_anchor (0, 0) anchor point of icon
shadow_anchor (0, 0) anchor point of shadow
popup_anchor (0, 0) anchor point of popup
===================== ===================== ===
.. autoclass:: ipyleaflet.leaflet.Icon
:members:
8 changes: 2 additions & 6 deletions docs/source/api_reference/image_video_overlay.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,5 @@ Example VideoOverlay
Attributes
----------

=========== ======================== ===
Attribute Default Value Doc
=========== ======================== ===
url "" An http url to the footage or a relative path to a local file (image/video). Note that absolute local paths are not supported.
bounds ((0.0, 0.0), (0.0, 0.0)) SW and NE corners of the image
=========== ======================== ===
.. autoclass:: ipyleaflet.leaflet.VideoOverlay
:members:
18 changes: 2 additions & 16 deletions docs/source/api_reference/layer_group.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,5 @@ Example
Attributes
----------

============== ================ ===
Attribute Default Value Doc
============== ================ ===
layers () List of layers
============== ================ ===

Methods
-------

============== ===================================== ===
Method Arguments Doc
============== ===================================== ===
add_layer Layer instance Add a new layer to the group
remove_layer Layer instance Remove a layer from the group
clear_layers Remove all layers from the group
============== ===================================== ===
.. autoclass:: ipyleaflet.leaflet.LayerGroup
:members:
6 changes: 6 additions & 0 deletions docs/source/api_reference/layers_control.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
Layers Control
==============



The ``LayersControl`` allows one to display a layer selector on the map in order
to select which layers to display on the map.

All layers have a ``name`` attribute which is displayed in the selector and can be changed
by the user.

Example
-------

.. jupyter-execute::

from ipyleaflet import Map, Marker, LayersControl
Expand All @@ -24,3 +29,4 @@ by the user.
m.add_control(control)

m

9 changes: 2 additions & 7 deletions docs/source/api_reference/legend_control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,5 @@ Example
Attributes
----------

================ ================ ===
Attribute Default Value Doc
================ ================ ===
position 'topleft' Position of the control, can be 'bottomleft', 'bottomright', 'topleft', or 'topright'
legend None A dictionary containing the name->color mapping that represents the legend
title 'Legend' Legend name
================ ================ ===
.. autoclass:: ipyleaflet.leaflet.LegendControl
:members:
7 changes: 2 additions & 5 deletions docs/source/api_reference/local_tile_layer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@ In JupyterLab, the path is relative to the server (where you started JupyterLab)
Attributes
----------

=============== ================= =====
Attribute Default Value Doc
=============== ================= =====
path "" Relative URL (e.g. 'tiles/{z}/{x}/{y}.png' or 'files/tiles/{z}/{x}/{y}.png' in JupyterLab)
=============== ================= =====
.. autoclass:: ipyleaflet.leaflet.LocalTileLayer
:members:
12 changes: 2 additions & 10 deletions docs/source/api_reference/magnifying_glass.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,5 @@ Example
Attributes
----------

============== =================================================================== ====
Attribute Default Value Doc
============== =================================================================== ====
radius 100 Radius of the magnifying glass in pixels.
zoom_offset 3 Zoom level offset between the main map zoom and the magnifying glass.
fixed_zoom -1 Fixed zoom level to always use (if different than -1).
fixed_position False If True, the magnifying glass will stay at the same position.
lat_lng [0, 0] Initial position of the magnifying glass.
layers [] Set of layers to display in the magnified view.
============== =================================================================== ====
.. autoclass:: ipyleaflet.leaflet.MagnifyingGlass
:members:
Loading

0 comments on commit a54fbb4

Please sign in to comment.