David Vegh commited on
Commit
4176ac6
1 Parent(s): 324dcb0

test set size

Browse files
Files changed (2) hide show
  1. ipyvizzustory_demo.ipynb +41 -3
  2. requirements.txt +1 -1
ipyvizzustory_demo.ipynb CHANGED
@@ -38,6 +38,8 @@
38
  "metadata": {},
39
  "outputs": [],
40
  "source": [
 
 
41
  "from ipyvizzu import Data, Config\n",
42
  "from ipyvizzustory import Slide, Step\n",
43
  "\n",
@@ -52,12 +54,36 @@
52
  "metadata": {},
53
  "outputs": [],
54
  "source": [
 
 
55
  "basic_data = Data()\n",
56
  "basic_data.add_series(\"Foo\", [\"Alice\", \"Bob\", \"Ted\"])\n",
57
  "basic_data.add_series(\"Bar\", [15, 32, 12])\n",
58
  "basic_data.add_series(\"Baz\", [5, 3, 2])\n",
59
  "\n",
60
- "basic_story = Story(data=basic_data)\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  "\n",
62
  "basic_slide1 = Slide(\n",
63
  " Step(\n",
@@ -74,6 +100,18 @@
74
  "basic_story.add_slide(basic_slide2)"
75
  ]
76
  },
 
 
 
 
 
 
 
 
 
 
 
 
77
  {
78
  "cell_type": "code",
79
  "execution_count": null,
@@ -82,7 +120,7 @@
82
  "outputs": [],
83
  "source": [
84
  "if example == \"basic\":\n",
85
- " basic_story"
86
  ]
87
  }
88
  ],
@@ -102,7 +140,7 @@
102
  "name": "python",
103
  "nbconvert_exporter": "python",
104
  "pygments_lexer": "ipython3",
105
- "version": "3.7.3"
106
  },
107
  "vscode": {
108
  "interpreter": {
 
38
  "metadata": {},
39
  "outputs": [],
40
  "source": [
41
+ "# import ipyvizzu and ipyvizzu-story\n",
42
+ "\n",
43
  "from ipyvizzu import Data, Config\n",
44
  "from ipyvizzustory import Slide, Step\n",
45
  "\n",
 
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
+ {
80
+ "cell_type": "code",
81
+ "execution_count": null,
82
+ "id": "27b1d972",
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",
 
100
  "basic_story.add_slide(basic_slide2)"
101
  ]
102
  },
103
+ {
104
+ "cell_type": "code",
105
+ "execution_count": null,
106
+ "id": "2e06c121",
107
+ "metadata": {},
108
+ "outputs": [],
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
  {
116
  "cell_type": "code",
117
  "execution_count": null,
 
120
  "outputs": [],
121
  "source": [
122
  "if example == \"basic\":\n",
123
+ " basic_story.play()"
124
  ]
125
  }
126
  ],
 
140
  "name": "python",
141
  "nbconvert_exporter": "python",
142
  "pygments_lexer": "ipython3",
143
+ "version": "3.10.4"
144
  },
145
  "vscode": {
146
  "interpreter": {
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
  python-dotenv
 
2
  mljar-mercury
3
  ipyvizzu-story
4
- pandas
 
1
  python-dotenv
2
+ pandas
3
  mljar-mercury
4
  ipyvizzu-story