manuelstofer/pinchzoom

docs

Gruski opened this issue · 6 comments

Is there documentation for this? Need all the functions it has and what the passing parameters do.

The public API is the one described in the README file. The library internals shouldn't be used

README file barely describes anything, only initialization. For example it shows "useMouseWheel" as one of the settings yet "useMouseWheel" is not even anywhere in the code and does nothing. I want to update the zoom and pan through code but nothing is mentioned. I looked through the code and there is a "scaleTo" which looks like it could do it but when I call it, it does nothing. I can't find anything to change the panning or how to bring an element into view or how to add scroll bars etc. I mean do I have to go through the entire code base to find out what features this component supports. It's a waste of time for everyone who needs to use something out of the box to have to become intimately familiar with the code before use.

The README file actually describes everything the library have to offer publicly.

useMouseWheel is an actual feature, you can find the implementation in the master branch (which is unstable and should not be used for serious projects). Since I guess you are using the latest stable version (2.3.5), you should go see the README file of that release only.

scaleTo is an internal function which is not part of the public API, I advice you to just follow the README and if an extra feature is needed you can always implement it and make a pull request.

I am not seeing it. The README on GitHub has nothing of what you speak of. Only one init example and that's it. The public interfaces are not defined at all. Are we talking about: https://github.com/manuelstofer/pinchzoom/blob/master/README.md because there is nothing there. For example how do you zoom/pan programmatically.

As I already said multiple times, the README file describes everything that this library has to offer publicly (I know, it's not much). It declares the existence of a class with just one constructor (showing also its usage), it describes all of the options, it defines the three methods which the PinchZoom class exposes (yes, they are just 3), and it shows an example of the over all usage. That's all, there isn't anything more to be documented. If you want an extra proof, you can go see the TypeScript declarations for this library: https://github.com/manuelstofer/pinchzoom/blob/master/src/pinch-zoom.d.ts

how do you zoom/pan programmatically

At the current state of this library, you don't.

If you want to make a pull request with interesting modifications to the README file or one with an implementation of the feature you need, you are free to do that, but right now I think this issue should be considered as closed (@sandstrom)

I agree with @LorenzoLotti, happy to accept a PR with improvements to README.md.

Since this code is open-source, without anyone getting paid to work on it, it's difficult to satisfy all the wishes that people may have. I hope you understand! 🌻