-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: add custom gesture support #70
Conversation
Thanks for the contribution, I will review the code, also, the developer needs to sign the commit. |
- disable gesture - use custom RNGH gestures Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
This is a good test example to see how the three gestures currently available are actually used. Additional info/requests/questions
|
By the way, can you provide a demo of using custom gestures? |
we also need update document. |
I made a typo, I meant "just send |
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
I finally found out why it was handled this way, the initial version of the code references this project https://github.com/ecomfe/echarts-for-weixin/blob/master/ec-canvas/ec-canvas.js#L201-L216 . |
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
The "mousemove" is dispatched to simulate "hover" behavior, such as highlighting the bar when touched, without requiring the user to move their finger, the previous experience was more intuitive to the user. You can see the corresponding effect in the example directory. |
@zhiqingchen Sure, if it introduced a behavior regression, the commit should be reverted |
This PR allows users to:
react-native-gesture-handler
only)Related to #64
Documentation PR: #71
API
gesture
property (only ifuseRNGH
is true)If the user wishes to add new gestures, modify existing ones or remove them, this property allows him to do so.
gesture
can take :The function provides
defaultGestures
gesture array anddispatchEvents
function to send events to ZRender.Note: If
gesture
is an array or returns an array, gestures will be processed by race (Gesture.Race
).handleGesture
property (true by default)If the user wishes to disable gesture support (e.g.: doesn't need it, wants to use an external gesture system), this property allows him to do so.
In addition, the reference passed to SkiaChart/SvgChart now has a
dispatchEvents
method to send events to ZRender.(myRef.current.dispatchEvents
).Additional info/requests/questions
throttle
has its own file (exposed, so that users can use it if necessary)calc*
functions have been moved to thePanResponderHandler
file, as they are only used herezrenderId
(to avoid unnecessary re-rendering, should it be set to null when the component is unmounted?)PanGesture
listen toonBegin
and notonStart
?mousedown
andmousemove
sent at the same time for a press? Ismouseclick
not enough?onUpdate
ofPinchGesture
?