From a00c3c315f84e2b2465a425daa55f7df030023e7 Mon Sep 17 00:00:00 2001 From: Sagar Mishra <54197164+achieveordie@users.noreply.github.com> Date: Mon, 4 Mar 2024 21:47:40 +0530 Subject: [PATCH] docs: rework Plugins page into a tabular format (#1889) * separate markdown usages of textpath and antpath plugins * remodel plugins page into a table --- docs/user_guide/plugins.rst | 74 ++++++++++++++++++- docs/user_guide/plugins/antpath.md | 41 ++++++++++ ...th_and_antpath.md => polyline_textpath.md} | 17 ----- 3 files changed, 113 insertions(+), 19 deletions(-) create mode 100644 docs/user_guide/plugins/antpath.md rename docs/user_guide/plugins/{polyline_textpath_and_antpath.md => polyline_textpath.md} (90%) diff --git a/docs/user_guide/plugins.rst b/docs/user_guide/plugins.rst index e8b372608..235bb0f48 100644 --- a/docs/user_guide/plugins.rst +++ b/docs/user_guide/plugins.rst @@ -2,8 +2,9 @@ Plugins ------- .. toctree:: - :maxdepth: 1 + :hidden: + plugins/antpath plugins/boat_marker plugins/beautify_icon plugins/draw @@ -22,7 +23,7 @@ Plugins plugins/mouse_position plugins/pattern plugins/polyline_offset - plugins/polyline_textpath_and_antpath + plugins/polyline_textpath plugins/realtime plugins/scroll_zoom_toggler plugins/search @@ -34,3 +35,72 @@ Plugins plugins/timestamped_geojson plugins/vector_tiles plugins/WmsTimeDimension + +.. list-table:: + :widths: 25 75 + :header-rows: 1 + + * - Plugin + - Description + * - :doc:`Ant Path ` + - A flux animation (like walking of ants) along a polyline. + * - :doc:`Boat Marker ` + - A boat marker using HTML canvas for displaying yachts and sailboats with heading and optional wind information. + * - :doc:`Beautify Icon ` + - Lightweight plugin that adds colorful iconic markers without image and gives full control of style to end user (i.e. Unlimited colors and CSS styling). + * - :doc:`Draw ` + - Enables drawing features like polylines, polygons, rectangles, circles and markers through a very nice user-friendly interface with icons and hints. + * - :doc:`Dual Map ` + - Synchronized view of two maps in the same window. + * - :doc:`FeatureGroup Subgroup ` + - Create Feature Groups that add their child layers into a parent group. + * - :doc:`Float Image ` + - Add a floating image in the HTML canvas on top of the map. + * - :doc:`Fullscreen ` + - A fullscreen button control for modern browsers, using HTML Fullscreen API. + * - :doc:`Geocoder ` + - A clean and extensible control for both geocoding and reverse geocoding using different geocoding providers. + * - :doc:`Grouped Layer Control ` + - Create layer control with support for grouping overlays together. + * - :doc:`Heatmap ` + - A tiny, simple and fast heatmap plugin. + * - :doc:`Heatmap with Time ` + - Create a time-aware heatmap. + * - :doc:`Locate Control ` + - Geolocate a user over an encrypted connection. + * - :doc:`Marker Cluster ` + - Beautiful, sophisticated, high performance marker clustering solution with smooth animations. + * - :doc:`Measure Control ` + - Coordinate, linear, and area measure control. + * - :doc:`Mini Map ` + - A small minimap showing the map at a different scale to aid navigation. + * - :doc:`Mouse Position ` + - A control that displays geographic coordinates of the mouse pointer, as it is moved over the map. + * - :doc:`Pattern ` + - Add support for pattern fills on Paths. + * - :doc:`Polyline Offset ` + - Shift relative pixel offset, without actually changing the actual latitude longitude values. + * - :doc:`Polyline Textpath ` + - Write text along polylines. + * - :doc:`Realtime ` + - Put realtime data (like live tracking, GPS information) on a map. + * - :doc:`Scroll Zoom Toggler ` + - Enable/Disable zooming via a button. + * - :doc:`Search ` + - A control for search Markers/Features location by custom property in LayerGroup/GeoJSON. + * - :doc:`Semi Circle ` + - Add a marker in the shape of a semicircle, similar to the Circle class. + * - :doc:`Side by Side Layers ` + - A control to add a split screen to compare two map overlays. + * - :doc:`Tag Filter Button ` + - Creates a Tag Filter Button to filter elements based on different criteria. + * - :doc:`Terminator ` + - Overlay day and night regions on a map. + * - :doc:`Timeslider Choropleth ` + - Create a choropleth with a timeslider for timestamped data. + * - :doc:`Timestamped GeoJSON ` + - Add time-aware GeoJSON into the map. + * - :doc:`Vector Tiles using VectorGridProtobuf ` + - Display gridded vector data (GeoJSON or TopoJSON sliced with geojson-vt, or protobuf vector tiles). + * - :doc:`WMS Time Dimension ` + - Create a time-aware WmsTileLayer. diff --git a/docs/user_guide/plugins/antpath.md b/docs/user_guide/plugins/antpath.md new file mode 100644 index 000000000..6afd1138b --- /dev/null +++ b/docs/user_guide/plugins/antpath.md @@ -0,0 +1,41 @@ +```{code-cell} ipython3 +--- +nbsphinx: hidden +--- +import folium +import folium.plugins +``` + + +## Antpath + +```{code-cell} ipython3 +m = folium.Map() + +wind_locations = [ + [59.35560, -31.992190], + [55.178870, -42.89062], + [47.754100, -43.94531], + [38.272690, -37.96875], + [27.059130, -41.13281], + [16.299050, -36.56250], + [8.4071700, -30.23437], + [1.0546300, -22.50000], + [-8.754790, -18.28125], + [-21.61658, -20.03906], + [-31.35364, -24.25781], + [-39.90974, -30.93750], + [-43.83453, -41.13281], + [-47.75410, -49.92187], + [-50.95843, -54.14062], + [-55.97380, -56.60156], +] + +folium.plugins.AntPath( + locations=wind_locations, reverse="True", dash_array=[20, 30] +).add_to(m) + +m.fit_bounds(m.get_bounds()) + +m +``` diff --git a/docs/user_guide/plugins/polyline_textpath_and_antpath.md b/docs/user_guide/plugins/polyline_textpath.md similarity index 90% rename from docs/user_guide/plugins/polyline_textpath_and_antpath.md rename to docs/user_guide/plugins/polyline_textpath.md index d45374b8d..5c39828e3 100644 --- a/docs/user_guide/plugins/polyline_textpath_and_antpath.md +++ b/docs/user_guide/plugins/polyline_textpath.md @@ -6,9 +6,6 @@ import folium import folium.plugins ``` -# PolylineTextPath and AntPath - - ## PolyLineTextPath ```{code-cell} ipython3 @@ -92,17 +89,3 @@ folium.plugins.PolyLineTextPath(line_to_hanoi, "To Hanoi", offset=-5).add_to(m) m ``` - -## Antpath - -```{code-cell} ipython3 -m = folium.Map() - -folium.plugins.AntPath( - locations=wind_locations, reverse="True", dash_array=[20, 30] -).add_to(m) - -m.fit_bounds(m.get_bounds()) - -m -```