The list of violations
The free editor gives the violations of the active rules as data (editor.regelVerstoesse())
and moves the map to an element on request (editor.zeigeElement(layer, element)). The list is the panel on top of
that, from the entry @vectorstream/pro/ui. The application of this repository shows it above the layer tree; it is also
a function you can call in your own page.
baueVerstossliste(editor: Editor, behaelter: HTMLElement, optionen?: VerstosslisteOptionen): HTMLElement
It appends a section to behaelter and returns it. The list follows the editor by itself: it redraws on every change.
While there is no rule at all, it is hidden; with rules but no violation it says so in one line.
What an entry says and does#
One entry stands for one violating element; a line chain counts once, not each of its edges. An entry names the layer, the
kind of element and its label (the attribute text, else the first two other values, else the id), and in a second
line what is wrong, worded for each of the twelve kinds of rule. At most 100 entries are drawn; the rest is summed
up in a line.
A click, Enter or Space on an entry moves the map to the element, activates the layer the element belongs to and selects
the element. For abdeckung and lueckenlos that layer can be the target layer. A locked layer is shown on the map but cannot be
activated: nothing is selected, and the editor's message is given to the application (see melde). A hidden layer is
treated alike: the map moves to the element, but the layer is not activated and nothing is selected, and the list's own
message ("The layer … is hidden. Show it to select the element.") is given to the application the same way.
What the list takes#
All options are optional; with none the list draws at once and runs actions directly.
| Option | Meaning |
|---|---|
melde(aktion) |
Runs the action behind a click. The place where an application shows what went wrong, for example as a message; nothing may escape from a click handler. |
aufschieben(zeichne) |
Gets the function that draws and returns a function that asks for a redraw, possibly later. An application that must not move entries under a pressed pointer waits for the release here. |
hinweis(regeln) |
The sentence about rules the editor keeps but cannot check, or null; it is shown as a line below the list. |
How it redraws#
The list is reconciled, not rebuilt: an entry keeps its button as long as its rule and element stay, so a redraw on every change does not take the focus away. If the focused entry vanishes because the violation was fixed, the focus moves to the entry that took its place. The numbers use the language's format. The panel's texts are in the Pro message table and follow the language of the page.
For how fast the check behind the list is, see Performance. The rules dialog and the placement of the list in the application are described in Rules between layers (Pro).