Class DiagramPropertiesBuilder
Implementation of Diagram properties using view formatting
Inheritance
System.Object
DiagramPropertiesBuilder
Implements
System.Web.IHtmlString
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Syncfusion.EJ.dll
Syntax
public class DiagramPropertiesBuilder : IPropertiesBuilder, IHtmlString
Constructors
DiagramPropertiesBuilder()
Declaration
public DiagramPropertiesBuilder()
DiagramPropertiesBuilder(Diagram)
Declaration
public DiagramPropertiesBuilder(Diagram diagram)
Parameters
Type |
Name |
Description |
Diagram |
diagram |
|
Fields
diagram
Declaration
Field Value
Methods
BackgroundColor(String)
Gets or sets background color of diagram elements
Declaration
public DiagramPropertiesBuilder BackgroundColor(string backgroundColor)
Parameters
Type |
Name |
Description |
System.String |
backgroundColor |
|
Returns
Examples
@(Html.EJ().Diagram("Diagram1").Width("800px").Height("600px").BackgroundColor("Red");)
BackgroundImage(BackgroundImage)
Gets or sets the path of the background image of diagram elements
Declaration
public DiagramPropertiesBuilder BackgroundImage(BackgroundImage backgroundImage)
Parameters
Returns
Examples
@(Html.EJ().Diagram("Diagram1").Height("600px").Width("800px").BackgroundImage("image.png");)
Gets or sets the direction of line bridges
Declaration
public DiagramPropertiesBuilder BridgeDirection(BridgeDirection bridgeDirection)
Parameters
Returns
@(Html.EJ().Diagram("Diagram1").Height("600px").Width("800px").BridgeDirection(BridgeDirection.Bottom);)
ClientSideEvents(Action<DiagramClientSideEventsBuilder>)
Declaration
public DiagramPropertiesBuilder ClientSideEvents(Action<DiagramClientSideEventsBuilder> clientSideEvents)
Parameters
Returns
CommandManager(Action<CommandManagerBuilder>)
Declaration
public DiagramPropertiesBuilder CommandManager(Action<CommandManagerBuilder> fields)
Parameters
Returns
Connectors(Action<IDiagramConnectorsAdder>)
Declaration
public virtual DiagramPropertiesBuilder Connectors(Action<IDiagramConnectorsAdder> connectors)
Parameters
Returns
Enables/Disables the default behaviors of the diagram
Declaration
public DiagramPropertiesBuilder Constraints(DiagramConstraints constraints)
Parameters
Returns
@(Html.EJ().Diagram("Diagram1").Height("600px").Width("800px").Constraints(DiagramConstraints.Zoomable);)
DataSourceSettings(Action<DataSourceSettingsBuilder>)
Configures the data source that is to be bound with diagram
Declaration
public DiagramPropertiesBuilder DataSourceSettings(Action<DataSourceSettingsBuilder> fields)
Parameters
Returns
Examples
@(Html.EJ().Diagram("Diagram1").Height("600px").Width("800px").DataSourceSettings(d => d.Id("id"));)
DefaultSettings(Action<DefaultSettingsBuilder>)
Gets or sets the default properties for nodes/connectors
Declaration
public DiagramPropertiesBuilder DefaultSettings(Action<DefaultSettingsBuilder> fields)
Parameters
Returns
Examples
@{Html.EJ().Diagram("Diagram").Height("600px").
DefaultSettings(s =>
s.Connector(new Syncfusion.JavaScript.DataVisualization.Models.Diagram.Connector()
{
Name = "connector"
}));}
Enables or disables auto scroll in diagram
Declaration
public DiagramPropertiesBuilder EnableAutoScroll(bool enableAutoScroll)
Parameters
Type |
Name |
Description |
System.Boolean |
enableAutoScroll |
|
Returns
@(Html.EJ().Diagram("Diagram1").Width("800px").Height("600px").EnableAutoScroll(false));)
Enables or disables diagram context menu
Declaration
public DiagramPropertiesBuilder EnableContextMenu(bool enableContextMenu)
Parameters
Type |
Name |
Description |
System.Boolean |
enableContextMenu |
|
Returns
@(Html.EJ().Diagram("Diagram1").Width("800px").Height("600px").EnableContextMenu(false));)
Height(String)
Gets or sets the height of the diagram
Declaration
public DiagramPropertiesBuilder Height(string height)
Parameters
Type |
Name |
Description |
System.String |
height |
|
Returns
Examples
@(Html.EJ().Diagram("Diagram1").Width("800px").Height("600px");)
HistoryManager(Action<HistoryManagerBuilder>)
Customizes the undo redo functionality
Declaration
public DiagramPropertiesBuilder HistoryManager(Action<HistoryManagerBuilder> fields)
Parameters
Returns
Examples
<script>
//Method to handle the custom action
function customUndoRedo(args) {
var diagram = $("#diagram").ejDiagram("instance");
var node = args.object;
var currentState = node.empInfo;
//Resets the state
node.empInfo = args.prevState;
//Saves the previous state
args.prevState = currentState;
}
</script>
@(Html.EJ().Diagram("Diagram1").Height("600px").Width("800px").HistoryManager(h => h.Undo("").Redo(""));)
Layout(Action<LayoutBuilder>)
Automatically arranges the nodes and connectors in a predefined manner
Declaration
public DiagramPropertiesBuilder Layout(Action<LayoutBuilder> layout)
Parameters
Returns
Examples
//fixedNode of the layout
@(Html.EJ().Diagram("Diagram1").Width("800px").Height("600px").Layout(l => l.FixedNode("nodename")))
Nodes(Action<IDiagramNodesAdder>)
Declaration
public virtual DiagramPropertiesBuilder Nodes(Action<IDiagramNodesAdder> nodes)
Parameters
Returns
NodeTemplate(String)
Gets or sets the custom JSON data with node properties
Declaration
public DiagramPropertiesBuilder NodeTemplate(string nodeTemplate)
Parameters
Type |
Name |
Description |
System.String |
nodeTemplate |
|
Returns
Examples
<script>
//Binds the custom properties with node properties and sets the styles
function nodeTemplate() {
}
</script>
@(Html.EJ().Diagram("Diagram1").Width("800px").Height("600px").NodeTemplate("nodeTemplate");)
PageSettings(Action<PageSettingsBuilder>)
Defines the size and appearance of diagram page
Declaration
public DiagramPropertiesBuilder PageSettings(Action<PageSettingsBuilder> pageSettings)
Parameters
Returns
Examples
@(Html.EJ().Diagram("Diagram1").Width("800px").Height("600px").PageSettings(p => p.PageBackground("red"));)
Render()
Declaration
SelectedItems(SelectedItems)
Declaration
public DiagramPropertiesBuilder SelectedItems(SelectedItems selectedItems)
Parameters
Returns
Declaration
[Obsolete("Use SelectedItems.Constraints")]
public DiagramPropertiesBuilder SelectorConstraints(SelectorConstraints selectorConstraints)
Parameters
Returns
Declaration
[Obsolete("Use SelectedItems.Tooltip")]
public DiagramPropertiesBuilder ShowTooltip(bool showTooltip)
Parameters
Type |
Name |
Description |
System.Boolean |
showTooltip |
|
Returns
SnapSettings(Action<SnapSettingsBuilder>)
Defines the gridlines and defines how and when the objects have to be snapped
Declaration
public DiagramPropertiesBuilder SnapSettings(Action<SnapSettingsBuilder> snapSettings)
Parameters
Returns
Examples
@(Html.EJ().Diagram("Diagram1").Width("800px").Height("600px").SnapSettings(s => s.EnableSnapToObject(false));)
ToHtmlString()
Declaration
public string ToHtmlString()
Returns
Type |
Description |
System.String |
|
Gets or sets the interactive behaviors of diagram
Declaration
public DiagramPropertiesBuilder Tool(Tool tool)
Parameters
Type |
Name |
Description |
Tool |
tool |
|
Returns
@(Html.EJ().Diagram("Diagram1").Height("600px").Width("800px").Tool(Tool.ContinuesDraw);)
Declaration
public DiagramPropertiesBuilder Tooltip(Tooltip tooltip)
Parameters
Type |
Name |
Description |
Tooltip |
tooltip |
|
Returns
Declaration
[Obsolete("Use SelectedItems.Tooltip.TemplateId")]
public DiagramPropertiesBuilder TooltipTemplateId(string tooltipTemplateId)
Parameters
Type |
Name |
Description |
System.String |
tooltipTemplateId |
|
Returns
Width(String)
Gets or sets the width of the diagram
Declaration
public DiagramPropertiesBuilder Width(string width)
Parameters
Type |
Name |
Description |
System.String |
width |
|
Returns
Examples
@(Html.EJ().Diagram("Diagram1").Width("800px").Height("600px");)
ZoomFactor(Int32)
Declaration
public DiagramPropertiesBuilder ZoomFactor(int zoomFactor)
Parameters
Type |
Name |
Description |
System.Int32 |
zoomFactor |
|
Returns
Implements
System.Web.IHtmlString