aarondail Github contribution chart
aarondail Github Stats
aarondail Most Used Languages

Activity

19 Sep 2022

Issue Comment

Aarondail

Possible to Zoom to a div with an ID on Click

Is it possible to Zoom to a specific div with any Selector like ID or Class name on button click?

Forked On 19 Sep 2022 at 09:27:46

Aarondail

hey sorry for the extremely late response -- I think so but (forgive my memory) pretty sure I didn't add a way to explicitly do that. You can control the camera, and tell zoom into a specific area, and that area could be your div.

So you could probably wire up something like:

// Assume spaceRef is a React ref to a <Space> component and div is your <div>
const virtualRect = spaceRef.current.viewPort.translateClientRectToVirtualSpace(div);
spaceRef.current.viewPort.camera.centerFitAreaIntoView(virtualRect, ...) 

Commented On 19 Sep 2022 at 09:27:46

Aarondail

Updating dependencies after a LONG time.

Pushed On 19 Sep 2022 at 09:11:56

Aarondail

Updating docs/example with newly built stuff.

Pushed On 19 Sep 2022 at 09:11:56