menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DiagramConstraints - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DiagramConstraints

    Specifies the constraints that enable or disable certain features of the SfDiagramComponent.

    Inheritance
    System.Object
    DiagramConstraints
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class DiagramConstraints : Enum
    Remarks

    The DiagramConstraints enumeration allows you to control various functionalities of the diagram component including user interactions, zooming, panning, routing, and other behavioral aspects.

    This enumeration supports bitwise operations, allowing multiple constraints to be combined.

    • None - Disables all diagram functionalities
    • Bridging - Enables bridge creation for connectors
    • UndoRedo - Enables undo/redo functionality
    • UserInteraction - Enables user interaction with the diagram
    • ApiUpdate - Enables public API updates
    • PageEditable - Combines user interaction and API update capabilities
    • Zoom - Enables zooming functionality
    • PanX - Enables horizontal panning
    • PanY - Enables vertical panning
    • Pan - Enables panning in both directions
    • ZoomTextEdit - Maintains zoom ratio during text editing
    • Tooltip - Enables tooltips for diagram elements
    • Routing - Enables automatic line routing
    • AvoidLineOverlapping - Prevents line overlapping
    • Default - Enables standard diagram functionalities
    Examples

    The following example demonstrates how to enable or disable the diagram functionalities.

    <SfDiagramComponent @bind-Constraints="@diagramConstraints" />
     @code
     {
       DiagramConstraints diagramConstraints = DiagramConstraints.Default;
    }

    Fields

    ApiUpdate

    Determines whether public API updates should be enabled for the diagram.

    Declaration
    public const DiagramConstraints ApiUpdate
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, the diagram can be modified through public API methods and property changes.

    AvoidLineOverlapping

    Enables or disables the avoid line overlapping functionality for connectors.

    Declaration
    public const DiagramConstraints AvoidLineOverlapping
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, the diagram will attempt to prevent connectors from overlapping with each other.

    Bridging

    Enables bridge creation for all connectors in the diagram.

    Declaration
    public const DiagramConstraints Bridging
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, connectors will automatically create visual bridges when they intersect with other connectors, improving diagram readability.

    Default

    Enables the standard set of diagram functionalities.

    Declaration
    public const DiagramConstraints Default
    Field Value
    Type
    DiagramConstraints
    Remarks

    This is a composite constraint that combines commonly used diagram features including UndoRedo, UserInteraction, ApiUpdate, Zoom, Pan, and Tooltip.

    This represents the recommended default configuration for most diagram implementations.

    None

    Disables all functionalities of the diagram.

    Declaration
    public const DiagramConstraints None
    Field Value
    Type
    DiagramConstraints
    Remarks

    When this constraint is applied, the diagram becomes completely non-interactive and all features are disabled.

    PageEditable

    Enables diagram editing through both UserInteraction and ApiUpdate capabilities.

    Declaration
    public const DiagramConstraints PageEditable
    Field Value
    Type
    DiagramConstraints
    Remarks

    This is a composite constraint that combines UserInteraction and ApiUpdate flags.

    When applied, the diagram becomes fully editable through both user actions and programmatic API calls.

    Pan

    Enables panning functionality for the diagram in both horizontal and vertical directions.

    Declaration
    public const DiagramConstraints Pan
    Field Value
    Type
    DiagramConstraints
    Remarks

    This is a composite constraint that combines PanX and PanY flags.

    When applied, users can pan the diagram in any direction using mouse drag or touch gestures.

    PanX

    Enables or disables panning actions only on the x-axis (horizontal panning).

    Declaration
    public const DiagramConstraints PanX
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, users can pan the diagram horizontally using mouse drag or touch gestures.

    PanY

    Enables or disables panning actions only on the y-axis (vertical panning).

    Declaration
    public const DiagramConstraints PanY
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, users can pan the diagram vertically using mouse drag or touch gestures.

    Routing

    Enables or disables automatic line routing functionality for connectors.

    Declaration
    public const DiagramConstraints Routing
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, connectors will automatically route around obstacles to find the optimal path between connected elements.

    Tooltip

    Enables or disables tooltip functionality for diagram elements.

    Declaration
    public const DiagramConstraints Tooltip
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, tooltips will be displayed for elements when users hover over them.

    UndoRedo

    Enables or disables the undo or redo functionality for the diagram.

    Declaration
    public const DiagramConstraints UndoRedo
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, users can undo and redo their actions performed on the diagram elements.

    UserInteraction

    Determines whether user interaction should be enabled for the diagram.

    Declaration
    public const DiagramConstraints UserInteraction
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, users can interact with diagram elements through mouse and keyboard actions such as selection, dragging, and resizing.

    Zoom

    Enables or disables zooming functionality for the diagram.

    Declaration
    public const DiagramConstraints Zoom
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, users can zoom in and out of the diagram using mouse wheel, touch gestures, or programmatic zoom methods.

    ZoomTextEdit

    Determines whether the current zoom ratio should be maintained during text editing operations.

    Declaration
    public const DiagramConstraints ZoomTextEdit
    Field Value
    Type
    DiagramConstraints
    Remarks

    When enabled, the diagram maintains its current zoom level while users edit text labels on nodes or connectors.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved