Hello,
I'm having trouble with bringIntoView.
I'd like to pan a diagram so that a shape to be the center of the diagram.
It works when the first time calling bringIntoView() with a shape.
However after the first call, calling bringIntoView() with a shape does not move that shape to the center of the diagram.
I created a Dojo snippet.
To reproduce this problem, first click the shape1 button and click the shape2 button.
You will see the shape1 becomes the center of diagram, however when the shape2 button is clicked, the shape2 will be positioned at a weird place.
https://dojo.telerik.com/@jshin@hcim.com/ICANObOz
Or click the shape1 button and click the shape1 button once again.
I created this snippet based on the pan example in the API reference (https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/diagram/methods/pan).
How can I make a shape to be at the center of the diagram every time I call bringIntoView ()?
Attached is a recording of the steps to reproduce this issue.
Thank you!
5 Answers, 1 is accepted
Hello Jong,
Thank you for the provided recording, dojo sample and steps on how to reproduce the issue.
Resetting the initial position of the shape you brought into view, before bringing another one should provide you with the expected behavior.
Here is an updated dojo sample based on your code.
Let me know if you have any questions.
Best Regards,
Georgi Denchev
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Thank you very much for your answer!
However I encountered another problem.
If the shape is not in the visible area and bringIntoView is called, it does not not bring the shape into view.
FYI, I tried with the updated dojo you provided, but it still have the problem.
Please see the attached recordings.
Hi Jong,
Thank you for the additional information.
You can zoom out before bringing the shape into view and them zoom in and focus that shape again.
Let me know if this approach works for you.
Best Regards,
Georgi Denchev
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
OK. This works and serves my purpose.
But this resets the zoom state.
It is OK with my project, but I don't know if this is OK with other situations.
I hope this will be fixed in the next release, because bringIntoView() should bring the shapes into view as the name implies no matter where the current viewable area is, and calling bringIntoView() should put the shape at the center no matter how many time it is called.
Can you report it as a bug? Would you like me to report?
Hello Jong,
Let me talk to the Devs working on the Diagram about the bringIntoView method and what it is supposed and not supposed to do. There might be a limitation that is not documented or it could very well be a bug, but I would like to confirm it first.
I'll inform you as soon as I have more information.
I apologize for the delay in advance.
Best Regards,
Georgi Denchev
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.