# Diagrams

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

> **TL;DR**
> Show a diagram: `Ctrl+Alt+Shift+U` (Windows), `⌘ ⌥ ⇧ U` (macOS), `⌘ ⌥ ⇧ U` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ U` (macOS System Shortcuts), `Ctrl+Alt+Shift+U` (XWin), `Ctrl+Alt+Shift+U` (GNOME), `Ctrl+Alt+Shift+U` (KDE), `Ctrl+Alt+Shift+U` (Emacs), `Ctrl+Alt+Shift+U` (Sublime Text), `⌘ ⌥ ⇧ U` (Sublime Text (macOS)), `Ctrl+Alt+Shift+U` (Visual Studio), `⌘ ⌥ ⇧ U` (Visual Studio (macOS)), `Meta+Alt+Shift+U` (TextMate), `Ctrl+Alt+Shift+U` (NetBeans), `Ctrl+Alt+Shift+U` (Eclipse), `⌘ ⌥ ⇧ U` (Eclipse (macOS)) or `Ctrl+Alt+U` (Windows), `⌘ ⌥ U` (macOS), `⌘ ⌥ U` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ U` (macOS System Shortcuts), `Ctrl+Alt+U` (XWin), `Ctrl+Alt+U` (GNOME), `Ctrl+Alt+U` (KDE), `Ctrl+Alt+U` (Emacs), `Ctrl+Alt+U` (Sublime Text), `⌘ ⌥ U` (Sublime Text (macOS)), `Ctrl+Alt+U` (Visual Studio), `⌘ ⌥ U` (Visual Studio (macOS)), `Meta+Alt+U` (TextMate), `Ctrl+Alt+U` (NetBeans), `Ctrl+Alt+U` (Eclipse), `⌘ ⌥ U` (Eclipse (macOS))
>
>
>
> Diagram settings: `Settings | Tools | Diagrams`

RubyMine lets you utilize UML diagrams to analyze Ruby classes, Rails models, gem dependencies, and so on. Depending on the project type and current context (for example, a file/folder selected in a project view or a caret position in the editor), you can use the following diagram types:

* Ruby class diagram

* Rails model dependency diagram

* Gem dependency diagram

* [Database schema diagram](creating-diagrams.html)

* [JavaScript module dependency diagram](module-dependency-diagram.html)

## Show a class diagram

To display a diagram for a class, do the following:

Procedure:

1. Select the file containing the required class in the Project view `Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Meta+1` (TextMate), `Ctrl+1` (NetBeans), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS)) or open the class in the editor.

2. From the context menu, select `Diagrams | Show Diagram` `Ctrl+Alt+Shift+U` (Windows), `⌘ ⌥ ⇧ U` (macOS), `⌘ ⌥ ⇧ U` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ U` (macOS System Shortcuts), `Ctrl+Alt+Shift+U` (XWin), `Ctrl+Alt+Shift+U` (GNOME), `Ctrl+Alt+Shift+U` (KDE), `Ctrl+Alt+Shift+U` (Emacs), `Ctrl+Alt+Shift+U` (Sublime Text), `⌘ ⌥ ⇧ U` (Sublime Text (macOS)), `Ctrl+Alt+Shift+U` (Visual Studio), `⌘ ⌥ ⇧ U` (Visual Studio (macOS)), `Meta+Alt+Shift+U` (TextMate), `Ctrl+Alt+Shift+U` (NetBeans), `Ctrl+Alt+Shift+U` (Eclipse), `⌘ ⌥ ⇧ U` (Eclipse (macOS)) or `Diagrams | Show Diagram Popup` `Ctrl+Alt+U` (Windows), `⌘ ⌥ U` (macOS), `⌘ ⌥ U` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ U` (macOS System Shortcuts), `Ctrl+Alt+U` (XWin), `Ctrl+Alt+U` (GNOME), `Ctrl+Alt+U` (KDE), `Ctrl+Alt+U` (Emacs), `Ctrl+Alt+U` (Sublime Text), `⌘ ⌥ U` (Sublime Text (macOS)), `Ctrl+Alt+U` (Visual Studio), `⌘ ⌥ U` (Visual Studio (macOS)), `Meta+Alt+U` (TextMate), `Ctrl+Alt+U` (NetBeans), `Ctrl+Alt+U` (Eclipse), `⌘ ⌥ U` (Eclipse (macOS)).

