You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blazor/diagram/scroll-settings.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -257,6 +257,52 @@ To explore about the options , refer [ScrollLimitMode](https://help.syncfusion.c
257
257
| Diagram ||
258
258
| Infinity ||
259
259
260
+
## Scroll Padding
261
+
The [ScrollPadding](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.ScrollSettings.html#Syncfusion_Blazor_Diagram_ScrollSettings_ScrollPadding) property in the scroll settings allows you to extend the scrollable region based on the [ScrollLimit](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.ScrollSettings.html#Syncfusion_Blazor_Diagram_ScrollSettings_ScrollLimit), when an element is interacted with at the edges of the viewport. It specifies the maximum distance between the object and the edge of the diagram area. This behavior is essential for improving the user experience, especially in large diagrams where users need to extend elements across different parts of the diagram area.
262
+
263
+
N> The default value is 0 pixels.
264
+
265
+
The following code example illustrates how to set scroll padding.
DiagramMargin ScrollBorder = new DiagramMargin() { Left = 100, Right = 100, Top = 100, Bottom = 100 };
277
+
DiagramObjectCollection<Node> nodes;
278
+
protected override void OnInitialized()
279
+
{
280
+
nodes = new DiagramObjectCollection<Node>();
281
+
// A node is created and stored in the nodes collection.
282
+
Node node = new Node()
283
+
{
284
+
ID = "node1",
285
+
// Position of the node.
286
+
OffsetX = 250,
287
+
OffsetY = 250,
288
+
// Size of the node.
289
+
Width = 100,
290
+
Height = 100,
291
+
Style = new ShapeStyle()
292
+
{
293
+
Fill = "#6495ED",
294
+
StrokeColor = "white"
295
+
}
296
+
};
297
+
// Add node.
298
+
nodes.Add(node);
299
+
}
300
+
}
301
+
```
302
+

303
+
304
+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/Blazor-Diagram-Examples/tree/master/UG-Samples/ScrollSettings/ScrollPadding)
305
+
260
306
## Scrollable Area
261
307
Scrolling beyond any particular rectangular area can be restricted by using the [ScrollableArea](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.ScrollSettings.html#Syncfusion_Blazor_Diagram_ScrollSettings_ScrollableArea) property of scroll settings. To restrict scrolling beyond any custom region, set the [ScrollLimit](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.ScrollSettings.html#Syncfusion_Blazor_Diagram_ScrollSettings_ScrollLimit) as “limited.” The following code example illustrates how to customize the scrollable area.
0 commit comments