I'm diagramming some product structures with 50-100 parts (3 levels). Rendering is taking about a minute (sometimes longer) in IE11 and sometimes the page is dying. If I break, it's always in kendo.all.min.js.
Does this sound right? It seems slow...
Attaching a picture of a typical diagram and my initial code. I'm using Kendo UI v2015.2.902
<
div
id
=
"diagram"
style
=
"width: 100%; height: 800px;"
>
@(Html.Kendo().Diagram()
.Name("diagram")
.DataSource(dataSource => dataSource
.Read(read => read.Action("_GetParts", "Diagram", new { partId = Model.PartId, level = Model.Level }))
.Model(m => m.Children("Children"))
)
.Editable(false)
.Layout(l => l
.Type(DiagramLayoutType.Tree)
.Subtype(DiagramLayoutSubtype.Tipover)
.HorizontalSeparation(10)
.VerticalSeparation(10)
)
.ConnectionDefaults(cd => cd
.Stroke(s => s
.Color("#bbb")
.Width(1)
)
.Editable(false)
)
.ShapeDefaults(sd => sd
.Visual("visualTemplate")
)
.Events(e => e.Select("onClick"))
<
script
type
=
"text/javascript"
>
function visualTemplate(options) {
var dataviz = kendo.dataviz;
var g = new dataviz.diagram.Group();
var dataItem = options.dataItem;
var imageLink = "../../Content/images/cc/" + dataItem.CommCode + ".png";
var lc = dataItem.Lifecycle;
if (lc == null) {
lc = "?";
}
if (dataItem.IsParentLevel) {
g.append(new dataviz.diagram.Rectangle({
width: 400,
height: 50,
stroke: {
width: 1,
color: "#000"
},
fill: {
color: "#efefef"
}
}));
g.append(new dataviz.diagram.Image({
source: imageLink,
x: 10,
y: 3,
width: 16,
height: 16
}));
g.append(new dataviz.diagram.TextBlock({
text: dataItem.PartNum,
x: 32,
y: 3,
color: "#000",
fontSize: "14"
}));
g.append(new dataviz.diagram.TextBlock({
text: dataItem.ItemDesc,
x: 12,
y: 28,
color: "#000",
fontSize: "9"
}));
g.append(new dataviz.diagram.TextBlock({
text: lc,
x: 300,
y: 3,
color: "#000",
fontSize: "9"
}));
g.append(new dataviz.diagram.Rectangle({
width: 4,
height: 50,
fill: dataItem.DiagramColor,
stroke: {
width: 0
}
}));
} else {
g.append(new dataviz.diagram.Rectangle({
width: 120,
height: 36,
stroke: {
width: 1,
color: "#000"
},
fill: {
color: "#efefef"
}
}));
g.append(new dataviz.diagram.Image({
source: imageLink,
x: 10,
y: 3,
width: 16,
height: 16
}));
g.append(new dataviz.diagram.TextBlock({
text: dataItem.PartNum,
x: 32,
y: 3,
color: "#000",
fontSize: "10"
}));
g.append(new dataviz.diagram.TextBlock({
text: dataItem.ShortDesc,
x: 10,
y: 23,
color: "#000",
fontSize: "8"
}));
g.append(new dataviz.diagram.Rectangle({
width: 3,
height: 36,
fill: dataItem.DiagramColor,
stroke: {
width: 0
}
}));
}
return g;
}
</
script
>
)
</
div
>