-
-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathusage-wheel-sensitivity.py
53 lines (47 loc) · 1.32 KB
/
usage-wheel-sensitivity.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import dash
from dash import html
import dash_cytoscape as cyto
app = dash.Dash(__name__)
server = app.server
elements = [
{"data": {"id": "Node 1", "label": "Node 1"}, "position": {"x": 0, "y": 0}},
{"data": {"id": "Node 2", "label": "Node 2"}, "position": {"x": 50, "y": 50}},
{"data": {"source": "Node 1", "target": "Node 2", "label": ""}},
]
app.layout = html.Div(
[
html.Div(
[
html.H1("Low wheel sensitivity (0.01)"),
cyto.Cytoscape(
id="cytoscape-slow",
elements=elements,
wheelSensitivity=0.01,
),
]
),
html.Div(
[
html.H1("Default wheel sensitivity (1)"),
cyto.Cytoscape(
id="cytoscape-normal",
elements=elements,
wheelSensitivity=1,
),
]
),
html.Div(
[
html.H1("High wheel sensitivity (100)"),
cyto.Cytoscape(
id="cytoscape-fast",
elements=elements,
wheelSensitivity=100,
),
]
),
],
style={"display": "flex"},
)
if __name__ == "__main__":
app.run(debug=True)