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

DiagramShapeDefaultsSettingsBuilder

Methods

ConnectorDefaults(System.Action)

Defines the default options for the shape connectors.

Parameters

configurator - System.Action<DiagramShapeConnectorBuilder>

The action that configures the default shape connectors options.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .ConnectorDefaults(cd => cd.Width(10).Height(10))
               )
             )

Connectors(System.Action)

Defines the connectors the shape owns. A connector is the point in the shape where a connection between this shape and another one can originate from or end.

Parameters

configurator - System.Action<DiagramShapeConnectorFactory>

The action that configures the connectors.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Connectors(c =>
                {
                    c.Add().Name("top").Width(15).Height(15);
                    c.Add().Name("bottom").Width(20).Height(20);
                })
               )
             )

Content(System.Action)

Defines the default shapes content settings.

Parameters

configurator - System.Action<DiagramShapeDefaultsContentSettingsBuilder>

The action that configures the content settings.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Content(c => c.FontSize(16).Align("top left").Color("yellow"))
               )
             )

Editable(System.Boolean)

Defines the shape editable options.

Parameters

enabled - System.Boolean

The value that enables or disables the shape editing.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Editable(false)
               )
             )

Editable(System.Action)

Defines the shape editable options.

Parameters

configurator - System.Action<DiagramShapeDefaultsEditableSettingsBuilder>

The action that configures the editable settings.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Editable(e => e.Connect(false).Tools(tt => tt.Delete()))
               )
             )

Fill(System.Action)

Defines the fill options of the shape. Use this option to apply a single-color or a gradient background to all shapes in the Diagram.

Parameters

configurator - System.Action<DiagramShapeDefaultsFillSettingsBuilder>

The action that configures the fill settings.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Fill(f => f.Color("lime").Opacity(0.5))
               )
             )

Height(System.Double)

Defines the default height of shapes in the Diagram.

Parameters

value - System.Double

The value that configures the height.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Height(150)
               )
             )

Hover(System.Action)

Defines the default hover settings.

Parameters

configurator - System.Action<DiagramShapeDefaultsHoverSettingsBuilder>

The action that configures the hover settings.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Hover(h => h.Fill(f => f.Color("pink")))
               )
             )

MinHeight(System.Double)

Defines the minimum height the shape can have. Use this option to apply a lower limit to the height of shapes when users resize them.

Parameters

value - System.Double

The value that configures the minimum height.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .MinHeight(50)
               )
             )

MinWidth(System.Double)

Defines the minimum width the shape can have. Use this option to apply a lower limit to the width of shapes when users resize them.

Parameters

value - System.Double

The value that configures the minimum width.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .MinWidth(50)
               )
             )

Path(System.String)

Sets the path option of the shapes, which is a description of a custom geometry. The format follows the standard SVG format (http://www.w3.org/TR/SVG/paths.html#PathData "SVG Path data.").

Parameters

value - System.String

The value that configures the path.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Path("m35.15,0 L84.85,0 L120,35.15 L120,84.85 L84.85,120 L35.15,120 L0,84.85 L0,35.15 z")
               )
             )

Rotation(System.Action)

Defines the default rotation of the shapes.

Parameters

configurator - System.Action<DiagramShapeDefaultsRotationSettingsBuilder>

The action that configures the rotation.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Rotation(r => r.Angle(45))
               )
             )

Selectable(System.Boolean)

Specifies if Diagram shapes can be selected.

Parameters

value - System.Boolean

The value that configures the selectable.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Selectable(false)
               )
             )

Source(System.String)

Sets the path/URL to the shape image. The option applies when the shape type is "image".

Parameters

value - System.String

The value that configures the source.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Source("image source value").Type("image")
               )
             )

Stroke(System.Action)

Defines the configuration of the border around Diagram shapes.

Parameters

configurator - System.Action<DiagramShapeDefaultsStrokeSettingsBuilder>

The action that configures the stroke settings.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Stroke(s => s.Width(4).Color("yellow"))
               )
             )

Type(System.String)

Specifies the type of the shapes using any of the built-in shape types: "rectangle" (default), "circle", "image", "text".

Parameters

value - System.String

The value that configures the type.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Type("circle")
               )
             )

Width(System.Double)

Defines the default width of shapes in the Diagram.

Parameters

value - System.Double

The value that configures the width.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .Width(150)
               )
             )

X(System.Double)

Defines the x-coordinate of the shapes added to the Diagram.

Parameters

value - System.Double

The value that configures the x-coordinate.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .X(100).Y(20)
               )
             )

Y(System.Double)

Defines the y-coordinate of the shapes added to the Diagram.

Parameters

value - System.Double

The value that configures the y-coordinate.

Example


             @(Html.Kendo().Diagram()
              .Name("diagram")
              .ShapeDefaults(sd => sd
                .X(100).Y(20)
               )
             )

Visual(System.Func)

Defines a JavaScript function that returns a visual element to render for a given shape.

Parameters

inlineCodeBlock - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


             @(Html.Kendo().Diagram()
               .Name("diagram")
               .ShapeDefaults(sd => sd
                 .Visual(@<text>
                   function(e) {
                     // Return a custom visual element.
                   }
                   </text>)
               )
             )

Visual(System.String)

Defines a JavaScript function that returns a visual element to render for a given shape.

Parameters

visualHandler - System.String

The name of the JavaScript function that will create the visual element.

Example


             @(Html.Kendo().Diagram()
               .Name("diagram")
               .ShapeDefaults(sd => sd
                 .Visual("getShapeElement")
               )
             )

In this article
Not finding the help you need?