{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_kg_hide-input":true,"_kg_hide-output":true,"execution":{"iopub.status.busy":"2022-08-12T10:14:12.944088Z","iopub.execute_input":"2022-08-12T10:14:12.944660Z","iopub.status.idle":"2022-08-12T10:14:12.962423Z","shell.execute_reply.started":"2022-08-12T10:14:12.944546Z","shell.execute_reply":"2022-08-12T10:14:12.961553Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#ipyvizzu\n\nipyvizzu is the Jupyter Notebook integration of Vizzu.\n\n#Vizzu\n\n\"Vizzu is a free, open-source Javascript/C++ library utilizing a generic dataviz engine that generates many types of charts and seamlessly animates between them. It can be used to create static charts but more importantly it is designed for building animated data stories and interactive explorers as Vizzu enables showing different perspectives of the data that the viewers can easily follow due to the animation.\"\n\nhttps://ipyvizzu.vizzuhq.com/doc.html","metadata":{}},{"cell_type":"code","source":"!pip install ipyvizzu","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2022-08-12T10:14:12.963524Z","iopub.execute_input":"2022-08-12T10:14:12.964268Z","iopub.status.idle":"2022-08-12T10:14:24.221083Z","shell.execute_reply.started":"2022-08-12T10:14:12.964208Z","shell.execute_reply":"2022-08-12T10:14:24.219560Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"I didn't hide the code cells since there is a large space between the chart and the snippet","metadata":{}},{"cell_type":"code","source":"# sample\n\nimport pandas as pd\nfrom ipyvizzu import Chart, Data, Config\n\ndata_frame = pd.read_csv(\n    \"../input/spaceship-titanic/train.csv\"\n)\ndata = Data()\ndata.add_data_frame(data_frame)\n\nchart = Chart(width=\"640px\", height=\"360px\", display=\"manual\")\n\nchart.animate(data)\n\nchart.animate(\n    Config(\n        {\n            \"x\": \"HomePlanet\",\n            \"y\": \"VIP\",\n            \"label\": \"HomePlanet\",\n            \"title\": \"Transported on The SS Titanic by Home Planet\",\n        }\n    )\n)\nchart.animate(\n    Config(\n        {\n            \"x\": [\"HomePlanet\", \"Transported\"],\n            \"label\": [\"HomePlanet\", \"Transported\"],\n            \"color\": \"Transported\",\n        }\n    )\n)\nchart.animate(Config({\"x\": \"HomePlanet\", \"y\": [\"VIP\", \"Transported\"]}))\nchart.show()","metadata":{"_kg_hide-input":false,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"chart1 = Chart(width=\"640px\", height=\"360px\", display=\"manual\")\n\nchart1.animate(data)\n\nchart1.animate(\n    Config(\n        {\n            \"x\": \"VIP\",\n            \"y\": \"HomePlanet\",\n            \"label\": \"VIP\",\n            \"title\": \"VIP's Transported on The SS Titanic\",\n        }\n    )\n)\nchart1.animate(\n    Config(\n        {\n            \"x\": [\"VIP\", \"Transported\"],\n            \"label\": [\"VIP\", \"Transported\"],\n            \"color\": \"Transported\",\n        }\n    )\n)\nchart1.animate(Config({\"x\": \"VIP\", \"y\": [\"HomePlanet\", \"Transported\"]}))\nchart1.show()","metadata":{"_kg_hide-input":false,"execution":{"iopub.status.busy":"2022-08-12T10:14:24.355893Z","iopub.execute_input":"2022-08-12T10:14:24.356514Z","iopub.status.idle":"2022-08-12T10:14:24.422585Z","shell.execute_reply.started":"2022-08-12T10:14:24.356475Z","shell.execute_reply":"2022-08-12T10:14:24.421317Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"chart2 = Chart(width=\"640px\", height=\"360px\", display=\"manual\")\n\nchart2.animate(data)\n\nchart2.animate(\n    Config(\n        {\n            \"x\": \"Transported\",\n            \"y\": \"Destination\",\n            \"label\": \"Transported\",\n            \"title\": \"Transported on The SS Titanic by Destination\",\n        }\n    )\n)\nchart2.animate(\n    Config(\n        {\n            \"x\": [\"Transported\", \"VIP\"],\n            \"label\": [\"Transported\", \"VIP\"],\n            \"color\": \"VIP\",\n        }\n    )\n)\nchart2.animate(Config({\"x\": \"Transported\", \"y\": [\"Destination\", \"VIP\"]}))\nchart2.show()","metadata":{"_kg_hide-input":false,"execution":{"iopub.status.busy":"2022-08-12T10:14:24.424062Z","iopub.execute_input":"2022-08-12T10:14:24.424458Z","iopub.status.idle":"2022-08-12T10:14:24.483145Z","shell.execute_reply.started":"2022-08-12T10:14:24.424423Z","shell.execute_reply":"2022-08-12T10:14:24.481941Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"chart3 = Chart(width=\"640px\", height=\"360px\", display=\"manual\" )\n\nchart3.animate(data)\n\nchart3.animate(\n    Config(\n        {\n            \"x\": \"CryoSleep\",\n            \"y\": \"Destination\",\n            \"label\": \"CryoSleep\",\n            \"title\": \"Cryosleeped on The SS Titanic by Destination\",\n        }\n    )\n)\nchart3.animate(\n    Config(\n        {\n            \"x\": [\"CryoSleep\", \"VIP\"],\n            \"label\": [\"CryoSleep\", \"VIP\"],\n            \"color\": \"VIP\",\n        }\n    )\n)\nchart3.animate(Config({\"x\": \"CryoSleep\", \"y\": [\"Destination\", \"VIP\"]}))\nchart3.show()","metadata":{"_kg_hide-input":false,"execution":{"iopub.status.busy":"2022-08-12T10:14:24.484724Z","iopub.execute_input":"2022-08-12T10:14:24.485083Z","iopub.status.idle":"2022-08-12T10:14:24.547740Z","shell.execute_reply.started":"2022-08-12T10:14:24.485048Z","shell.execute_reply":"2022-08-12T10:14:24.546317Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"chart4 = Chart(width=\"640px\", height=\"360px\", display=\"manual\")\n\nchart4.animate(data)\n\nchart4.animate(\n    Config(\n        {\n            \"x\": \"HomePlanet\",\n            \"y\": \"Destination\",\n            \"label\": \"HomePlanet\",\n            \"title\": \"Passengers Home Planet by Destination\",\n        }\n    )\n)\nchart4.animate(\n    Config(\n        {\n            \"x\": [\"HomePlanet\", \"CryoSleep\"],\n            \"label\": [\"HomePlanet\", \"CryoSleep\"],\n            \"color\": \"VIP\",\n        }\n    )\n)\nchart4.animate(Config({\"x\": \"HomePlanet\", \"y\": [\"Destination\", \"CryoSleep\"]}))\nchart4.show()","metadata":{"_kg_hide-input":false,"execution":{"iopub.status.busy":"2022-08-12T10:14:24.549620Z","iopub.execute_input":"2022-08-12T10:14:24.550031Z","iopub.status.idle":"2022-08-12T10:14:24.619482Z","shell.execute_reply.started":"2022-08-12T10:14:24.549995Z","shell.execute_reply":"2022-08-12T10:14:24.618536Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"chart5 = Chart(width=\"640px\", height=\"360px\", display=\"manual\")\n\nchart5.animate(data)\n\nchart5.animate(\n    Config(\n        {\n            \"x\": \"Destination\",\n            \"y\": \"Transported\",\n            \"label\": \"Destination\",\n            \"title\": \"Transported on The SS Titanic by Destination\",\n        }\n    )\n)\nchart5.animate(\n    Config(\n        {\n            \"x\": [\"Destination\", \"VIP\"],\n            \"label\": [\"Destination\", \"VIP\"],\n            \"color\": \"Destination\",\n        }\n    )\n)\nchart5.animate(Config({\"x\": \"Destination\", \"y\": [\"VIP\", \"Transported\"]}))\nchart5.show()","metadata":{"_kg_hide-input":false,"execution":{"iopub.status.busy":"2022-08-12T10:14:24.621029Z","iopub.execute_input":"2022-08-12T10:14:24.621516Z","iopub.status.idle":"2022-08-12T10:14:24.681605Z","shell.execute_reply.started":"2022-08-12T10:14:24.621481Z","shell.execute_reply":"2022-08-12T10:14:24.680551Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"chart6 = Chart(width=\"640px\", height=\"360px\", display=\"manual\")\n\nchart6.animate(data)\n\nchart6.animate(\n    Config(\n        {\n            \"x\": \"Transported\",\n            \"y\": \"HomePlanet\",\n            \"label\": \"Transported\",\n            \"title\": \"Transported on The SS Titanic by Home Planet\",\n        }\n    )\n)\nchart6.animate(\n    Config(\n        {\n            \"x\": [\"Transported\", \"VIP\"],\n            \"label\": [\"Transported\", \"VIP\"],\n            \"color\": \"VIP\",\n        }\n    )\n)\nchart6.animate(Config({\"x\": \"Transported\", \"y\": [\"HomePlanet\", \"VIP\"]}))\nchart6.show()","metadata":{"_kg_hide-input":false,"execution":{"iopub.status.busy":"2022-08-12T10:14:24.682938Z","iopub.execute_input":"2022-08-12T10:14:24.683553Z","iopub.status.idle":"2022-08-12T10:14:24.745140Z","shell.execute_reply.started":"2022-08-12T10:14:24.683514Z","shell.execute_reply":"2022-08-12T10:14:24.744143Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Acknowledgements:\n\nVizzu https://ipyvizzu.vizzuhq.com/doc.html\n\nhttps://pypi.org/project/ipyvizzu/0.5.0/\n\nvizzuhq.github.io/ipyvizzu.","metadata":{}}]}