Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docstrings #1098

Merged
merged 8 commits into from
May 8, 2024
1 change: 1 addition & 0 deletions future_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@

### Fixed

- Livemap: improve "tiles" documentation [[#1093](https://github.com/JetBrains/lets-plot/issues/1093)].
- Undesired vertical scroller when displaying `gggrid` in Jupyter notebook.
8 changes: 4 additions & 4 deletions python-package/lets_plot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def setup_show_ext(cls, *,
# Show the plot in the Chrome web browser for Windows.
# This is the default setup path. Replace the file path with your own if it differs.
from lets_plot import *
LetsPlot.setup_show_ext(exec = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe --app=%s')
LetsPlot.setup_show_ext(exec='C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe --app=%s')
p = ggplot() + geom_point(x=0, y=0)
p.show()

Expand All @@ -248,7 +248,7 @@ def setup_show_ext(cls, *,

# Show the plot in the Safari web browser for macOS.
from lets_plot import *
LetsPlot.setup_show_ext(exec = 'open -a safari %s')
LetsPlot.setup_show_ext(exec='open -a safari %s')
p = ggplot() + geom_point(x=0, y=0)
p.show()

Expand All @@ -261,7 +261,7 @@ def setup_show_ext(cls, *,
# Show the plot in the Chrome web browser for macOS in the application mode.
# This is the default setup path. Replace the path with your own if it differs.
from lets_plot import *
LetsPlot.setup_show_ext(exec = '/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --app=%s')
LetsPlot.setup_show_ext(exec='/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --app=%s')
p = ggplot() + geom_point(x=0, y=0)
p.show()

Expand All @@ -273,7 +273,7 @@ def setup_show_ext(cls, *,

# Show the plot in the Chrome web browser for Linux.
from lets_plot import *
LetsPlot.setup_show_ext(exec = 'google-chrome --app=%s')
LetsPlot.setup_show_ext(exec='google-chrome --app=%s')
p = ggplot() + geom_point(x=0, y=0)
p.show()

Expand Down
2 changes: 1 addition & 1 deletion python-package/lets_plot/plot/geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -6597,7 +6597,7 @@ def geom_pie(mapping=None, *, data=None, stat=None, position=None, show_legend=N
- x : x-axis value.
- y : y-axis value.
- slice : values associated to pie sectors.
- explode : values to explode slices away from their center point, detaching it from the main pie.
- explode : values to explode slices away from their center point, detaching it from the main pie. Accept values between 0 and 1.
- size : pie diameter.
- fill : fill color. String in the following formats: RGB/RGBA (e.g. "rgb(0, 0, 255)"); HEX (e.g. "#0000FF"); color name (e.g. "red"); role name ("pen", "paper" or "brush").
- alpha : transparency level of the pie. Accept values between 0 and 1.
Expand Down
16 changes: 11 additions & 5 deletions python-package/lets_plot/plot/geom_livemap_.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ def geom_livemap(*,
'epsg4326' for Equirectangular projection. `projection` only works
with vector map tiles (i.e. Lets-Plot map tiles).
tiles : str
Tiles provider, either as a string - URL for a standard raster ZXY tile provider
with {z}, {x} and {y} wildcards (e.g. 'http:https://my.tile.com/{z}/{x}/{y}.png')
or the result of a call to a `maptiles_xxx()` functions.
Tile provider:

- pass a predefined constant from the `tilesets` module (Lets-Plot's vector tiles, e.g. `LETS_PLOT_COLOR`, or external raster tiles, e.g. `OPEN_TOPO_MAP`);
- pass a URL for a standard raster ZXY tile provider with {z}, {x} and {y} wildcards (e.g. 'http:https://my.tile.com/{z}/{x}/{y}.png') if the required tileset not present in the module;
- pass the result of a call to a `maptiles_zxy()` function if further customisation is required (e.g. attribution or zoom).

More information about tiles can be found here:
https://lets-plot.org/python/pages/basemap_tiles.html
show_coord_pick_tools : bool, default=False
Show buttons "copy location" and "draw geometry".
data_size_zoomin : int, default=0
Expand Down Expand Up @@ -95,17 +100,18 @@ def geom_livemap(*,

.. jupyter-execute::
:linenos:
:emphasize-lines: 9
:emphasize-lines: 10

from lets_plot import *
from lets_plot import tilesets
LetsPlot.setup_html()
data = {
'city': ['New York City', 'Prague'],
'lon': [-73.7997, 14.418540],
'lat': [40.6408, 50.073658],
}
ggplot(data, aes(x='lon', y='lat')) + \\
geom_livemap(projection='epsg4326', tiles=maptiles_lets_plot(theme='dark')) + \\
geom_livemap(projection='epsg4326', tiles=tilesets.LETS_PLOT_DARK) + \\
geom_path(color='white', geodesic=True) + \\
geom_point(color='white', tooltips=layer_tooltips().line('@city')) + \\
ggtitle("The shortest path between New York and Prague")
Expand Down