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

bringIntoView problem

5 Answers 112 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jong
Top achievements
Rank 1
Veteran
Jong asked on 22 Jan 2021, 06:52 PM

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

Sort by
0
Georgi Denchev
Telerik team
answered on 26 Jan 2021, 11:44 AM

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/.

0
Jong
Top achievements
Rank 1
Veteran
answered on 26 Jan 2021, 02:56 PM

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.

0
Georgi Denchev
Telerik team
answered on 27 Jan 2021, 04:49 PM

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.

Updated dojo sample.

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/.

0
Jong
Top achievements
Rank 1
Veteran
answered on 27 Jan 2021, 05:06 PM

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?

0
Georgi Denchev
Telerik team
answered on 29 Jan 2021, 02:29 PM

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/.

Tags
Diagram
Asked by
Jong
Top achievements
Rank 1
Veteran
Answers by
Georgi Denchev
Telerik team
Jong
Top achievements
Rank 1
Veteran
Share this question
or