Skip to content

Commit a5ab8c4

Browse files
SankeyPLot init
1 parent 849907b commit a5ab8c4

4 files changed

Lines changed: 608 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 2
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 2
6+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"# conda install -c big_cake ipysankeywidget\n",
10+
"\n",
11+
"from ipysankeywidget import SankeyWidget"
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": 2,
17+
"metadata": {},
18+
"outputs": [],
19+
"source": [
20+
"links = [\n",
21+
" {'source': 'start', 'target': 'A', 'value': 2},\n",
22+
" {'source': 'A', 'target': 'B', 'value': 2},\n",
23+
" {'source': 'C', 'target': 'A', 'value': 2},\n",
24+
" {'source': 'A', 'target': 'C', 'value': 2},\n",
25+
"]"
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": 3,
31+
"metadata": {},
32+
"outputs": [],
33+
"source": [
34+
"w = SankeyWidget(links=links, margins=dict(top=0, bottom=0, left=50, right=100))\n"
35+
]
36+
},
37+
{
38+
"cell_type": "code",
39+
"execution_count": 4,
40+
"metadata": {},
41+
"outputs": [
42+
{
43+
"data": {
44+
"application/vnd.jupyter.widget-view+json": {
45+
"model_id": "3af3a2c48ede447887b77559d541fded",
46+
"version_major": 2,
47+
"version_minor": 0
48+
},
49+
"text/plain": [
50+
"SankeyWidget(links=[{'source': 'start', 'target': 'A', 'value': 2}, {'source': 'A', 'target': 'B', 'value': 2}…"
51+
]
52+
},
53+
"metadata": {},
54+
"output_type": "display_data"
55+
}
56+
],
57+
"source": [
58+
"w\n"
59+
]
60+
},
61+
{
62+
"cell_type": "code",
63+
"execution_count": 5,
64+
"metadata": {},
65+
"outputs": [],
66+
"source": [
67+
"w.links[0]['value'] = 1\n",
68+
"w.send_state()"
69+
]
70+
},
71+
{
72+
"cell_type": "code",
73+
"execution_count": null,
74+
"metadata": {},
75+
"outputs": [],
76+
"source": []
77+
}
78+
],
79+
"metadata": {
80+
"kernelspec": {
81+
"display_name": "Python 3",
82+
"language": "python",
83+
"name": "python3"
84+
},
85+
"language_info": {
86+
"codemirror_mode": {
87+
"name": "ipython",
88+
"version": 3
89+
},
90+
"file_extension": ".py",
91+
"mimetype": "text/x-python",
92+
"name": "python",
93+
"nbconvert_exporter": "python",
94+
"pygments_lexer": "ipython3",
95+
"version": "3.6.3"
96+
}
97+
},
98+
"nbformat": 4,
99+
"nbformat_minor": 2
100+
}

0 commit comments

Comments
 (0)