Creates a new DiagramTopMenu.
The diagram view this menu operates on.
Optionalconfig: DiagramTopMenuConfigOptional configuration overriding the default action layouts.
Protected ReadonlyhostProtected ReadonlyconfigProtectedtargetProtectedmenuProtectedtopThe top-level menu items, including both dropdowns and individual items.
ProtecteddropAll dropdown menus, extracted from the top-level items.
Protected OptionalselectedThe currently selected dropdown menu, if any.
Protected OptionalactiveThe currently opened dropdown menu, if any.
Protected OptionalselectedThe currently selected menu item, if any. This may be a top-level dropdown or a menu item inside a dropdown.
Returns true when the menu is currently visible.
Permanently removes the menu and cleans up listeners.
Optionalparent: HTMLElementOptionalparent: HTMLElementProtectedaddAppends a visual separator line.
Optionalparent: HTMLElementHides any visible dropdown menus.
A context menu pre-populated with diagram editing actions.
Wire it to a DiagramView by assigning to
view.contextMenu. The view will call open() when a right-click event fires.Example