This is a migrated thread and some comments may be shown as answers.

Auto connector not respecting position function

7 Answers 133 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Ralph
Top achievements
Rank 1
Ralph asked on 30 Jan 2015, 02:37 PM
Hello,

I am attempting to change the position of the auto connector. I would prefer the connector to not show up at all, but the functionality to be present. To work around this issue I am attempting to override the position function of the connector so that it sits underneath the left connector as shown in this example: http://dojo.telerik.com/iREkA/11
However, when I hover over the shape the auto connector is still shown in the middle of the shape. If I override it outside of the shape defaults this seems to work so why would it not work in the shape defaults?

Thanks

7 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 03 Feb 2015, 02:13 PM
Hello Ralph,

This seems like an issue with extending the default options. I have logged it in our system and we will look into it. A possible workaround for now would be to set the connectors in the options after the initialization:
var diagram = $("#diagram").data('kendoDiagram');
diagram.options.shapeDefaults.connectors = [{ name: "left" }, { name: "right"}, {
    name: "auto",
    position: function(shape) {
        return shape.bounds().left();
    }
}];


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
phani
Top achievements
Rank 1
answered on 19 Mar 2015, 01:25 PM
hi sir, 
      how can we use that in my diagram.
0
Daniel
Telerik team
answered on 23 Mar 2015, 10:37 AM
Hello,

There seems to be a problem with the attached image and I cannot open it on my side. Could you reattach the image or provide more detailed information on the problem that you are experiencing to set the connectors in your scenario.
Also, the issue with setting the connectors with the shapeDefaults options should be fixed in the latest official release.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Manoj
Top achievements
Rank 1
answered on 21 Jul 2015, 11:24 AM

Hi,

Recently i have started using Kendo UI, i must say really awesome components you people have built. I have an issue with positioning connector points on custom shapes. Dynamically i'm drawing shapes depending on some inputs Ex: input is 3 then draw a triangle, if input is 4 then draw diamond etc. for all these i need to position connector points only at the edges. Can somebody will help me with this?

0
Manoj
Top achievements
Rank 1
answered on 21 Jul 2015, 01:18 PM
Or else if i can restrict the number of connector points appearing then it would be helpful please find the snippet i'm using 
var customShapes = ["",
                              "",
                              "M43.51,0.50 L86.50,74.50 L0.50,74.50 za",
                              "M56.00,0.50 L111.50,37.50 L56.00,74.50 L0.50,37.50 z",
                              "M37.50,0.50 L74.50,28.76 L60.35,74.50 L14.65,74.50 L0.50,28.76 z",
                              "M21.56,0.50 L63.56,0.50 L84.50,37.50 L63.56,74.50 L21.56,74.50 L0.50,37.50 z",
                              "M0.50,48.01 L7.78,15.18 L37.38,0.50 L67.10,15.18 L74.50,47.88 L54.00,74.50 L21.12,74.50 z"];
          
          $('#decisionOk').click(function(){
              var no = $('#decisionNumber').val();
              var shape = {"width":90,"height":110,"path":customShapes[no]};
              var pos = new Point(xPos, yPos);
              var transformed = diagram.documentToModel(pos);
              shape.x = transformed.x;
              shape.y = transformed.y;
               
              $('#window').hide();
              diagram.addShape(shape);
          });
0
Daniel
Telerik team
answered on 23 Jul 2015, 09:05 AM
Hello,

You can customize the connectors or restrict the number of connectors shown by using the shape.connectors option. In order to position the connectors only on the edges I can suggest to parse the path and use the segment points to position the connectors. I created an example that demonstrates the scenario.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Manoj
Top achievements
Rank 1
answered on 23 Jul 2015, 09:21 AM

Hi Daniel,

 Awesome :) this really works for me. Thanks

Tags
Diagram
Asked by
Ralph
Top achievements
Rank 1
Answers by
Daniel
Telerik team
phani
Top achievements
Rank 1
Manoj
Top achievements
Rank 1
Share this question
or