Spaces:
Sleeping
Sleeping
David Vegh
commited on
Commit
•
62ec136
1
Parent(s):
4176ac6
test size
Browse files- ipyvizzustory_demo.ipynb +16 -16
ipyvizzustory_demo.ipynb
CHANGED
@@ -54,26 +54,26 @@
|
|
54 |
"metadata": {},
|
55 |
"outputs": [],
|
56 |
"source": [
|
57 |
-
"# create
|
58 |
"\n",
|
59 |
-
"
|
60 |
-
"
|
61 |
-
"
|
62 |
-
"
|
63 |
"\n",
|
64 |
-
"# you can also add
|
65 |
"\n",
|
66 |
"# import pandas as pd\n",
|
67 |
"#\n",
|
68 |
-
"#
|
69 |
"# df = pd.read_csv(\n",
|
70 |
"# \"https://raw.githubusercontent.com/\" +\n",
|
71 |
"# \"vizzuhq/ipyvizzu-story/main/\" +\n",
|
72 |
"# \"docs/examples/basic/basic.csv\"\n",
|
73 |
"# )\n",
|
74 |
-
"#
|
75 |
"\n",
|
76 |
-
"
|
77 |
]
|
78 |
},
|
79 |
{
|
@@ -83,21 +83,21 @@
|
|
83 |
"metadata": {},
|
84 |
"outputs": [],
|
85 |
"source": [
|
86 |
-
"# create
|
87 |
"\n",
|
88 |
-
"
|
89 |
" Step(\n",
|
90 |
" Config({\"x\": \"Foo\", \"y\": \"Bar\"}),\n",
|
91 |
" )\n",
|
92 |
")\n",
|
93 |
-
"
|
94 |
"\n",
|
95 |
-
"
|
96 |
" Step(\n",
|
97 |
" Config({\"color\": \"Foo\", \"x\": \"Baz\", \"geometry\": \"circle\"}),\n",
|
98 |
" )\n",
|
99 |
")\n",
|
100 |
-
"
|
101 |
]
|
102 |
},
|
103 |
{
|
@@ -109,7 +109,7 @@
|
|
109 |
"source": [
|
110 |
"# you can set the width and height (CSS style)\n",
|
111 |
"\n",
|
112 |
-
"
|
113 |
]
|
114 |
},
|
115 |
{
|
@@ -120,7 +120,7 @@
|
|
120 |
"outputs": [],
|
121 |
"source": [
|
122 |
"if example == \"basic\":\n",
|
123 |
-
"
|
124 |
]
|
125 |
}
|
126 |
],
|
|
|
54 |
"metadata": {},
|
55 |
"outputs": [],
|
56 |
"source": [
|
57 |
+
"# create data and initialize Story with the created data\n",
|
58 |
"\n",
|
59 |
+
"data = Data()\n",
|
60 |
+
"data.add_series(\"Foo\", [\"Alice\", \"Bob\", \"Ted\"])\n",
|
61 |
+
"data.add_series(\"Bar\", [15, 32, 12])\n",
|
62 |
+
"data.add_series(\"Baz\", [5, 3, 2])\n",
|
63 |
"\n",
|
64 |
+
"# you can also add data with pandas\n",
|
65 |
"\n",
|
66 |
"# import pandas as pd\n",
|
67 |
"#\n",
|
68 |
+
"# data = Data()\n",
|
69 |
"# df = pd.read_csv(\n",
|
70 |
"# \"https://raw.githubusercontent.com/\" +\n",
|
71 |
"# \"vizzuhq/ipyvizzu-story/main/\" +\n",
|
72 |
"# \"docs/examples/basic/basic.csv\"\n",
|
73 |
"# )\n",
|
74 |
+
"# data.add_data_frame(df)\n",
|
75 |
"\n",
|
76 |
+
"story = Story(data=data)"
|
77 |
]
|
78 |
},
|
79 |
{
|
|
|
83 |
"metadata": {},
|
84 |
"outputs": [],
|
85 |
"source": [
|
86 |
+
"# create Slides and Steps and add them to the Story\n",
|
87 |
"\n",
|
88 |
+
"slide1 = Slide(\n",
|
89 |
" Step(\n",
|
90 |
" Config({\"x\": \"Foo\", \"y\": \"Bar\"}),\n",
|
91 |
" )\n",
|
92 |
")\n",
|
93 |
+
"story.add_slide(slide1)\n",
|
94 |
"\n",
|
95 |
+
"slide2 = Slide(\n",
|
96 |
" Step(\n",
|
97 |
" Config({\"color\": \"Foo\", \"x\": \"Baz\", \"geometry\": \"circle\"}),\n",
|
98 |
" )\n",
|
99 |
")\n",
|
100 |
+
"story.add_slide(slide2)"
|
101 |
]
|
102 |
},
|
103 |
{
|
|
|
109 |
"source": [
|
110 |
"# you can set the width and height (CSS style)\n",
|
111 |
"\n",
|
112 |
+
"story.set_size(width=\"400px\", height=\"240px\")"
|
113 |
]
|
114 |
},
|
115 |
{
|
|
|
120 |
"outputs": [],
|
121 |
"source": [
|
122 |
"if example == \"basic\":\n",
|
123 |
+
" story.play()"
|
124 |
]
|
125 |
}
|
126 |
],
|