Search element in paper and zoom it

62 views
Skip to first unread message

Luís Flávio

unread,
Mar 31, 2022, 1:39:51 PM3/31/22
to JointJS
Hi guys,
Anyone could help if it is possible to search an element in paper and after found select and go to that element and zoom it for exemple.

Regards,
Luis Aquino 

heng fan

unread,
May 7, 2022, 1:54:13 AM5/7/22
to JointJS
Hi,

I don't know if it's right. Here is my idea.

if you can get the element, you can use paperScroller.center(element.position().x, element.position().y). The location is roughly accurate.

you can use element.resize(width, height) to zoom the element.

Roman Bruckner

unread,
May 7, 2022, 6:35:33 AM5/7/22
to joi...@googlegroups.com
Hi,

right, if you are joint+ user you can use the PaperScroller plugin.

Simply scroll to an element center with:
```
paperScroller.scrollToElement(element, { animation: { duration: 600 }});
```

Or scroll and zoom with:
```
app.paperScroller.transitionToRect(el.getBBox());
```

Best,
Roman



--

---
You received this message because you are subscribed to the Google Groups "JointJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jointjs/5b58395d-d7fe-487a-a374-9200f47b292dn%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages