Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates, bug fixes, and cleanup #48

Merged
merged 19 commits into from
Aug 27, 2018
Merged

Conversation

mvanderkamp
Copy link
Contributor

Add a 'change' property to the emitted data to allow users to distinguish between them (also this is just generally a useful piece of data).

Pinch reports a 'change' piece of data that allows the user to
distinguish between what were previously termed Pinch and Expand.
@mvanderkamp
Copy link
Contributor Author

mvanderkamp commented Aug 20, 2018

My apologies, I got carried away and did a bunch of cleanup and fixing, and forgot this was still open when I pushed to my master branch. Here's a summary of the changes thus far:

  • Fix the 'Expand / Pinch' bug by merging them with Distance into a single Pinch class that reports 'change' in its output.
  • Fix a bug in the arbiter function, where the arbiter accessed the ID directly instead of using getId(). This was causing jitter in Rotate gestures, and generally seemed to break any situation where multiple gestures should be firing events.
  • General fixes to the use of Array prototype methods. There were several places where a solution was hacked together instead of using the appropriate prototype method (e.g. using map() when a forEach() would do, or using forEach() and using a condition to decide whether to push to an external array when filter() or reduce() would have sufficed). This should allow for better runtime optimization of the code by JavaScript engines.
  • Add a 'change' field to the output from Pan events.
  • Add a 'repository' field to package.json
  • Make normalizeEvent() an object with the events as keys and their normalization as values.
  • Add an option to Rotate gestures, allowing users to specify the number of inputs to respond to.
    • This should be refactored though. If they want to allow both, they shouldn't be required to bind two gestures.

@mvanderkamp mvanderkamp changed the title Merge 'Pinch' and 'Expand' into single, common 'Pinch' Updates, bug fixes, and cleanup from mvanderkamp Aug 20, 2018
@mvanderkamp mvanderkamp changed the title Updates, bug fixes, and cleanup from mvanderkamp Updates, bug fixes, and cleanup Aug 20, 2018
@mvanderkamp mvanderkamp mentioned this pull request Aug 20, 2018
@mike-schultz
Copy link
Collaborator

@mvanderkamp Just wanted to pop in and say thanks for the contributions. We're on a deadline crunch for one of our products right now but will review this sometime this week / early next!

@hackhat
Copy link

hackhat commented Aug 24, 2018

This is very useful, thanks.

@mike-schultz mike-schultz merged commit 6680446 into zingchart:master Aug 27, 2018
@Hinashou
Copy link

@mike-schultz Is it possible to get a new release out there? Seems like a few things have been merged that aren't in the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants