Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions Blazor-MAUI-Demos/Pages/Diagram/Diagram/RadialTree.razor
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,23 @@
<Layout @bind-Type="Type" @bind-HorizontalSpacing="@HorizontalSpacing" @bind-VerticalSpacing="@VerticalSpacing">
</Layout>
<SnapSettings Constraints="@SnapConstraints.None"></SnapSettings>

<DiagramTemplates>
<TooltipTemplate>
@{
if (context is Node node)
{
var data = (node as Node).Data as RadialTreeDetails;
if (data != null)
{

<div>
@data.Name <br /> @data.Designation
</div>
}
}
}
</TooltipTemplate>
</DiagramTemplates>
</SfDiagramComponent>
</div>
@*Hidden:Lines*@
Expand Down Expand Up @@ -487,7 +503,6 @@
node.Constraints = NodeConstraints.Default | NodeConstraints.Tooltip;
node.Tooltip = new DiagramTooltip()
{
Template = radialData.Name+"<br />"+radialData.Designation,
Position = Position.TopCenter,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<p>This sample demonstrates building diagrams interactively and editing saved diagrams. The symbol palette is used to build diagrams easily.</p>
</SampleDescription>
<ActionDescription>
<p>This example shows how to drag and drop shapes and connectors from the symbol palette to build diagrams. You can save a diagram as a JSON file and edit saved diagrams. The <code><a target='_blank' href='https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_SaveDiagram'>SaveDiagram</a></code> method can be used to save a diagram as a string. The <code><a target='_blank' href='https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_LoadDiagram_System_String_System_Boolean_'>LoadDiagram</a></code> method can be used to load a diagram from a string. In this example, the undo and redo features are enabled.</p>
<p>This example shows how to drag and drop shapes and connectors from the symbol palette to build diagrams. You can save a diagram as a JSON file and edit saved diagrams. The <code><a target='_blank' href='https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_SaveDiagram'>SaveDiagram</a></code> method can be used to save a diagram as a string. The <code><a target='_blank' href='https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_LoadDiagram_System_String_System_Boolean_'>LoadDiagramAsync</a></code> method can be used to load a diagram from a string. In this example, the undo and redo features are enabled.</p>
</ActionDescription>
@*End:Hidden*@
@*Hidden:Lines*@
Expand Down
18 changes: 16 additions & 2 deletions Blazor-MAUI-Demos/Pages/Diagram/Diagram/SymbolPalette.razor
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,25 @@
string description = symbol is Node ? (symbol as Node).ID : (symbol as Connector).ID;
if (text)
{
SymbolInfo.Description = new SymbolDescription() { Text = description, TextOverflow = TextOverflow.Wrap };
SymbolInfo.Description = new SymbolDescription()
{
Text = description,
Style = new TextStyle()
{
TextOverflow = TextOverflow.Wrap
}
};
}
else
{
SymbolInfo.Description = new SymbolDescription() { Text = "", TextOverflow = TextOverflow.Wrap };
SymbolInfo.Description = new SymbolDescription()
{
Text = "",
Style = new TextStyle()
{
TextOverflow = TextOverflow.Wrap
}
};
}
return SymbolInfo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ private async Task MenuClick(Syncfusion.Blazor.Navigations.MenuEventArgs<Context
{
diagram.EndGroupAction();
}
await diagram.EndUpdate();
await diagram.EndUpdateAsync();
break;
case "duplicate":
Edit = true; IsDuplicate = true;
Expand Down Expand Up @@ -385,7 +385,7 @@ private async Task MenuClick(Syncfusion.Blazor.Navigations.MenuEventArgs<Context
view = true;
diagram.BeginUpdate();
Parent.SnapConstraint = Parent.SnapConstraint ^ SnapConstraints.ShowLines;
await diagram.EndUpdate();
await diagram.EndUpdateAsync();
ViewMenuItems[5].IconCss = ViewMenuItems[5].IconCss == "sf-icon-blank" ? "sf-icon-Selection" : "sf-icon-blank";
break;
case "fittoscreen":
Expand Down Expand Up @@ -512,7 +512,7 @@ private async Task OnUploadFileSelected(Syncfusion.Blazor.Inputs.UploadingEventA
await Task.Delay(100);
string json = await FileUtil.LoadFile(jsRuntime, args.FileData);
json = json.Replace(System.Environment.NewLine, string.Empty);
await Parent.Diagram.LoadDiagram(json.ToString());
await Parent.Diagram.LoadDiagramAsync(json.ToString());
IsJsonLoading = false;
}
else
Expand All @@ -521,7 +521,7 @@ private async Task OnUploadFileSelected(Syncfusion.Blazor.Inputs.UploadingEventA
Node Node = Diagram.SelectionSettings.Nodes[0];
Diagram.BeginUpdate();
Node.Shape = new ImageShape() { Type = NodeShapes.Image, Source = args.FileData.RawFile.ToString() };
await Diagram.EndUpdate();
await Diagram.EndUpdateAsync();
}
}
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public partial class DiagramToolBar
/// In a Blazor application, this property should be set to an instance of the IJSRuntime interface provided by the framework.
/// </remarks>
[Inject]
protected IJSRuntime? jsRuntime { get; set; } = null!;
protected IJSRuntime jsRuntime { get; set; }
#pragma warning disable CS8618
/// <summary>
/// Represents the DiagramMain instance that serves as the parent.
Expand Down
20 changes: 10 additions & 10 deletions Common/Pages/AISamples/Diagram/TextToMindMap.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@using DiagramShapes = Syncfusion.Blazor.Diagram.NodeShapes
@using DiagramSegments = Syncfusion.Blazor.Diagram.ConnectorSegment
@using Orientation= Syncfusion.Blazor.Diagram.Orientation
@using shapes = Syncfusion.Blazor.Diagram.NodeShapes
@using Shapes = Syncfusion.Blazor.Diagram.NodeShapes
@using BlazorDemos.Service

@inject AzureAIService ChatGptService
Expand Down Expand Up @@ -304,8 +304,8 @@
{
Diagram.BeginUpdate();
RemoveData(Diagram.SelectionSettings.Nodes[0], Diagram);
_ = Diagram.EndUpdate();
await Diagram.DoLayout();
_ = Diagram.EndUpdateAsync();
await Diagram.DoLayoutAsync();
}
if (obj.Name == "fitPage")
{
Expand Down Expand Up @@ -667,7 +667,7 @@
};
diagram.BeginUpdate();
await UpdatePortConnection(childNode, diagram, isSibling);
await diagram.EndUpdate();
await diagram.EndUpdateAsync();
}
// Custom tool to add the node.
public class AddLeftTool : InteractionControllerBase
Expand Down Expand Up @@ -716,7 +716,7 @@
TargetID = node.ID,
SourceID = isSibling ? childNode.ParentId : diagram.SelectionSettings.Nodes[0].ID
};
await diagram.AddDiagramElements(new DiagramObjectCollection<NodeBase>() { node, connector });
await diagram.AddDiagramElementsAsync(new DiagramObjectCollection<NodeBase>() { node, connector });
Node sourceNode = diagram.GetObject((connector as Connector).SourceID) as Node;
Node targetNode = diagram.GetObject((connector as Connector).TargetID) as Node;
if (targetNode != null && targetNode.AdditionalInfo.Count > 0)
Expand All @@ -733,7 +733,7 @@
(connector as Connector).TargetPortID = targetNode.Ports[0].ID;
}
}
await diagram.DoLayout();
await diagram.DoLayoutAsync();
}
public void ZoomTo(ZoomOptions options)
{
Expand Down Expand Up @@ -822,7 +822,7 @@
};
diagram.BeginUpdate();
await UpdatePortConnection(childNode, diagram, isSibling);
await diagram.EndUpdate();
await diagram.EndUpdateAsync();
}
// Custom tool to add the node.
public class AddRightTool : InteractionControllerBase
Expand Down Expand Up @@ -861,8 +861,8 @@
{
sfDiagram.BeginUpdate();
RemoveData(deleteObject, sfDiagram);
_ = sfDiagram.EndUpdate();
await sfDiagram.DoLayout();
_ = sfDiagram.EndUpdateAsync();
await sfDiagram.DoLayoutAsync();
}
base.OnMouseUp(args);
this.InAction = true;
Expand Down Expand Up @@ -934,7 +934,7 @@

