diff --git a/future_changes.md b/future_changes.md index cb6c690e030..f0f62dc710c 100644 --- a/future_changes.md +++ b/future_changes.md @@ -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. diff --git a/python-package/lets_plot/__init__.py b/python-package/lets_plot/__init__.py index 8abb5f70258..741a3a8b772 100644 --- a/python-package/lets_plot/__init__.py +++ b/python-package/lets_plot/__init__.py @@ -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() @@ -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() @@ -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() @@ -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() diff --git a/python-package/lets_plot/plot/geom.py b/python-package/lets_plot/plot/geom.py index 855cb566e69..43f7bee29e0 100644 --- a/python-package/lets_plot/plot/geom.py +++ b/python-package/lets_plot/plot/geom.py @@ -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. diff --git a/python-package/lets_plot/plot/geom_livemap_.py b/python-package/lets_plot/plot/geom_livemap_.py index b19d0b2fd78..6e3e1912f1c 100644 --- a/python-package/lets_plot/plot/geom_livemap_.py +++ b/python-package/lets_plot/plot/geom_livemap_.py @@ -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://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://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 @@ -95,9 +100,10 @@ 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'], @@ -105,7 +111,7 @@ def geom_livemap(*, '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")