-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple_data.py
76 lines (70 loc) · 1.6 KB
/
simple_data.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 7 21:02:11 2022
"""
import plotly.graph_objects as go
import urllib, json
import plotly.io as pio
pio.renderers.default='browser'
data = {
'node':{
'label':[
'Einnahmen', # 0
'Budget', # 1
'Ausgabe_1', # 2
'Ausgabe_11', # 3
'Ausgabe_12', # 4
'Ausgabe_2', # 5
'Ausgabe_21', # 6
'Ausgabe_22' # 7
],
},
'link':{
'source':[
0,
1,
2,
2,
1,
5,
5
],
'target':[
1,
2,
3,
4,
5,
6,
7
],
'value':[
1000.,
500.,
250.,
250.,
500.,
250.,
250.
]
}
}
fig = go.Figure(data=[go.Sankey(
valueformat = ".0f",
valuesuffix = "EUR",
# Define nodes
node = dict(
pad = 15,
thickness = 15,
line = dict(color = "black", width = 0.5),
label = data['node']['label'],
),
# Add links
link = dict(
source = data['link']['source'],
target = data['link']['target'],
value = data['link']['value'],
))])
fig.update_layout(title_text="Simple Test Data",
font_size=10)
fig.show()