node.Height = 50;
node.Width = 100;
node.Shape = new BasicShape() { Type = shapes.Basic, Shape = NodeBasicShapes.Ellipse };
node.Shape = new BasicShape() { Type = Shapes.Basic, Shape = NodeBasicShapes.Ellipse };
PointPort port21 = new PointPort()
{
ID = "left",
Expand Down
16 changes: 8 additions & 8 deletions Common/Pages/Diagram/Diagram/NodeTemplateSample.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@using Syncfusion.Blazor.Charts
@using Syncfusion.Blazor.Calendars
@using Syncfusion.Blazor.Grids
@using shapes = Syncfusion.Blazor.Diagram.NodeShapes
@using Shapes = Syncfusion.Blazor.Diagram.NodeShapes
@namespace BlazorDemos.Pages
@*Hidden:Lines*@
@inherits SampleBaseComponent;
Expand Down Expand Up @@ -421,7 +421,7 @@
Annotations = new DiagramObjectCollection<ShapeAnnotation>() { new ShapeAnnotation() { Constraints = AnnotationConstraints.ReadOnly } },
Constraints = NodeConstraints.Default & ~NodeConstraints.Resize & ~NodeConstraints.Rotate& ~NodeConstraints.Select,
OffsetY = 380,
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML }
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML }
};
Node lineChartNode = new Node()
{
Expand All @@ -431,7 +431,7 @@
OffsetX = 870,
Constraints = NodeConstraints.Default & ~NodeConstraints.Resize & ~NodeConstraints.Rotate& ~NodeConstraints.Select,
OffsetY = 810,
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML },
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML },
};
Node barChartNode = new Node()
{
Expand All @@ -441,7 +441,7 @@
OffsetX = 325,
Constraints = NodeConstraints.Default & ~NodeConstraints.Resize & ~NodeConstraints.Rotate& ~NodeConstraints.Select,
OffsetY = 810,
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML }
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML }
};
Node datePickerNode = new Node()
{
Expand All @@ -451,7 +451,7 @@
OffsetX = 1000,
Constraints = NodeConstraints.Default & ~NodeConstraints.Resize & ~NodeConstraints.Rotate& ~NodeConstraints.Select,
OffsetY = 170,
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML }
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML }
};
TextStyle textStyle = new TextStyle()
{
Expand Down Expand Up @@ -485,7 +485,7 @@
Constraints = NodeConstraints.Default & ~NodeConstraints.Select,
//Style = new ShapeStyle() { StrokeColor = "Transparent" },
OffsetY = 90,
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML }
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML }
};
Node expenseNode = new Node()
{
Expand All @@ -496,7 +496,7 @@
Constraints = NodeConstraints.Default & ~NodeConstraints.Select,
OffsetY = 90,
Style = new ShapeStyle() { StrokeColor = "Transparent" },
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML }
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML }
};
Node balanceNode = new Node()
{
Expand All @@ -507,7 +507,7 @@
Constraints = NodeConstraints.Default & ~NodeConstraints.Select,
OffsetY = 90,
Style = new ShapeStyle() { StrokeColor = "Transparent" },
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML }
Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML }
};

