Creating a Zoom Tool with A Circle

Hi there. I am trying to create a tool that will allow students to use a circle to zoom into an area on a map. Essentially trying to replicate slide 11 on this Computation Layer Playground.
Would love any feedback! Thanks.

You mean slide 12? Why not just use the rectangle? I mean, there’s definitely a way to do a circle. C and P should be set to draggable. C is the center, P a point on the edge. You can also edit the colors and line types for the circle.

Without needing to change anything in the CL, here’s what I’d do in graph:

d=sqrt( (C.x-P.x)^2 + (C.y-P.y)^2 )

Thanks for your response. I was wanting to get that zoom rectangle on slide 11 to change into a circle, so that I could we could zoom into a circular region on a city map. Do you think that could be put on top of a picture on a graph and work?

Yes, you can insert images into graphs, then go to the wrench on the far right to remove axes and gridlines, and put the expressions from my other reply into the graph. (I would copy slide 11 and just edit the graph, so you don’t have to rewrite the CL code.)

Edit: Here you can paste this link into the graph:

Thank you for your help! I appreciate it!

1 Like

I think you’re looking for something like this, which will be possible with graphs, but not so much images (because i don’t think images can have conditions attached to them. (yet?).

A better option may be to two points, one that lets you zoom in, and one that lets you pick a center. I think you’ll quickly run into resolution problems.

Lemme give it a try.

1 Like

Here’s something that may do what you want:

1 Like

That is incredible! Thank you. Do you think there would be a way to combine that with the sketch tool? So students could use that to zoom, and then sketch a circle on the area on interest?

Or, is it possible to get the tool to trace the path created?

The documentation has some examples of sketch windows via graph zoom that might be useful when combined with the other methods shared: Try It!