Skip to content

975476: Removed Obsolete function in diagram component #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
16 changes: 8 additions & 8 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

Check warning on line 15 in Common/Pages/AISamples/Diagram/TextToMindMap.razor

View workflow job for this annotation

GitHub Actions / build

The type name 'shapes' only contains lower-cased ascii characters. Such names may become reserved for the language.

Check warning on line 15 in Common/Pages/AISamples/Diagram/TextToMindMap.razor

View workflow job for this annotation

GitHub Actions / build

The type name 'shapes' only contains lower-cased ascii characters. Such names may become reserved for the language.
@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
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
Loading