New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Defines the fluent API for configuring the DiagramShapeDefaultsSettingsConnector settings.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

TShapeModel

TConnectionModel

Syntax:

C#
public class DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel> where TShapeModel : class where TConnectionModel : class

Inheritance: objectDiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel>

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public DiagramShapeDefaultsSettingsConnectorBuilder(DiagramShapeDefaultsSettingsConnector settings)
Parameters:settingsDiagramShapeDefaultsSettingsConnector

Methods

Defines the fill options of the shape connectors.

C#
public DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel> Fill(Action<DiagramShapeDefaultsConnectorFillSettingsBuilder<TShapeModel, TConnectionModel>> configurator)
Parameters:configuratorAction<DiagramShapeDefaultsConnectorFillSettingsBuilder<TShapeModel, TConnectionModel>>

The action that configures the fill.

Returns:

DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel>

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd =&gt; sd
.Connectors(c =&gt;
{
c.Add().Fill(f =&gt; f.Color("red").Opacity(0.5));
})
)
)

Defines the height of the shape connectors.

C#
public DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel> Height(double value)
Parameters:valuedouble

The value that configures the height.

Returns:

DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel>

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd =&gt; sd
.Connectors(c =&gt;
{
c.Add().Name("top").Height(20);
})
)
)

Defines the hover configuration of the shape connectors.

C#
public DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel> Hover(Action<DiagramShapeDefaultsConnectorHoverSettingsBuilder<TShapeModel, TConnectionModel>> configurator)
Parameters:configuratorAction<DiagramShapeDefaultsConnectorHoverSettingsBuilder<TShapeModel, TConnectionModel>>

The action that configures the hover.

Returns:

DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel>

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd =&gt; sd
.Connectors(c =&gt;
{
c.Add().Hover(h =&gt; h.Fill(f =&gt; f.Color("pink")));
})
)
)

The connector name. The name is referenced when specifying explicit fromConnector and toConnector values in a connection.

C#
public DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel> Name(string value)
Parameters:valuestring

The value that configures the name.

Returns:

DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel>

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd =&gt; sd
.Connectors(c =&gt;
{
c.Add().Name("Upstream");
c.Add().Name("SideLeft");
})
)
)

Defines the offset applied to the connector position. The offset pushes the connector away from the shape edge by the specified number of pixels in the direction appropriate for the connector's position (e.g., upward for "top", downward for "bottom", etc.).

C#
public DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel> Offset(double value)
Parameters:valuedouble

The value that configures the offset.

Returns:

DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel>

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd =&gt; sd
.Connectors(c =&gt;
{
c.Add().Name("top").Offset(10);
})
)
)

The function that positions the connector. The function is passed a shape and should return kendo.dataviz.diagram. As a result, a point that holds the connector position appears.

C#
public DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel> Position(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The value that configures the position action.

Returns:

DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel>

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd =&gt; sd
.Connectors(c =&gt;
{
c.Add().Name("Upstream").Position(@&lt;text&gt;
function(shape) {
return shape._transformPoint(shape.bounds().top());
}
&lt;/text&gt;);
})
)
)

The function that positions the connector. The function is passed a shape and should return kendo.dataviz.diagram. As a result, a point that holds the connector position appears.

C#
public DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel> Position(string handler)
Parameters:handlerstring

The value that configures the position action.

Returns:

DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel>

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd =&gt; sd
.Connectors(c =&gt;
{
c.Add().Name("Upstream").Position("getPosition");
})
)
)
&lt;script&gt;
function getPosition(shape) {
return shape._transformPoint(shape.bounds().top());
}
&lt;/script&gt;

Defines the stroke options of the shape connectors.

C#
public DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel> Stroke(Action<DiagramShapeDefaultsConnectorStrokeSettingsBuilder<TShapeModel, TConnectionModel>> configurator)
Parameters:configuratorAction<DiagramShapeDefaultsConnectorStrokeSettingsBuilder<TShapeModel, TConnectionModel>>

The action that configures the stroke.

Returns:

DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel>

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd =&gt; sd
.Connectors(c =&gt;
{
c.Add().Stroke(s =&gt; s.Color("red").Width(3));
})
)
)

Defines the width of the shape connectors.

C#
public DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel> Width(double value)
Parameters:valuedouble

The value that configures the width.

Returns:

DiagramShapeDefaultsSettingsConnectorBuilder<TShapeModel, TConnectionModel>

Example:
C#
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd =&gt; sd
.Connectors(c =&gt;
{
c.Add().Name("top").Width(20);
})
)
)