David Vegh commited on
Commit
62ec136
1 Parent(s): 4176ac6
Files changed (1) hide show
  1. ipyvizzustory_demo.ipynb +16 -16
ipyvizzustory_demo.ipynb CHANGED
@@ -54,26 +54,26 @@
54
  "metadata": {},
55
  "outputs": [],
56
  "source": [
57
- "# create basic data and initialize basic Story with the created data\n",
58
  "\n",
59
- "basic_data = Data()\n",
60
- "basic_data.add_series(\"Foo\", [\"Alice\", \"Bob\", \"Ted\"])\n",
61
- "basic_data.add_series(\"Bar\", [15, 32, 12])\n",
62
- "basic_data.add_series(\"Baz\", [5, 3, 2])\n",
63
  "\n",
64
- "# you can also add basic data with pandas\n",
65
  "\n",
66
  "# import pandas as pd\n",
67
  "#\n",
68
- "# basic_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
- "# basic_data.add_data_frame(df)\n",
75
  "\n",
76
- "basic_story = Story(data=basic_data)"
77
  ]
78
  },
79
  {
@@ -83,21 +83,21 @@
83
  "metadata": {},
84
  "outputs": [],
85
  "source": [
86
- "# create basic Slides and Steps and add them to the basic Story\n",
87
  "\n",
88
- "basic_slide1 = Slide(\n",
89
  " Step(\n",
90
  " Config({\"x\": \"Foo\", \"y\": \"Bar\"}),\n",
91
  " )\n",
92
  ")\n",
93
- "basic_story.add_slide(basic_slide1)\n",
94
  "\n",
95
- "basic_slide2 = Slide(\n",
96
  " Step(\n",
97
  " Config({\"color\": \"Foo\", \"x\": \"Baz\", \"geometry\": \"circle\"}),\n",
98
  " )\n",
99
  ")\n",
100
- "basic_story.add_slide(basic_slide2)"
101
  ]
102
  },
103
  {
@@ -109,7 +109,7 @@
109
  "source": [
110
  "# you can set the width and height (CSS style)\n",
111
  "\n",
112
- "basic_story.set_size(width=\"800px\", height=\"480px\")"
113
  ]
114
  },
115
  {
@@ -120,7 +120,7 @@
120
  "outputs": [],
121
  "source": [
122
  "if example == \"basic\":\n",
123
- " basic_story.play()"
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
  ],