123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/GraphEdit.xml.
- .. _class_GraphEdit:
- GraphEdit
- =========
- **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- An editor for graph-like structures, using :ref:`GraphNode<class_GraphNode>`\ s.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- **GraphEdit** provides tools for creation, manipulation, and display of various graphs. Its main purpose in the engine is to power the visual programming systems, such as visual shaders, but it is also available for use in user projects.
- \ **GraphEdit** by itself is only an empty container, representing an infinite grid where :ref:`GraphNode<class_GraphNode>`\ s can be placed. Each :ref:`GraphNode<class_GraphNode>` represents a node in the graph, a single unit of data in the connected scheme. **GraphEdit**, in turn, helps to control various interactions with nodes and between nodes. When the user attempts to connect, disconnect, or delete a :ref:`GraphNode<class_GraphNode>`, a signal is emitted in the **GraphEdit**, but no action is taken by default. It is the responsibility of the programmer utilizing this control to implement the necessary logic to determine how each request should be handled.
- \ **Performance:** It is greatly advised to enable low-processor usage mode (see :ref:`OS.low_processor_usage_mode<class_OS_property_low_processor_usage_mode>`) when using GraphEdits.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | clip_contents | ``true`` (overrides :ref:`Control<class_Control_property_clip_contents>`) |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`connection_lines_antialiased<class_GraphEdit_property_connection_lines_antialiased>` | ``true`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`connection_lines_curvature<class_GraphEdit_property_connection_lines_curvature>` | ``0.5`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`connection_lines_thickness<class_GraphEdit_property_connection_lines_thickness>` | ``2.0`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`minimap_enabled<class_GraphEdit_property_minimap_enabled>` | ``true`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`minimap_opacity<class_GraphEdit_property_minimap_opacity>` | ``0.65`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`minimap_size<class_GraphEdit_property_minimap_size>` | ``Vector2(240, 160)`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` | :ref:`panning_scheme<class_GraphEdit_property_panning_scheme>` | ``0`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`right_disconnects<class_GraphEdit_property_right_disconnects>` | ``false`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`scroll_offset<class_GraphEdit_property_scroll_offset>` | ``Vector2(0, 0)`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`show_arrange_button<class_GraphEdit_property_show_arrange_button>` | ``true`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`show_grid<class_GraphEdit_property_show_grid>` | ``true`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`show_grid_buttons<class_GraphEdit_property_show_grid_buttons>` | ``true`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`show_menu<class_GraphEdit_property_show_menu>` | ``true`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`show_minimap_button<class_GraphEdit_property_show_minimap_button>` | ``true`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`show_zoom_buttons<class_GraphEdit_property_show_zoom_buttons>` | ``true`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`show_zoom_label<class_GraphEdit_property_show_zoom_label>` | ``false`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`snapping_distance<class_GraphEdit_property_snapping_distance>` | ``20`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`snapping_enabled<class_GraphEdit_property_snapping_enabled>` | ``true`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`zoom<class_GraphEdit_property_zoom>` | ``1.0`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`zoom_max<class_GraphEdit_property_zoom_max>` | ``2.0736`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`zoom_min<class_GraphEdit_property_zoom_min>` | ``0.232568`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`zoom_step<class_GraphEdit_property_zoom_step>` | ``1.2`` |
- +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`_get_connection_line<class_GraphEdit_private_method__get_connection_line>` **(** :ref:`Vector2<class_Vector2>` from_position, :ref:`Vector2<class_Vector2>` to_position **)** |virtual| |const| |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`_is_in_input_hotzone<class_GraphEdit_private_method__is_in_input_hotzone>` **(** :ref:`Object<class_Object>` in_node, :ref:`int<class_int>` in_port, :ref:`Vector2<class_Vector2>` mouse_position **)** |virtual| |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`_is_in_output_hotzone<class_GraphEdit_private_method__is_in_output_hotzone>` **(** :ref:`Object<class_Object>` in_node, :ref:`int<class_int>` in_port, :ref:`Vector2<class_Vector2>` mouse_position **)** |virtual| |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`_is_node_hover_valid<class_GraphEdit_private_method__is_node_hover_valid>` **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)** |virtual| |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`add_valid_connection_type<class_GraphEdit_method_add_valid_connection_type>` **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`add_valid_left_disconnect_type<class_GraphEdit_method_add_valid_left_disconnect_type>` **(** :ref:`int<class_int>` type **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`add_valid_right_disconnect_type<class_GraphEdit_method_add_valid_right_disconnect_type>` **(** :ref:`int<class_int>` type **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`arrange_nodes<class_GraphEdit_method_arrange_nodes>` **(** **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_connections<class_GraphEdit_method_clear_connections>` **(** **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`connect_node<class_GraphEdit_method_connect_node>` **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`disconnect_node<class_GraphEdit_method_disconnect_node>` **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`force_connection_drag_end<class_GraphEdit_method_force_connection_drag_end>` **(** **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`get_connection_line<class_GraphEdit_method_get_connection_line>` **(** :ref:`Vector2<class_Vector2>` from_node, :ref:`Vector2<class_Vector2>` to_node **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Dictionary[]<class_Dictionary>` | :ref:`get_connection_list<class_GraphEdit_method_get_connection_list>` **(** **)** |const| |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`HBoxContainer<class_HBoxContainer>` | :ref:`get_menu_hbox<class_GraphEdit_method_get_menu_hbox>` **(** **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_node_connected<class_GraphEdit_method_is_node_connected>` **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_valid_connection_type<class_GraphEdit_method_is_valid_connection_type>` **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)** |const| |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`remove_valid_connection_type<class_GraphEdit_method_remove_valid_connection_type>` **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`remove_valid_left_disconnect_type<class_GraphEdit_method_remove_valid_left_disconnect_type>` **(** :ref:`int<class_int>` type **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`remove_valid_right_disconnect_type<class_GraphEdit_method_remove_valid_right_disconnect_type>` **(** :ref:`int<class_int>` type **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_connection_activity<class_GraphEdit_method_set_connection_activity>` **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port, :ref:`float<class_float>` amount **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_selected<class_GraphEdit_method_set_selected>` **(** :ref:`Node<class_Node>` node **)** |
- +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-reftable-group
- Theme Properties
- ----------------
- .. table::
- :widths: auto
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Color<class_Color>` | :ref:`activity<class_GraphEdit_theme_color_activity>` | ``Color(1, 1, 1, 1)`` |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Color<class_Color>` | :ref:`grid_major<class_GraphEdit_theme_color_grid_major>` | ``Color(1, 1, 1, 0.2)`` |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Color<class_Color>` | :ref:`grid_minor<class_GraphEdit_theme_color_grid_minor>` | ``Color(1, 1, 1, 0.05)`` |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Color<class_Color>` | :ref:`selection_fill<class_GraphEdit_theme_color_selection_fill>` | ``Color(1, 1, 1, 0.3)`` |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Color<class_Color>` | :ref:`selection_stroke<class_GraphEdit_theme_color_selection_stroke>` | ``Color(1, 1, 1, 0.8)`` |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`int<class_int>` | :ref:`port_hotzone_inner_extent<class_GraphEdit_theme_constant_port_hotzone_inner_extent>` | ``22`` |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`int<class_int>` | :ref:`port_hotzone_outer_extent<class_GraphEdit_theme_constant_port_hotzone_outer_extent>` | ``26`` |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`grid_toggle<class_GraphEdit_theme_icon_grid_toggle>` | |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`layout<class_GraphEdit_theme_icon_layout>` | |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`minimap_toggle<class_GraphEdit_theme_icon_minimap_toggle>` | |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`snapping_toggle<class_GraphEdit_theme_icon_snapping_toggle>` | |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`zoom_in<class_GraphEdit_theme_icon_zoom_in>` | |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`zoom_out<class_GraphEdit_theme_icon_zoom_out>` | |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`zoom_reset<class_GraphEdit_theme_icon_zoom_reset>` | |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`menu_panel<class_GraphEdit_theme_style_menu_panel>` | |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_GraphEdit_theme_style_panel>` | |
- +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Signals
- -------
- .. _class_GraphEdit_signal_begin_node_move:
- .. rst-class:: classref-signal
- **begin_node_move** **(** **)**
- Emitted at the beginning of a GraphNode movement.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_connection_drag_ended:
- .. rst-class:: classref-signal
- **connection_drag_ended** **(** **)**
- Emitted at the end of a connection drag.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_connection_drag_started:
- .. rst-class:: classref-signal
- **connection_drag_started** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`bool<class_bool>` is_output **)**
- Emitted at the beginning of a connection drag.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_connection_from_empty:
- .. rst-class:: classref-signal
- **connection_from_empty** **(** :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port, :ref:`Vector2<class_Vector2>` release_position **)**
- Emitted when user drags a connection from an input port into the empty space of the graph.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_connection_request:
- .. rst-class:: classref-signal
- **connection_request** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)**
- Emitted to the GraphEdit when the connection between the ``from_port`` of the ``from_node`` :ref:`GraphNode<class_GraphNode>` and the ``to_port`` of the ``to_node`` :ref:`GraphNode<class_GraphNode>` is attempted to be created.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_connection_to_empty:
- .. rst-class:: classref-signal
- **connection_to_empty** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`Vector2<class_Vector2>` release_position **)**
- Emitted when user drags a connection from an output port into the empty space of the graph.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_copy_nodes_request:
- .. rst-class:: classref-signal
- **copy_nodes_request** **(** **)**
- Emitted when the user presses :kbd:`Ctrl + C`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_delete_nodes_request:
- .. rst-class:: classref-signal
- **delete_nodes_request** **(** :ref:`StringName[]<class_StringName>` nodes **)**
- Emitted when attempting to remove a GraphNode from the GraphEdit. Provides a list of node names to be removed (all selected nodes, excluding nodes without closing button).
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_disconnection_request:
- .. rst-class:: classref-signal
- **disconnection_request** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)**
- Emitted to the GraphEdit when the connection between ``from_port`` of ``from_node`` :ref:`GraphNode<class_GraphNode>` and ``to_port`` of ``to_node`` :ref:`GraphNode<class_GraphNode>` is attempted to be removed.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_duplicate_nodes_request:
- .. rst-class:: classref-signal
- **duplicate_nodes_request** **(** **)**
- Emitted when a GraphNode is attempted to be duplicated in the GraphEdit.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_end_node_move:
- .. rst-class:: classref-signal
- **end_node_move** **(** **)**
- Emitted at the end of a GraphNode movement.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_node_deselected:
- .. rst-class:: classref-signal
- **node_deselected** **(** :ref:`Node<class_Node>` node **)**
- .. container:: contribute
- There is currently no description for this signal. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_node_selected:
- .. rst-class:: classref-signal
- **node_selected** **(** :ref:`Node<class_Node>` node **)**
- Emitted when a GraphNode is selected.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_paste_nodes_request:
- .. rst-class:: classref-signal
- **paste_nodes_request** **(** **)**
- Emitted when the user presses :kbd:`Ctrl + V`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_popup_request:
- .. rst-class:: classref-signal
- **popup_request** **(** :ref:`Vector2<class_Vector2>` position **)**
- Emitted when a popup is requested. Happens on right-clicking in the GraphEdit. ``position`` is the position of the mouse pointer when the signal is sent.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_signal_scroll_offset_changed:
- .. rst-class:: classref-signal
- **scroll_offset_changed** **(** :ref:`Vector2<class_Vector2>` offset **)**
- Emitted when the scroll offset is changed by the user. It will not be emitted when changed in code.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_GraphEdit_PanningScheme:
- .. rst-class:: classref-enumeration
- enum **PanningScheme**:
- .. _class_GraphEdit_constant_SCROLL_ZOOMS:
- .. rst-class:: classref-enumeration-constant
- :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **SCROLL_ZOOMS** = ``0``
- :kbd:`Mouse Wheel` will zoom, :kbd:`Ctrl + Mouse Wheel` will move the view.
- .. _class_GraphEdit_constant_SCROLL_PANS:
- .. rst-class:: classref-enumeration-constant
- :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **SCROLL_PANS** = ``1``
- :kbd:`Mouse Wheel` will move the view, :kbd:`Ctrl + Mouse Wheel` will zoom.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_GraphEdit_property_connection_lines_antialiased:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **connection_lines_antialiased** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_connection_lines_antialiased** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_connection_lines_antialiased** **(** **)**
- If ``true``, the lines between nodes will use antialiasing.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_connection_lines_curvature:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **connection_lines_curvature** = ``0.5``
- .. rst-class:: classref-property-setget
- - void **set_connection_lines_curvature** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_connection_lines_curvature** **(** **)**
- The curvature of the lines between the nodes. 0 results in straight lines.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_connection_lines_thickness:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **connection_lines_thickness** = ``2.0``
- .. rst-class:: classref-property-setget
- - void **set_connection_lines_thickness** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_connection_lines_thickness** **(** **)**
- The thickness of the lines between the nodes.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_minimap_enabled:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **minimap_enabled** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_minimap_enabled** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_minimap_enabled** **(** **)**
- If ``true``, the minimap is visible.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_minimap_opacity:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **minimap_opacity** = ``0.65``
- .. rst-class:: classref-property-setget
- - void **set_minimap_opacity** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_minimap_opacity** **(** **)**
- The opacity of the minimap rectangle.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_minimap_size:
- .. rst-class:: classref-property
- :ref:`Vector2<class_Vector2>` **minimap_size** = ``Vector2(240, 160)``
- .. rst-class:: classref-property-setget
- - void **set_minimap_size** **(** :ref:`Vector2<class_Vector2>` value **)**
- - :ref:`Vector2<class_Vector2>` **get_minimap_size** **(** **)**
- The size of the minimap rectangle. The map itself is based on the size of the grid area and is scaled to fit this rectangle.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_panning_scheme:
- .. rst-class:: classref-property
- :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **panning_scheme** = ``0``
- .. rst-class:: classref-property-setget
- - void **set_panning_scheme** **(** :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` value **)**
- - :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **get_panning_scheme** **(** **)**
- Defines the control scheme for panning with mouse wheel.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_right_disconnects:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **right_disconnects** = ``false``
- .. rst-class:: classref-property-setget
- - void **set_right_disconnects** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_right_disconnects_enabled** **(** **)**
- If ``true``, enables disconnection of existing connections in the GraphEdit by dragging the right end.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_scroll_offset:
- .. rst-class:: classref-property
- :ref:`Vector2<class_Vector2>` **scroll_offset** = ``Vector2(0, 0)``
- .. rst-class:: classref-property-setget
- - void **set_scroll_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
- - :ref:`Vector2<class_Vector2>` **get_scroll_offset** **(** **)**
- The scroll offset.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_show_arrange_button:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **show_arrange_button** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_show_arrange_button** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_showing_arrange_button** **(** **)**
- If ``true``, the button to automatically arrange graph nodes is visible.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_show_grid:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **show_grid** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_show_grid** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_showing_grid** **(** **)**
- If ``true``, the grid is visible.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_show_grid_buttons:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **show_grid_buttons** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_show_grid_buttons** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_showing_grid_buttons** **(** **)**
- If ``true``, buttons that allow to configure grid and snapping options are visible.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_show_menu:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **show_menu** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_show_menu** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_showing_menu** **(** **)**
- If ``true``, the menu toolbar is visible.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_show_minimap_button:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **show_minimap_button** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_show_minimap_button** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_showing_minimap_button** **(** **)**
- If ``true``, the button to toggle the minimap is visible.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_show_zoom_buttons:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **show_zoom_buttons** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_show_zoom_buttons** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_showing_zoom_buttons** **(** **)**
- If ``true``, buttons that allow to change and reset the zoom level are visible.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_show_zoom_label:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **show_zoom_label** = ``false``
- .. rst-class:: classref-property-setget
- - void **set_show_zoom_label** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_showing_zoom_label** **(** **)**
- If ``true``, the label with the current zoom level is visible. The zoom level is displayed in percents.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_snapping_distance:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **snapping_distance** = ``20``
- .. rst-class:: classref-property-setget
- - void **set_snapping_distance** **(** :ref:`int<class_int>` value **)**
- - :ref:`int<class_int>` **get_snapping_distance** **(** **)**
- The snapping distance in pixels, also determines the grid line distance.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_snapping_enabled:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **snapping_enabled** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_snapping_enabled** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_snapping_enabled** **(** **)**
- If ``true``, enables snapping.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_zoom:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **zoom** = ``1.0``
- .. rst-class:: classref-property-setget
- - void **set_zoom** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_zoom** **(** **)**
- The current zoom value.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_zoom_max:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **zoom_max** = ``2.0736``
- .. rst-class:: classref-property-setget
- - void **set_zoom_max** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_zoom_max** **(** **)**
- The upper zoom limit.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_zoom_min:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **zoom_min** = ``0.232568``
- .. rst-class:: classref-property-setget
- - void **set_zoom_min** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_zoom_min** **(** **)**
- The lower zoom limit.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_property_zoom_step:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **zoom_step** = ``1.2``
- .. rst-class:: classref-property-setget
- - void **set_zoom_step** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_zoom_step** **(** **)**
- The step of each zoom level.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_GraphEdit_private_method__get_connection_line:
- .. rst-class:: classref-method
- :ref:`PackedVector2Array<class_PackedVector2Array>` **_get_connection_line** **(** :ref:`Vector2<class_Vector2>` from_position, :ref:`Vector2<class_Vector2>` to_position **)** |virtual| |const|
- Virtual method which can be overridden to customize how connections are drawn.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_private_method__is_in_input_hotzone:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **_is_in_input_hotzone** **(** :ref:`Object<class_Object>` in_node, :ref:`int<class_int>` in_port, :ref:`Vector2<class_Vector2>` mouse_position **)** |virtual|
- Returns whether the ``mouse_position`` is in the input hot zone.
- By default, a hot zone is a :ref:`Rect2<class_Rect2>` positioned such that its center is at ``in_node``.\ :ref:`GraphNode.get_input_port_position<class_GraphNode_method_get_input_port_position>`\ (``in_port``) (For output's case, call :ref:`GraphNode.get_output_port_position<class_GraphNode_method_get_output_port_position>` instead). The hot zone's width is twice the Theme Property ``port_grab_distance_horizontal``, and its height is twice the ``port_grab_distance_vertical``.
- Below is a sample code to help get started:
- ::
- func _is_in_input_hotzone(in_node, in_port, mouse_position):
- var port_size: Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
- var port_pos: Vector2 = in_node.get_position() + in_node.get_input_port_position(in_port) - port_size / 2
- var rect = Rect2(port_pos, port_size)
-
- return rect.has_point(mouse_position)
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_private_method__is_in_output_hotzone:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **_is_in_output_hotzone** **(** :ref:`Object<class_Object>` in_node, :ref:`int<class_int>` in_port, :ref:`Vector2<class_Vector2>` mouse_position **)** |virtual|
- Returns whether the ``mouse_position`` is in the output hot zone. For more information on hot zones, see :ref:`_is_in_input_hotzone<class_GraphEdit_private_method__is_in_input_hotzone>`.
- Below is a sample code to help get started:
- ::
- func _is_in_output_hotzone(in_node, in_port, mouse_position):
- var port_size: Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
- var port_pos: Vector2 = in_node.get_position() + in_node.get_output_port_position(in_port) - port_size / 2
- var rect = Rect2(port_pos, port_size)
-
- return rect.has_point(mouse_position)
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_private_method__is_node_hover_valid:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **_is_node_hover_valid** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)** |virtual|
- This virtual method can be used to insert additional error detection while the user is dragging a connection over a valid port.
- Return ``true`` if the connection is indeed valid or return ``false`` if the connection is impossible. If the connection is impossible, no snapping to the port and thus no connection request to that port will happen.
- In this example a connection to same node is suppressed:
- .. tabs::
- .. code-tab:: gdscript
- func _is_node_hover_valid(from, from_port, to, to_port):
- return from != to
- .. code-tab:: csharp
- public override bool _IsNodeHoverValid(StringName fromNode, int fromPort, StringName toNode, int toPort)
- {
- return fromNode != toNode;
- }
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_add_valid_connection_type:
- .. rst-class:: classref-method
- void **add_valid_connection_type** **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)**
- Allows the connection between two different port types. The port type is defined individually for the left and the right port of each slot with the :ref:`GraphNode.set_slot<class_GraphNode_method_set_slot>` method.
- See also :ref:`is_valid_connection_type<class_GraphEdit_method_is_valid_connection_type>` and :ref:`remove_valid_connection_type<class_GraphEdit_method_remove_valid_connection_type>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_add_valid_left_disconnect_type:
- .. rst-class:: classref-method
- void **add_valid_left_disconnect_type** **(** :ref:`int<class_int>` type **)**
- Allows to disconnect nodes when dragging from the left port of the :ref:`GraphNode<class_GraphNode>`'s slot if it has the specified type. See also :ref:`remove_valid_left_disconnect_type<class_GraphEdit_method_remove_valid_left_disconnect_type>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_add_valid_right_disconnect_type:
- .. rst-class:: classref-method
- void **add_valid_right_disconnect_type** **(** :ref:`int<class_int>` type **)**
- Allows to disconnect nodes when dragging from the right port of the :ref:`GraphNode<class_GraphNode>`'s slot if it has the specified type. See also :ref:`remove_valid_right_disconnect_type<class_GraphEdit_method_remove_valid_right_disconnect_type>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_arrange_nodes:
- .. rst-class:: classref-method
- void **arrange_nodes** **(** **)**
- Rearranges selected nodes in a layout with minimum crossings between connections and uniform horizontal and vertical gap between nodes.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_clear_connections:
- .. rst-class:: classref-method
- void **clear_connections** **(** **)**
- Removes all connections between nodes.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_connect_node:
- .. rst-class:: classref-method
- :ref:`Error<enum_@GlobalScope_Error>` **connect_node** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)**
- Create a connection between the ``from_port`` of the ``from_node`` :ref:`GraphNode<class_GraphNode>` and the ``to_port`` of the ``to_node`` :ref:`GraphNode<class_GraphNode>`. If the connection already exists, no connection is created.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_disconnect_node:
- .. rst-class:: classref-method
- void **disconnect_node** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)**
- Removes the connection between the ``from_port`` of the ``from_node`` :ref:`GraphNode<class_GraphNode>` and the ``to_port`` of the ``to_node`` :ref:`GraphNode<class_GraphNode>`. If the connection does not exist, no connection is removed.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_force_connection_drag_end:
- .. rst-class:: classref-method
- void **force_connection_drag_end** **(** **)**
- Ends the creation of the current connection. In other words, if you are dragging a connection you can use this method to abort the process and remove the line that followed your cursor.
- This is best used together with :ref:`connection_drag_started<class_GraphEdit_signal_connection_drag_started>` and :ref:`connection_drag_ended<class_GraphEdit_signal_connection_drag_ended>` to add custom behavior like node addition through shortcuts.
- \ **Note:** This method suppresses any other connection request signals apart from :ref:`connection_drag_ended<class_GraphEdit_signal_connection_drag_ended>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_get_connection_line:
- .. rst-class:: classref-method
- :ref:`PackedVector2Array<class_PackedVector2Array>` **get_connection_line** **(** :ref:`Vector2<class_Vector2>` from_node, :ref:`Vector2<class_Vector2>` to_node **)**
- Returns the points which would make up a connection between ``from_node`` and ``to_node``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_get_connection_list:
- .. rst-class:: classref-method
- :ref:`Dictionary[]<class_Dictionary>` **get_connection_list** **(** **)** |const|
- Returns an Array containing the list of connections. A connection consists in a structure of the form ``{ from_port: 0, from: "GraphNode name 0", to_port: 1, to: "GraphNode name 1" }``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_get_menu_hbox:
- .. rst-class:: classref-method
- :ref:`HBoxContainer<class_HBoxContainer>` **get_menu_hbox** **(** **)**
- Gets the :ref:`HBoxContainer<class_HBoxContainer>` that contains the zooming and grid snap controls in the top left of the graph. You can use this method to reposition the toolbar or to add your own custom controls to it.
- \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_is_node_connected:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_node_connected** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)**
- Returns ``true`` if the ``from_port`` of the ``from_node`` :ref:`GraphNode<class_GraphNode>` is connected to the ``to_port`` of the ``to_node`` :ref:`GraphNode<class_GraphNode>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_is_valid_connection_type:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_valid_connection_type** **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)** |const|
- Returns whether it's possible to make a connection between two different port types. The port type is defined individually for the left and the right port of each slot with the :ref:`GraphNode.set_slot<class_GraphNode_method_set_slot>` method.
- See also :ref:`add_valid_connection_type<class_GraphEdit_method_add_valid_connection_type>` and :ref:`remove_valid_connection_type<class_GraphEdit_method_remove_valid_connection_type>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_remove_valid_connection_type:
- .. rst-class:: classref-method
- void **remove_valid_connection_type** **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)**
- Disallows the connection between two different port types previously allowed by :ref:`add_valid_connection_type<class_GraphEdit_method_add_valid_connection_type>`. The port type is defined individually for the left and the right port of each slot with the :ref:`GraphNode.set_slot<class_GraphNode_method_set_slot>` method.
- See also :ref:`is_valid_connection_type<class_GraphEdit_method_is_valid_connection_type>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_remove_valid_left_disconnect_type:
- .. rst-class:: classref-method
- void **remove_valid_left_disconnect_type** **(** :ref:`int<class_int>` type **)**
- Disallows to disconnect nodes when dragging from the left port of the :ref:`GraphNode<class_GraphNode>`'s slot if it has the specified type. Use this to disable disconnection previously allowed with :ref:`add_valid_left_disconnect_type<class_GraphEdit_method_add_valid_left_disconnect_type>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_remove_valid_right_disconnect_type:
- .. rst-class:: classref-method
- void **remove_valid_right_disconnect_type** **(** :ref:`int<class_int>` type **)**
- Disallows to disconnect nodes when dragging from the right port of the :ref:`GraphNode<class_GraphNode>`'s slot if it has the specified type. Use this to disable disconnection previously allowed with :ref:`add_valid_right_disconnect_type<class_GraphEdit_method_add_valid_right_disconnect_type>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_set_connection_activity:
- .. rst-class:: classref-method
- void **set_connection_activity** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port, :ref:`float<class_float>` amount **)**
- Sets the coloration of the connection between ``from_node``'s ``from_port`` and ``to_node``'s ``to_port`` with the color provided in the :ref:`activity<class_GraphEdit_theme_color_activity>` theme property. The color is linearly interpolated between the connection color and the activity color using ``amount`` as weight.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_method_set_selected:
- .. rst-class:: classref-method
- void **set_selected** **(** :ref:`Node<class_Node>` node **)**
- Sets the specified ``node`` as the one selected.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Theme Property Descriptions
- ---------------------------
- .. _class_GraphEdit_theme_color_activity:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **activity** = ``Color(1, 1, 1, 1)``
- Color of the connection's activity (see :ref:`set_connection_activity<class_GraphEdit_method_set_connection_activity>`).
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_color_grid_major:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **grid_major** = ``Color(1, 1, 1, 0.2)``
- Color of major grid lines.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_color_grid_minor:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **grid_minor** = ``Color(1, 1, 1, 0.05)``
- Color of minor grid lines.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_color_selection_fill:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **selection_fill** = ``Color(1, 1, 1, 0.3)``
- The fill color of the selection rectangle.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_color_selection_stroke:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **selection_stroke** = ``Color(1, 1, 1, 0.8)``
- The outline color of the selection rectangle.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_constant_port_hotzone_inner_extent:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **port_hotzone_inner_extent** = ``22``
- The horizontal range within which a port can be grabbed (inner side).
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_constant_port_hotzone_outer_extent:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **port_hotzone_outer_extent** = ``26``
- The horizontal range within which a port can be grabbed (outer side).
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_icon_grid_toggle:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **grid_toggle**
- The icon for the grid toggle button.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_icon_layout:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **layout**
- The icon for the layout button for auto-arranging the graph.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_icon_minimap_toggle:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **minimap_toggle**
- The icon for the minimap toggle button.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_icon_snapping_toggle:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **snapping_toggle**
- The icon for the snapping toggle button.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_icon_zoom_in:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **zoom_in**
- The icon for the zoom in button.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_icon_zoom_out:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **zoom_out**
- The icon for the zoom out button.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_icon_zoom_reset:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **zoom_reset**
- The icon for the zoom reset button.
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_style_menu_panel:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **menu_panel**
- .. container:: contribute
- There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
- .. rst-class:: classref-item-separator
- ----
- .. _class_GraphEdit_theme_style_panel:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **panel**
- The background drawn under the grid.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|