nodes.Add(pieChartNode);
Expand Down
2 changes: 1 addition & 1 deletion Common/Pages/Diagram/Diagram/Serialization.razor
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<p>This sample demonstrates building diagrams interactively and editing saved diagrams. The symbol palette is used to build diagrams easily.</p>
</SampleDescription>
<ActionDescription>
<p>This example shows how to drag and drop shapes and connectors from the symbol palette to build diagrams. You can save a diagram as a JSON file and edit saved diagrams. The <code><a target='_blank' href='https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_SaveDiagram' aria-label="SaveDiagram">SaveDiagram</a></code> method can be used to save a diagram as a string. The <code><a target='_blank' href='https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_LoadDiagram_System_String_System_Boolean_' aria-label="LoadDiagram">LoadDiagram</a></code> method can be used to load a diagram from a string. In this example, the undo and redo features are enabled.</p>
<p>This example shows how to drag and drop shapes and connectors from the symbol palette to build diagrams. You can save a diagram as a JSON file and edit saved diagrams. The <code><a target='_blank' href='https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_SaveDiagram' aria-label="SaveDiagram">SaveDiagram</a></code> method can be used to save a diagram as a string. The <code><a target='_blank' href='https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_LoadDiagram_System_String_System_Boolean_' aria-label="LoadDiagramAsync">LoadDiagramAsync</a></code> method can be used to load a diagram from a string. In this example, the undo and redo features are enabled.</p>
</ActionDescription>
@*End:Hidden*@
@*Hidden:Lines*@
Expand Down
18 changes: 16 additions & 2 deletions Common/Pages/Diagram/Diagram/SymbolPalette.razor
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,25 @@
string description = symbol is Node ? (symbol as Node).ID : (symbol as Connector).ID;
if (text)
{
SymbolInfo.Description = new SymbolDescription() { Text = description, TextOverflow = TextOverflow.Wrap };
SymbolInfo.Description = new SymbolDescription()
{
Text = description,
Style = new TextStyle()
{
TextOverflow = TextOverflow.Wrap
},
};
}
else
{
SymbolInfo.Description = new SymbolDescription() { Text = "", TextOverflow = TextOverflow.Wrap };
SymbolInfo.Description = new SymbolDescription()
{
Text = "",
Style = new TextStyle()
{
TextOverflow = TextOverflow.Wrap
},
};
}
return SymbolInfo;
}
Expand Down