# Diagram toolbar and context menu

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

Use the diagram editor toolbar to quickly access actions and the context menu to manage the displayed diagram.

## Toolbar

| Item | Description |
| --- | --- |
|  ![the Key Columns button](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnGoldKey.svg)  |  (Available when you work with databases.)  Click this button to show primary key columns in the diagram. |
|  ![The Columns button](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.column.svg)  |    (Available when you work with databases.) Toggles the display of the following:       * For a database object visualization: show or hide the columns other than the primary key columns in the diagram.    * For a query map: show or hide the query attributes. These attributes can be a number of rows, index names, or any other additional information about the query.    |
|  ![The Virtual foreign keys button](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.virtualForeignKey.svg)  |  (Available when you work with databases.)  Click this button to hide or show virtual foreign keys in the diagram.  |
|  ![The Comments button](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.balloon.svg)  |  (Available when you work with databases.)  Click this button to hide or show comments in the diagram.  |
|  ![Association fields](https://resources.jetbrains.com/help/img/idea/2026.3/ruby.icons.rails.associationColumn.svg)  | Click this button to show association fields in the tables, and hence the links between the associated tables. |
|  ![Migration fields](https://resources.jetbrains.com/help/img/idea/2026.3/app.nodes.dataColumn.svg)  | Click this button to show migration fields in the tables. |
|  ![System DB fields](https://resources.jetbrains.com/help/img/idea/2026.3/ruby.icons.rails.diagrams.systemDbField.svg)  | Click this button to show fields generated by the database management system. |
|  ![Own fields](https://resources.jetbrains.com/help/img/idea/2026.3/ruby.icons.ruby.nodes.variable.svg)  | Click this button to show own fields. |
|  ![Actual Size](https://resources.jetbrains.com/help/img/idea/2026.3/app.graph.actualZoom.svg)   | Click this icon to restore the actual size of the diagram. |
|  ![Fit Content](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.image.fitContent.svg)  | Click this icon to make the contents fit into the current diagram size. |
|  ![Apply Current Layout](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.graph.graphLayout.svg)  | Click this icon to apply the current layout, selected from the Layout node of the diagram context menu. |
|  ![Route Edges](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.actions.moveToButton.svg)  | Click this icon to scale the diagram to the edges of the window. |
|  ![Copy Diagram to Clipboard](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.copy.svg)  | Click this icon to copy the diagram into the clipboard. |
|  ![Copy Selection to Clipboard](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.actions.inSelection.svg)  | Click this icon and then select any diagram area with the mouse: the selected area will be copied into the clipboard. |
|  ![Export Diagram](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.export.svg)  | Click this icon to export a diagram using various formats, which are compatible with third-party tools, to a file, to an image, or open the diagram in the browser.     ![Export Diagram](https://resources.jetbrains.com/help/img/idea/2026.3/export_diagram.png)                         You can select and configure the following options:       * ![Open in Web Editor](https://resources.jetbrains.com/help/img/idea/2026.3/app.runConfigurations.web_app.svg): click this button to select a third-party editor to which you can export the diagram.    * ![Copy Diagram to Clipboard](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.copy.svg): click this button to save the diagram to a clipboard using one of the available formats.    * ![Save diagram](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.save.svg): click this button to save the current diagram as a file. You can use one of the available formats from the list.    * ![Save image](https://resources.jetbrains.com/help/img/idea/2026.3/markdown.icons.imageGutter.svg): click this button to save the current diagram in the PNG format.    * ![Print](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.print.svg): click this button to print the diagram.    |
| ![Refresh Data Model](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.refresh.svg) | Click this button to refresh the whole diagram.  |
|  ![Open Diagram Settings](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.settings.svg)  |  Click this button to open the [Diagram settings](diagrams.html) where you can configure additional options.  |

## Context menu

The table below contains commands that are not available from the toolbar.

| Item | Description |
| --- | --- |
| Selected Element Actions | Use this option to open a list of actions that is applied to a selected element in the diagram. You can select actions to copy an element, jump to its source, find its usages, use the Navigate actions, various Git actions,  and so on.  |
| Content | Use this option to open a list of actions that help you to add new elements, show dependencies, sort elements inside the diagram, and so on .     * Add class to diagram (`Space` (Windows), `Space` (macOS), `Space` (IntelliJ IDEA Classic (macOS)), `Space` (macOS System Shortcuts), `Space` (XWin), `Space` (GNOME), `Space` (KDE), `Space` (Emacs), `Space` (Sublime Text), `Space` (Sublime Text (macOS)), `Space` (Visual Studio), `Space` (Visual Studio (macOS)), `Space` (TextMate), `Space` (NetBeans), `Space` (Eclipse), `Space` (Eclipse (macOS))): Choose this command to [add existing class](working-with-diagrams.html#class_diagram) to the diagram background.    * New (`Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Alt+Insert` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (Visual Studio), `⌘ ⌃ N` (Visual Studio (macOS)), `Ctrl+N` (TextMate), `Alt+Insert` (NetBeans), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS))): Choose this command to create a new node element or member.    * Show Categories: Choose this command to show the selected code element in the class nodes. For example, you can select Fields to see all the field elements in the classes .     > **Note:** > The rest of the commands in the list are available in the [toolbar](#toolbar).    |
| Delete | Deletes the selected diagram. |
| Analyze Graph | Use this node to select one of the commands to analyze a diagram. You can check the graph characteristics, change the focus of the graph, measure graph centrality, and so on. |
| Refactor | This node contains refactoring commands, enabled in the current context. |
| Layout | Select the desired diagram layout from the submenu. |
| Orientation | Provides you with the following orientation options: Bottom to Top, Top to Bottom, and so on. |
| Apply Current Layout | Applies the current layout, selected from the Layout node of the diagram context menu |
| Route Edges | Scales the diagram content to the edges of the diagram window. |
| Appearance | Manages the way the diagram is presented by showing the grid, edge labels, bridges. Allows you to merge edges and select edge shapes. |
| Behavior | Use this option to select commands related to the diagram behavior sucha as aligning elements against the grid, showing structure view for the selected node, or fitting the content after the layout. |
|  Copy Diagram to Clipboard  | Click this icon to copy the diagram into the clipboard. |
|  Copy Selection to Clipboard  | Click this icon and then select any diagram area with the mouse: the selected area will be copied into the clipboard. |
|  Export Diagram  | Use this option to [export a diagram](#export) using various formats, which are compatible with third-party tools, to a file, to an image, or open the diagram in the browser.  |

## See also