3. In the invoked popup, select Ruby Class Diagram and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (TextMate), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

![The Diagram popup in a project view](https://resources.jetbrains.com/help/img/idea/2026.3/rm_diagram_project_tree_class.png)

RubyMine will show the class diagram.

![Ruby class diagram](https://resources.jetbrains.com/help/img/idea/2026.3/rm_diagram_class_example.png)

You can edit a generated diagram in various ways: add `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)) or remove `Delete` (Windows), `⌦` (macOS), `⌦` (IntelliJ IDEA Classic (macOS)), `⌦` (macOS System Shortcuts), `Delete` (XWin), `Delete` (GNOME), `Delete` (KDE), `Delete` (Emacs), `Delete` (Sublime Text), `⌦` (Sublime Text (macOS)), `Delete` (Visual Studio), `⌦` (Visual Studio (macOS)), `Delete` (TextMate), `Delete` (NetBeans), `Delete` (Eclipse), `⌦` (Eclipse (macOS)) classes, display methods and class variables, add notes, and so on.

## Show a Rails model diagram

If you work with a Rails project, you can display a dependency diagram for a Rails model. To do this:

Procedure:

* Press `Ctrl+Alt+Shift+U` (Windows), `⌘ ⌥ ⇧ U` (macOS), `⌘ ⌥ ⇧ U` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ U` (macOS System Shortcuts), `Ctrl+Alt+Shift+U` (XWin), `Ctrl+Alt+Shift+U` (GNOME), `Ctrl+Alt+Shift+U` (KDE), `Ctrl+Alt+Shift+U` (Emacs), `Ctrl+Alt+Shift+U` (Sublime Text), `⌘ ⌥ ⇧ U` (Sublime Text (macOS)), `Ctrl+Alt+Shift+U` (Visual Studio), `⌘ ⌥ ⇧ U` (Visual Studio (macOS)), `Meta+Alt+Shift+U` (TextMate), `Ctrl+Alt+Shift+U` (NetBeans), `Ctrl+Alt+Shift+U` (Eclipse), `⌘ ⌥ ⇧ U` (Eclipse (macOS)), select Rails Model Dependency Diagram in the invoked popup and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (TextMate), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)):

