# Living Legend - QGIS Plugin
## Overview

This QGIS Plugin displays a transparent floating legend showing only layers that are visible in the current map extent. Additional decorations such as north arrow and scale bar can be activated as well. The map can be copied into clipboard or even exported as a pdf. The plugin offers shortcuts to the attribute table of the respective element and lets the user edit the legend names directly through the plugin.

## Features
- Displays a living legend that updates according to the content of the map extent
- Adds a north arrow and scale bar to the map that can be deactivated
- Zoom to layer or object, open the respective attribute table or highlight the layer in the layer panel
- Disable the item or only hide it in the legend while keeping it in the map
- Show the area or length of the item currently displayed in the map extent
- Copy map including legend and decorations to clipboard
- Export current map extent as image or pDF

## Getting started - Installation

### QGIS Plugin Manager

1. Open QGIS
2. Go to Plugins > Manage and Install Plugins
3. Search for "Living Legend"
4. Click "Install Plugin"

### Manual Installation

1. Download the latest release
2. Copy the plugin folder to:
   - Windows: `C:\Users\[USERNAME]\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\`
   - Mac/Linux: `~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/`


## Usage

1. Open your map in QGIS
2. Activate the Living Legend by clicking the Living Legend-icon in the toolbar. ![LivingLegend-icon](readme_images/pic01.png "LivingLegend icon")
3. Adjust settings in the context menu by right-clicking onto the living legend inside the map frame.

### Context Menu
![Context menu](readme_images/pic02.png "Context menu")

#### Zoom to Layer
Zooms in or out so that the whole layer with all it's items are inside the map extent.
#### Open Attribute Table
Opens the attribute table of the respective layer.
#### Jump to Layer in layers panel
Highlights the layer in the layers panel.

![Jumping to layer in layers panel](readme_images/pic03.png "Jumping to layer in layers panel")
![Highlighting Layer in layers panel](readme_images/pic04.png "Highlighting Layer in layers panel")

#### Disable Layer/Item in layers panel
Unchecks the visibility box in the layers panel so that the layer/item disappears from map and legend.

![Map before disabling item](readme_images/pic09.png "Map before disabling item")
![Disabling item in layers panel](readme_images/pic05.png "Disabling item in layers panel")
![Layers panel after disabling item](readme_images/pic07.png "Layers panel after disabling item")
![Map after disabling item](readme_images/pic10.png "Map after disabling item")


#### Hide Layer/Item in living legend

Hides the item or layer solely in the Living Legend but keep it in the map.

![Map before hiding item](readme_images/pic09.png "Map before hiding item")
![Hiding item in legend](readme_images/pic12.png "Hiding item in legend") 
![Layers panel after hiding item](readme_images/pic11.png "Layers panel after hiding item")
![Map after hiding item](readme_images/pic13.png "Map after hiding item")

#### Copy Map to clipboard

Copies the whole current map extent including the legend, north arrow and scale bar - if activated - to the clipboard. Note: only decorations from LivingLegend will be copied. This does not work wor QGIS own decorations.

#### Copy Legend to clipboard

Copies only the legend to the clipboard.

#### Export

Exports the current map extent or the legend as image (.png or .jpg) or .PDF.

#### Show Layer Name

Shows or hides the name of the items' layer in the legend.

#### Show Item Dimensions

Shows or hides the items area or length that is seen in the current map extent. It updates automatically when panning the map or zooming.

#### Show Feature Count

Shows the feature count of the legend items.

#### Show Legend Title

Shows a title for the legend which can be adjusted by the user via double-click on the legend title.

#### Sync Label Changes with QGIS Legend

Activates or deactivates the synchronisation of the Living Legend with QGIS Legend properties that are shown in the layers panel. By default, name changes in the living legend also change the item names in the layers panel. If deactivated, changing item names in the living legend will not affect the item names in the layers panel and vice versa.

![Layer panel and legend before](readme_images/pic14.png "Layer panel and legend before editing names")
![Sync activated](readme_images/pic15.png "Sync activated")
![Layer panel and legend with Sync activated](readme_images/pic16.png "Layer panel and legend with Sync activated")
![Sync deactivated](readme_images/pic17.png "Sync deactivated")
![Layer panel and legend with Sync deactivated](readme_images/pic18.png "Layer panel and legend with Sync deactivated")

#### Hidden legend items

Lets the user see a list of the hidden legend items in the current map extent and either undo the hiding for specific ones or for all at once.

#### Stick to Corner

Keeps the legend in a specific corner or side of the map, so that even when the legend grows and shrinks, the distance to the map border stays the same. If the user drags the legend into a corner, this box gets checked automatically.

#### Legend Position

Makes the legend stick to either a corner or the centre of a side of the map edge.

#### Decorations

Adds, removes or changes position of a north arrow and/or a scale bar.

#### Opacity

Changes the transparency of the legend.

#### Reset all settings to default

Resets all settings formerly changed by the user to the default settings the user experienced after install.


## Compatibility

Compatible with QGIS versions 3.34 - 4.99 (Qt 5 and Qt 6)

## License

GNU General Public License v3.0

## Author

Lukas Schnermann