The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
We currently have an application built using the Northwoods Go Diagram control that I am trying to port over to Syncfusion. My problem is related to positioning. With our existing application there is no concept of a fixed size for the view or boundries. If I plot a symbol outside the viewable area the view simply expands automatically in all four directions.
Is there a way to achieve this behaviour with the built in view or a custom view? Is it a simple case of just resizing the view on the fly as symbols are added? How would it handle plotting new symbols upwards?
Thanks,
Darren
ADAdministrator Syncfusion Team September 29, 2005 04:08 PM UTC
Hello Darren,
Essential Diagram nodes are laid out on the diagram''s model(accessible through the Diagram.Model property), and are restricted only by the model''s bounds. The diagram''s View component is just a window overlooking the model, and can be moved around to display any section of the diagram model. So to expand the diagram along the positive X and Y axis, all that you have to do is to specify a large width/height to begin with and then increase the Diagram.Model.Width/Height properties at runtime to accomodate the new nodes. The View bounds will automatically be adjusted to accomodate the changes in the diagram model bounds.
Increasing the Model''s bounds along the negative X and Y axis is however a bit more involved. One option would be to increase the diagram model''s bounds by the extent that you would like it to be offset, and move the current nodes on the diagram model by an equal amount. This will let you add the new nodes to the top/left of the previous origin.
A better way would be to increase the model by the extent that you think the new nodes are going to occupy and then offset the diagram model by applying a translation to the model''s transformation matrix. Assuming that you want the new node(s) to take up 200x200 units along the negative X and Y axis, you can invoke the Diagram.Model.Translate(x,y) to displace the model by the specified amount. The following code should give you an idea,
// To increase the diagram model by (200,200) units along the negative axis
this.diagramComponent.Model.Width += 200;
this.diagramComponent.Model.Height += 200;
this.diagramComponent.Model.Translate(200,200);
this.diagramComponent.Model.UpdateViews();
this.diagramComponent.UpdateScrollBars();
I hope this helps. Please let me know if you have trouble with the implementation.
Thanks,
Prakash Surendra
Syncfusion Inc.,
ADAdministrator Syncfusion Team September 29, 2005 04:22 PM UTC
Darren,
Be sure to disable the Diagram.Model.BoundaryConstraintsEnabled property when attempting to add nodes outside the diagram''s set bounds.
Thanks,
Prakash