A new major release that brings a lot of important updates for EOmaps!
- Export figures as vektor graphics (and export to clipboard with *ctrl+c*)
- Extensive re-work of the companion-widget (new design and new features)
- Basic command line interface
- Improved documentation (incl. a [Contribution Guide](https://eomaps.readthedocs.io/en/dev/contribute.html) and an [API Reference](https://eomaps.readthedocs.io/en/dev/generated/eomaps.html))
- Improved Jupyter Notebook support
- Editable annotations
- Logging
Interested in contributing to EOmaps? Checkout the new [Contribution Guide](https://eomaps.readthedocs.io/en/dev/contribute.html) on how to get started!
🌳 New
🗺 Export figures as vector graphics
Export routines have been re-worked! Now its possible to export figures as vector graphics (svg, pdf, eps) in addition to rasterized images (png, jpeg, tiff, ...)!
- use `m.savefig(rasterize_data=False)` to control if datasets are exported as vectors or not
- by default datasets are rasterized even on vector export to avoid creating very large files
Checkout the corresponding [section in the docs](https://eomaps.readthedocs.io/en/dev/api_basics.html#image-export-jpeg-png-svg-etc) for more details.
📦 Directly export figures to the clipboard (`ctrl + c`)!
This is really useful to quickly copy-paste the current state of a figure at runtime to other programs (e.g. paste figures in documents or in an image-editing software for post-processing)
The export can be customized (file-type, dpi, etc.)
- simply adjust the most important parameters in the [Companion Widget](https://eomaps.readthedocs.io/en/latest/api.html#companion-widget)
(currently set values are used for clipboard export)
- or use `m.set_clipboard_kwargs(...)` to programmatically set clipboard-export parameters
🧰 Companion Widget updates
The companion widget has been extensively re-worked:
- New design with a nice and clean look and greatly improved usability
- New features:
- Human readable names for artists in the editor
- Assign transparencies to individual layers
- Currently set export parameters are now used as parameters for export to clipboard
(e.g. whenever `ctrl + c` is pressed)
- set arrow/patch/text/colors for annotations (and a button to make existing annotations editable)
<img src=https://raw.githubusercontent.com/raphaelquast/EOmaps/dev/docs/_static/minigifs/companion_widget.gif width=50%>
Checkout the corresponding [section in the docs](https://eomaps.readthedocs.io/en/dev/api_companion_widget.html) for more details.
🔍 Zoomable InsetMaps
[InsetMaps](https://eomaps.readthedocs.io/en/dev/api_inset_maps.html) can now be zoomed (and indicator patches are updated accordingly)
Editable Annotations
The `AnnotationEditor` allows you to interactively place (or edit existing) annotations!
- Set text, colors, patch and arrow designs
- Drag textbox and anchor position
✑ Command Line Interface
EOmaps can now be used directly from the terminal via the `eomaps` command!
The following options can be provided:
- `--help` get some help
- `--crs <crs identifier>` set the crs of the map
- `--location <location>`set the map extent to the queried location`
- `--file <path>` open a file for plotting
- `--ne <feature name>` add basic features to the map
- `--wms <wms name>` add some selected WebMaps to the map
For example: `eomaps --crs 4326 --ne coastline --ne ocean --location europe
Checkout the corresponding [section in the docs](https://eomaps.readthedocs.io/en/dev/api_command_line_interface.html) for more details.
Updates for Jupyter Notebooks
It is now possible to use the companion widget in jupyter notebooks!
To support using the widget, use the [ipympl](https://matplotlib.org/ipympl/) backend together with the `%gui qt` command!
python
%matplotlib widget
%gui qt
from eomaps import Maps
m = Maps()
m.add_feature.preset("coastline", "ocean")
Logging
Proper `logging` has finally been implemented!
To set the log-level (and customize log message formatting), use:
python
from eomaps import Maps, set_loglevel
set_loglevel("info")
m = Maps(3857)
m.set_data([1, 2, 3], [1, 2, 3], [1, 2, 3], crs=4326)
m.plot_map()
📖 Documentation updates
The [documentation](https://eomaps.readthedocs.io) has been extensively updated to make it cleaner and easier to navigate.
- Improved document structure and proper cross-referencing throughout the docs
- Many updates on individual chapters
- New chapter [🚀 Contribution Guide](https://eomaps.readthedocs.io/en/dev/contribute.html)
additional new features worth mentioning:
- There is a new way to add multiple preset features to a map in one go:
python
m = Maps()
m.add_feature.preset("coastline", "ocean", "land")
- New (shorter) syntax for delayed actions that initialize a new layer:
python
def func(m):
m.add_feature.preset.coastline()
m = Maps()
m.on_layer_activation(func, layer="my_layer")
- It is now possible to select if callbacks are executed on all layers or only on the visible layer (see `m.cb.<method>.set_execute_on_all_layers()` )
- There is a new convenience method `m.add_title(...)` to add a title to a map
- The new class-method `Maps.config(...)` can be used to set global config variables
(backend specific configs, default shortcuts etc.)
⚠️ Depreciations
- `m.set_data_specs(...)` is deprecated and will be removed in the next minor version. Use `m.set_data(...)` instead!
- `m_inset.indicate_inset_extent` is deprecated, Use `m_inset.add_extent_indicator` instead!
> A lot of code re-factoring has been done to better follow [PEP8 naming conventions](https://peps.python.org/pep-0008/#naming-conventions).
> Most of the changes concern internal class and function definitions and should not affect public API.
>
> For more details see [From EOmaps v6.x to v7.x]():
🔨 Fixes
- properly cross-reference functions in docs
- fix companion-widget init for maps in already initialized figures
- better caching for transformers and crs objects
- unify handling of default PyQt5 keypress callbacks
- avoid recursions caused by dynamically updated grids on savefig
- fix performance issue with `m.get_extent`
- fix colorbar causing singular matrix errors with hist_size=1
- only warn for vmin/vmax=None if data is not inherited
- fix clearing peek-layer callback markers on savefig
- make sure "all" layer callbacks are executed after normal layers
- fix performance issues with the LayoutEditor
- allow activating the LayoutEditor if toolbar actions are active
- fix InsetMaps._parent override on init
- fix clearing temp artists on Maps-cleanup
- fix search radius crs when using geod_circles
- fix dataset-Maps object identification for semi-transparent layers
- fix treatment of figure background patches
- fix issues with jupyter notebook `inline` backend
- fix issues with LayoutEditor and jupyter notebook `ipympl` backend
- avoid using black dots in the LayoutEditor to support dark themes
- fix cleanup of data_manager callbacks on consecutive calls to plot_map
- fix activating current layer on control+click on tab-widget
- cache combined layers only if necessary
- avoid unnecessary draws in shape-drawer
- avoid duplicated snapshots on update with inline backend
- fix using the companion widgets with backends other than PyQt5
- fix shade canvas size updates on figure resize events