We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
no
import { default as VChart } from '../../../src/index'; const spec = { type: 'line', data: { values: [ { time: '2:00', value: 8 }, { time: '4:00', value: 9 }, { time: '6:00', value: 11 }, { time: '8:00', value: 14 }, { time: '10:00', value: 16 }, { time: '12:00', value: 17 }, { time: '14:00', value: 17 }, { time: '16:00', value: 16 }, { time: '18:00', value: 15 } ] }, xField: 'time', yField: 'value' }; const chartContainer = document.getElementById('chart'); new Array(10).fill(0).forEach((entry, index) => { const dom = document.createElement('div'); dom.style.width = '100%'; dom.style.height = '400px'; dom.style.background = 'pink'; dom.style.marginBottom = '10px'; dom.style.position = 'relative'; chartContainer?.appendChild(dom); const textContainer = document.createElement('div'); textContainer.style.position = 'absolute'; textContainer.style.top = '100px'; textContainer.style.left = '80px'; textContainer.style.fontSize = '12px'; textContainer.style.color = 'red'; textContainer.style.pointerEvents = 'none'; textContainer.style.maxHeight = '200px'; textContainer.innerText = '这是一个空的内容'; dom.appendChild(textContainer); const vchart1 = new VChart( { ...spec, title: { text: `chart-${index}` } }, { dom: dom, mode: 'mobile-browser', supportsTouchEvents: false } ); vchart1.renderSync(); vchart1.on('tap', e => { console.log('tap event', e, `chart ${index}`); textContainer.innerText = (textContainer.innerText || '') + `\ntap 事件触发${index}`; }); vchart1.on('pointerdown', e => { console.log('pointerdown event', e, `chart ${index}`); textContainer.innerText = (textContainer.innerText || '') + `\npointerdown 事件触发${index}`; }); vchart1.on('pointerup', e => { console.log('pointerup event', e, `chart ${index}`); textContainer.innerText = (textContainer.innerText || '') + `\npointerup 事件触发${index}`; }); vchart1.on('click', e => { console.log('click event', e, `chart ${index}`); textContainer.innerText = (textContainer.innerText || '') + `\nclick 事件触发${index}`; }); vchart1.on('press', e => { console.log('press event', e, `chart ${index}`); textContainer.innerText = (textContainer.innerText || '') + `\npress 事件触发${index}`; }); vchart1.on('touchend', e => { console.log('touchend event', e, `chart ${index}`); textContainer.innerText = (textContainer.innerText || '') + `\ntouchend 事件触发${index}`; }); // dom.addEventListener('tap', e => { // console.log('tap event', e, `chart ${index}`); // textContainer.innerText = (textContainer.innerText || '') + `\ntap 事件触发${index}`; // }); // dom.addEventListener('pointerdown', e => { // console.log('pointerdown event', e, `chart ${index}`); // textContainer.innerText = (textContainer.innerText || '') + `\npointerdown 事件触发${index}`; // }); // dom.addEventListener('pointerup', e => { // console.log('pointerup event', e, `chart ${index}`); // textContainer.innerText = (textContainer.innerText || '') + `\npointerup 事件触发${index}`; // }); // dom.addEventListener('click', e => { // console.log('click event', e, `chart ${index}`); // textContainer.innerText = (textContainer.innerText || '') + `\nclick 事件触发${index}`; // }); // dom.addEventListener('press', e => { // console.log('press event', e, `chart ${index}`); // textContainer.innerText = (textContainer.innerText || '') + `\npress 事件触发${index}`; // }); // dom.addEventListener('touchend', e => { // console.log('touchend event', e, `chart ${index}`); // textContainer.innerText = (textContainer.innerText || '') + `\ntouchend 事件触发${index}`; // }); });
按压图表区域的时候,快速左右扫动
问题1:
tap
packages/vrender-core/src/event/event-manager.ts
packages/vrender-kits/src/event/extension/gesture.ts
不触发tap
- OS: - Browser: - Framework:
No response
The text was updated successfully, but these errors were encountered:
只是做了触发对象是否相同的判断,没有做位移的判断
可以对齐一下 hammerjs 的实现: https://hammerjs.github.io/recognizer-tap/
Sorry, something went wrong.
目前 vrender 默认提供的 tap 事件可以理解为 click 的移动版本,没有做类似 HAMMAR 这种手势库精确的时间以及位移判断,之所以之前这么封装是为了满足一些场景的需求,对于手势交互有较高要求的是不适用的
No branches or pull requests
Version
no
Link to Minimal Reproduction
no
Steps to Reproduce
Current Behavior
按压图表区域的时候,快速左右扫动
问题1:
tap
事件packages/vrender-core/src/event/event-manager.ts
和packages/vrender-kits/src/event/extension/gesture.ts
都会抛tap
事件命名冲突了Expected Behavior
不触发tap
Environment
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: