DiagramShapeDefaultsSettingsConnectorBuilder
Methods
Name(System.String)
The connector name. The name is referenced when specifying explicit fromConnector and toConnector values in a connection.
Parameters
value - System.String
The value that configures the name.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Connectors(c =>
{
c.Add().Name("Upstream");
c.Add().Name("SideLeft");
})
)
)
Position(System.Func)
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.
Parameters
handler - System.Func<Object,Object>
The value that configures the position action.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Connectors(c =>
{
c.Add().Name("Upstream").Position(@<text>
function(shape) {
return shape._transformPoint(shape.bounds().top());
}
</text>);
})
)
)
Position(System.String)
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.
Parameters
handler - System.String
The value that configures the position action.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Connectors(c =>
{
c.Add().Name("Upstream").Position("getPosition");
})
)
)
<script>
function getPosition(shape) {
return shape._transformPoint(shape.bounds().top());
}
</script>
Width(System.Double)
Defines the width of the shape connectors.
Parameters
value - System.Double
The value that configures the width.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Connectors(c =>
{
c.Add().Name("top").Width(20);
})
)
)
Height(System.Double)
Defines the height of the shape connectors.
Parameters
value - System.Double
The value that configures the height.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Connectors(c =>
{
c.Add().Name("top").Height(20);
})
)
)
Hover(System.Action)
Defines the hover configuration of the shape connectors.
Parameters
configurator - System.Action<DiagramShapeDefaultsConnectorHoverSettingsBuilder>
The action that configures the hover.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Connectors(c =>
{
c.Add().Hover(h => h.Fill(f => f.Color("pink")));
})
)
)
Fill(System.Action)
Defines the fill options of the shape connectors.
Parameters
configurator - System.Action<DiagramShapeDefaultsConnectorFillSettingsBuilder>
The action that configures the fill.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Connectors(c =>
{
c.Add().Fill(f => f.Color("red").Opacity(0.5));
})
)
)
Stroke(System.Action)
Defines the stroke options of the shape connectors.
Parameters
configurator - System.Action<DiagramShapeDefaultsConnectorStrokeSettingsBuilder>
The action that configures the stroke.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Connectors(c =>
{
c.Add().Stroke(s => s.Color("red").Width(3));
})
)
)
Offset(System.Double)
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.).
Parameters
value - System.Double
The value that configures the offset.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Connectors(c =>
{
c.Add().Name("top").Offset(10);
})
)
)