chartjs / chartjs-plugin-zoom

Zoom and pan plugin for Chart.js
MIT License
598 stars 327 forks source link

fix: trigger `onZoomStart` from `pinchStart` #810

Closed ZaLiTHkA closed 2 weeks ago

ZaLiTHkA commented 8 months ago

this simply ensures that the custom onZoomStart handler is also executed when zooming is initiated with "pinch".

there seems to be a fair difference in the logic structure between the handlers.js and hammer.js files, so I tried to keep this in line with what I already saw in hammer.js directly.

I did not add any tests for this, though I feel like we probably should.. perhaps one of the repo maintainers could help determine where this test should go? I don't see any others that cover the "pinch" functionality specifically.

this follows on from PR #487, and fixes issues #631 and #790.

trullock commented 2 months ago

This is merged into my fork at https://github.com/trullock/chartjs-plugin-zoom which is published on npm as @trullock/chartjs-plugin-zoom, as this fork seems abandoned

ZaLiTHkA commented 2 months ago

thanks @trullock, I'll try it out. I see your fork consolidates a fair amount of work from multiple PRs.. just out of curiosity, are you actively using it in one of your own projects as well?

I still think it would be nice to try get these changes into this root project, if possible.. this way the fixes and improvements could reach more users more easily, including your contributions.

so I'll leave this PR open for a little bit longer, just to see where this all goes. 👍🏼

trullock commented 2 months ago

Absolutely, you should leave this open.

I dont want to be maintaining a fork 🙈

ZaLiTHkA commented 2 months ago

I dont want to be maintaining a fork 🙈

yeah, completely understand that. it's definitely not a job for just anybody.. I only wish I had the time to even consider making commitments like that.

trullock commented 2 months ago

My fork works for me, thats all I'm guaranteeing! 😂

ZaLiTHkA commented 2 weeks ago

happy days! thanks @kurkle, looking forward to switching my package.json back to the official package. 💯