![Rails model diagram](https://resources.jetbrains.com/help/img/idea/2026.3/rm_diagram_model_example.png)

As for class diagrams, you can edit a model diagram: add `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)) and remove `Delete` (Windows), `⌦` (macOS), `⌦` (IntelliJ IDEA Classic (macOS)), `⌦` (macOS System Shortcuts), `Delete` (XWin), `Delete` (GNOME), `Delete` (KDE), `Delete` (Emacs), `Delete` (Sublime Text), `⌦` (Sublime Text (macOS)), `Delete` (Visual Studio), `⌦` (Visual Studio (macOS)), `Delete` (TextMate), `Delete` (NetBeans), `Delete` (Eclipse), `⌦` (Eclipse (macOS)) tables, display association, and migration fields, add notes, and so on.

RubyMine also lets you create new models right from a diagram. To do this, right-click a diagram and select New | ActiveRecord Model. Learn more at [Create models](creating-rails-application-elements.html#model).

## Work with a diagram

Procedure: Select elements in a diagram

* To select an element, click it in the diagram.

* To select multiple adjacent elements, keep `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (TextMate), `Shift` (NetBeans), `Shift` (Eclipse), `Shift` (Eclipse (macOS)) pressed and click the desired elements, or drag a lasso around the elements to be selected.

* To select multiple non-adjacent elements, keep `Ctrl+Shift` (Windows), `Ctrl+Shift` (macOS), `Ctrl+Shift` (IntelliJ IDEA Classic (macOS)), `Ctrl+Shift` (macOS System Shortcuts), `Ctrl+Shift` (XWin), `Ctrl+Shift` (GNOME), `Ctrl+Shift` (KDE), `Ctrl+Shift` (Emacs), `Ctrl+Shift` (Sublime Text), `Ctrl+Shift` (Sublime Text (macOS)), `Ctrl+Shift` (Visual Studio), `Ctrl+Shift` (Visual Studio (macOS)), `Ctrl+Shift` (TextMate), `Ctrl+Shift` (NetBeans), `Ctrl+Shift` (Eclipse), `Ctrl+Shift` (Eclipse (macOS)) pressed and click the desired elements.

* To select a member of a node element, double-click the node element, and then use the arrow keys, or the mouse pointer.

Procedure: Manage the diagram layout

* Right-click the diagram background and select the desired layout from the `Layout` submenu.

* Drag the diagram elements manually.

* If necessary, reset the customized layout to the selected from the context menu by clicking ![the Apply Current Layout button](https://resources.jetbrains.com/help/img/idea/2026.3/app.graph.layout.svg).

Procedure: Zoom in and out

* Use the ![Zoom In](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.zoomIn.svg) and ![Zoom Out](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.zoomOut.svg) toolbar buttons.

* Keeping `Ctrl` key pressed, rotate your mouse wheel up or down.

* Press `NumPad+` (Windows), `NumPad+` (macOS), `NumPad+` (IntelliJ IDEA Classic (macOS)), `NumPad+` (macOS System Shortcuts), `NumPad+` (XWin), `NumPad+` (GNOME), `NumPad+` (KDE), `NumPad+` (Emacs), `NumPad+` (Sublime Text), `NumPad+` (Sublime Text (macOS)), `NumPad+` (Visual Studio), `NumPad+` (Visual Studio (macOS)), `NumPad+` (TextMate), `NumPad+` (NetBeans), `NumPad+` (Eclipse), `NumPad+` (Eclipse (macOS)) or `NumPad-` (Windows), `NumPad-` (macOS), `NumPad-` (IntelliJ IDEA Classic (macOS)), `NumPad-` (macOS System Shortcuts), `NumPad-` (XWin), `NumPad-` (GNOME), `NumPad-` (KDE), `NumPad-` (Emacs), `NumPad-` (Sublime Text), `NumPad-` (Sublime Text (macOS)), `NumPad-` (Visual Studio), `NumPad-` (Visual Studio (macOS)), `NumPad-` (TextMate), `NumPad-` (NetBeans), `NumPad-` (Eclipse), `NumPad-` (Eclipse (macOS)).

Procedure: Use the magnifier tool

* Keep the `Alt` (Windows), `Alt` (macOS), `Alt` (IntelliJ IDEA Classic (macOS)), `Alt` (macOS System Shortcuts), `Alt` (XWin), `Alt` (GNOME), `Alt` (KDE), `Alt` (Emacs), `Alt` (Sublime Text), `Alt` (Sublime Text (macOS)), `Alt` (Visual Studio), `Alt` (Visual Studio (macOS)), `Alt` (TextMate), `Alt` (NetBeans), `Alt` (Eclipse), `Alt` (Eclipse (macOS)) key pressed, and hover over the desired areas of the diagram.

![Magnifier tool](https://resources.jetbrains.com/help/img/idea/2026.3/rm_diagram_class_magnifier.png)

Procedure: Use the Structure view

1. Open the [Structure view](viewing-structure-of-a-source-file.html) `Alt+7` (Windows), `⌘ 7` (macOS), `⌘ 7` (IntelliJ IDEA Classic (macOS)), `⌘ 7` (macOS System Shortcuts), `Alt+7` (XWin), `Alt+7` (GNOME), `Alt+7` (KDE), `Alt+7` (Emacs), `Alt+7` (Sublime Text), `⌘ 7` (Sublime Text (macOS)), `Ctrl+Alt+F` (Visual Studio), `⌃ ⌥ F` (Visual Studio (macOS)), `Meta+7` (TextMate), `Ctrl+7` (NetBeans), `Alt+7` (Eclipse), `⌘ 7` (Eclipse (macOS)) to get a "10,000-feet" look on a diagram.

![Preview a diagram](https://resources.jetbrains.com/help/img/idea/2026.3/rm_diagram_class_preview.png)

The shadow area represents the visible part of a diagram.

2. To navigate through the diagram, keep the left mouse button pressed and move the shadow area to obtain the desired view.

Procedure: Work with source code

Diagrams help you to work with source code in several ways. Right-click the desired node in a diagram and select one of the following actions:

* [Jump to Source](navigating-through-the-source-code.html#go_to_declaration) `F4` (Windows), `⌘ ↓` (macOS), `F4` (IntelliJ IDEA Classic (macOS)), `F4` (macOS System Shortcuts), `F4` (XWin), `F4` (GNOME), `F4` (KDE), `F4` (Emacs), `F4` (Sublime Text), `F4` (Sublime Text (macOS)), `F4` (Visual Studio), `⌘ ↓` (Visual Studio (macOS)), `F4` (TextMate), `F4` (NetBeans), `F12` (Eclipse), `F3` (Eclipse (macOS))

Allows you to jump to a class selected in a diagram.

* [Find Usages](find-highlight-usages.html) `Alt+F7` (Windows), `⌥ F7` (macOS), `⌥ F7` (IntelliJ IDEA Classic (macOS)), `⌃ U` (macOS System Shortcuts), `Alt+F7` (XWin), `Alt+Shift+7` (GNOME), `Alt+Shift+7` (KDE), `Alt+F7` (Emacs), `Alt+F7` (Sublime Text), `⌥ F7` (Sublime Text (macOS)), `Shift+F12` (Visual Studio), `⇧ F12` (Visual Studio (macOS)), `Alt+F7` (TextMate), `Alt+F7` (NetBeans), `Ctrl+G` (Eclipse), `⌘ ⇧ G` (Eclipse (macOS))

Finds usages of a class in a project.

* [Refactor](refactoring-source-code.html)

Allows you to perform various refactoring actions such as renaming a class or extracting a superclass.

## Analyze graph

The Analyze Graph action group lets you analyze the graph in various ways such as perform auto clusterization, measure the node centrality, search cycles, filter path between two nodes, and so on.

Procedure: Filter paths between two nodes

Most of the time, generated diagrams are big and complicated. Typically, you want to concentrate only on the specific part of the diagram. RubyMine lets you filter paths between two diagram elements.

1. In the diagram editor, select two nodes on which you want to focus and right-click one of them to open the context menu.

2. From the context menu, select `Analyze Graph | Focus On Paths Between Two Nodes`.

> **Note:**
> If you want to focus not only on just two nodes, but on how the selected node is connected with its neighbors, select the Focus on Node Neighborhood option from the context menu.

3. In the dialog that opens, select additional options if needed and click Find.

![the Focus on Paths between Two Nodes dialog](https://resources.jetbrains.com/help/img/idea/2026.3/focus_view_on_path_dialog.png)

RubyMine displays connections associated only with the selected nodes.

Procedure: Measure diagram centrality

You can use this action to identify the important nodes in the graph.

1. In the diagram editor, right-click anywhere in the editor to open the context menu.

2. From the context menu, select `Analyze Graph | Measure Centrality`.

3. In the dialog that opens, select additional options if needed and click Measure.

![Measure Centrality](https://resources.jetbrains.com/help/img/idea/2026.3/measure_centrality_dialog.png)

The node "importance" is expressed via fractional value from 0.0 to 1.0 measurement, and the brightest node selection should be explored first.

> **Tip:**
> Press `Ctrl+Z` (Windows), `⌘ Z` (macOS), `⌘ Z` (IntelliJ IDEA Classic (macOS)), `⌘ Z` (macOS System Shortcuts), `Ctrl+Z` (XWin), `Ctrl+Z` (GNOME), `Ctrl+Z` (KDE), `Ctrl+Shift+Minus` (Emacs), `Ctrl+Z` (Sublime Text), `⌘ Z` (Sublime Text (macOS)), `Ctrl+Z` (Visual Studio), `⌘ Z` (Visual Studio (macOS)), `Meta+Z` (TextMate), `Ctrl+Z` (NetBeans), `Ctrl+Z` (Eclipse), `⌘ Z` (Eclipse (macOS)) to cancel the actions.

## Configure diagram settings

To configure default settings for diagrams, open the Settings dialog and go to the [Tools | Diagrams](diagrams.html) page. Here you can configure the diagram layout, specify various options for different kinds of diagrams, and so on.

