So when this feature request came in to me, obviously, me being the good programmer that I am and all, I did what any good programmer would do and I said to ChatGPT, how do I do this thing? And, you know, ChatGPT said, oh, you do the thing like this. Okay? So this is what I like to call the classical solution. So basically, the way that it works is when you've got two fingers, they've both got X and Y coordinates, and you use those two touches to calculate two different variables. One variable will be sort of like the center, or you can think of it like the average X and Y positioning. You track that average, and as that changes, you can adjust the pan with that. Then the second thing you calculate is the distance between those two touches. You can calculate that using the Pythagoras theorem, and as that changes, you can adjust the zoom. And so that actually works for most use cases. So here, as you can see, an example on the left-hand side. So that's, you know, a zoom pan feature that I'm sure you're all very familiar with. As the user pans up and down or left and right, it changes the zoom, but critically, it keeps the X and Y-axis scaling values in proportion with one another, which is good. That's actually what you want, because you don't want to disorder the image. You still want it to kind of look like Manhattan Island. You don't want it to look like some other weird shape. But here's the thing. I thought, with a chart, wouldn't it be nice if we could disorder the image, because the user, as you can see, may want to adjust the X-axis or just the Y-axis, or they may want to have some more fine-tuned control as to what data they view. So obviously, the classical solution is not going to work for us, because we want independent X and Y-axis.
So then, you know, me, a good programmer, I go back to chat.gpt, and I'm like, oh, no, no, no, no. I want the X and Y-axis to be independent. And then, chat.gpt, obviously, is like, oh, that's a great idea. That can really improve the user experience if the X and Y-axis is a very enthusiastic guy. Then he gave me a solution, and it didn't work. And I was like, chat.gpt, I need a solution that works. He's like, oh, yes, I understand. It's very frustrating when the solution doesn't work. Here's a solution. Another solution. Doesn't work. Doesn't work. I did that, like, five, six times, and eventually I was like, OK, shut up.
Comments