Custom selection for a node shaped like a line

Hi,

I've hot a SfDiagram with nodes, where there are a few node types shaped according their type.

One of the types is a line.
Shape = new LineGeometry(startPoint: new Point(Data.PosXStart, Data.PosYStart), endPoint: new Point(Data.PosXEnd, Data.PosYEnd)),

Currently when the node shaped like a line is selected, 9 points are displayed in a rectangle around the line to allow the resizing of the node.

1. I would like only two points to be displayed, where the line vertices are, and drag them to reshape the node. Is it possible?
2. I would like the resizing by dragging one of the points that are displayed to allow the line to be narrower than 10, which is currently possible.
Where can I define that?

Thanks,

Tanya

4 Replies 1 reply marked as answer

RA Ranjitha Amirthalingam Syncfusion Team February 2, 2021 07:04 AM UTC

Hi Tanya, 
 
Greetings from Syncfusion. 
 
We assume that your requirement is to use a Straight line with editable terminals. SfDiagram supports to draw a straight line connector. Please visit the below links for more information. 
 
Links:  
 
 
 
If our assumption is different from your requirement, please share more details like screenshot or video to represent the requirement. This helps us to serve you better. 
 
 
Regards 
Ranjitha A.  



TZ Tanya Zelikman February 21, 2021 12:44 PM UTC

Hi Ranjitha,

Yes I would like a straight line with editable (and movable by mouse) terminals, but I really need it to be a node in a shape of a line and not a connector.

My SfDiagram will only have nodes of different types, not connectors. One of the types is supposed to be a line.

Is it possible?

Thank you,
Tanya.


TZ Tanya Zelikman February 21, 2021 01:27 PM UTC

Hi Ranjitha,

I have another question about a node shaped as a line:

Can I help the user and make the grabbing of the line easier?
It is not easy to grab it by placing the mouse cursor on the line itself, I would like to increase the grabbing area.
Is it possible?

Thanks!

Tanya


RA Ranjitha Amirthalingam Syncfusion Team February 22, 2021 12:55 PM UTC

Hi Tanya, 
 
We can provide any shape to Node. We have provided the code and screenshot for line as node shape. 
 
Code example: 
<syncfusion:SfDiagram x:Name="diagramControl"> 
  <syncfusion:SfDiagram.Nodes> 
     <syncfusion:NodeCollection> 
         <syncfusion:NodeViewModel x:Name="profile" UnitWidth="100" UnitHeight="100" OffsetX="150" OffsetY="500" > 
             <syncfusion:NodeViewModel.ContentTemplate> 
                  <DataTemplate> 
                     <Grid> 
                       <Rectangle Fill="White"></Rectangle> 
                       <Path Fill="blue" Stroke="Blue" Stretch="Fill" StrokeThickness="4" Data="M0,0 L0,10"/> 
                     </Grid>                   
                  </DataTemplate> 
             </syncfusion:NodeViewModel.ContentTemplate> 
             <syncfusion:NodeViewModel.ShapeStyle> 
                 <Style TargetType="Path"> 
                  <Setter Property="Stretch" Value="Fill"/> 
                  <Setter Property="Fill" Value="Blue"/> 
                 </Style> 
            </syncfusion:NodeViewModel.ShapeStyle> 
         </syncfusion:NodeViewModel> 
     </syncfusion:NodeCollection> 
   </syncfusion:SfDiagram.Nodes> 
</syncfusion:SfDiagram> 


Screenshot: 
 
Additional Information: 
Connector is also a shape which is used to connect two nodes. When you select the node it appears like above, only the resizer thumbs are editable .You can set any segments (static) to the line as your wish , but which cannot be editable dynamically. If you want to edit the segments , you need to use connector which is not possible while using node. 
 
 
Regards, 
Ranjitha A. 


Marked as answer
Loader.
Up arrow icon