-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathTouchEventChart.jsx
More file actions
39 lines (36 loc) · 739 Bytes
/
TouchEventChart.jsx
File metadata and controls
39 lines (36 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from 'react';
import { DataSet } from 'vis-network/standalone';
import FlowChart from './FlowChart';
const nodes = new DataSet([
{
id: 1,
label: 'onTouchesDown',
level: 0,
},
{
id: 2,
label: 'onTouchesMove',
level: 1,
},
{
id: 3,
label: 'onTouchesUp',
level: 2,
},
{
id: 4,
label: 'onTouchesCancel',
level: 2,
},
]);
const edges = new DataSet([
{ from: 1, to: 2, arrows: 'to' },
{ from: 1, to: 3, arrows: 'to' },
{ from: 2, to: 2, arrows: 'to' },
{ from: 2, to: 3, arrows: 'to' },
{ from: 1, to: 4, arrows: 'to' },
{ from: 2, to: 4, arrows: 'to' },
]);
export function TouchEventFlowChart() {
return <FlowChart nodes={nodes} edges={edges} />;
}