{ "info": { "author": "chuboy", "author_email": "", "bugtrack_url": null, "classifiers": [ "Topic :: Scientific/Engineering :: Visualization" ], "description": "# lazyplotly\nA wrapper of interactive visualization package plotly. Sometimes we are just too lazy to make nested dictionary. Especially creating dropdown menus or slide bars is a way too exhuasting. Moreover, variables of different kind of chart are renamed into a single taxonomy.\n### What is simplified as easy as possible\n1. creating widgets such as dropdown menu or a slider bar\n2. combine different type of charts together into subplots\n3. automatically calculate grid rows and columns of subplots\n4. configuring different type of variable, using them in a single taxonomy\n5. initiate settings for jupyter notebook users\n### Installation\n```\n$ pip install plotly lazyplotly\n```\n### Quick Start\n```\nimport lazyplotly as lp\n\n# using list data type to fit\nbar_1 = lp.bar(x=[1,2,3,4,5], y=[23,43,62,24,33], cmap=lp.cmap[16], name='male')\n\n# using dataframe to fit\ndf = dict(x=[1,2,3,4,5],y=[48,32,43,54,62])\nbar_2 = lp.bar(x='x', y='y', df=df, cmap=lp.cmap[16], name='female')\n\n# combine all charts into dropdown menu, and save as a html file\nlp.dropdown(\n datas = [[bar_1,bar_2],[bar_2, bar_1]],\n btn_labels = ['male v.s. female','female v.s. male'], \n xlabel = 'category', ylabel='value', title='MyAwesomeTitle',\n output = 'MyAwesomePlot.html'\n)\n```\n![](https://github.com/billju/lazyplotly/raw/master/images/dropdown.png)\n### Custom extension\n```\n# using dataframe object by setting xy variables with column name\ndf = dict(order=[1,2,3,4,5],trend=[22,33,47,57,46],lower=[21,32,43,54,32],upper=[23,34,51,60,60])\narea = lp.area(x='order', y='lower', y2='upper', df=df, color='rgba(0,176,246,0.2)', name='CI')\nline = lp.line(x='order', y='trend', df=df)\nline['line'] = dict(dash = 'dash', color='steelblue')\n\n# add output variable to export as a html file\nlp.plot(\n data = [area, line],\n rangeslider = True,\n layout = dict(title='Time Series with confidence interval'), # layout extension\n config = dict(displayModeBar=True), # util icons on right top side\n)\n```\n![](https://github.com/billju/lazyplotly/raw/master/images/time_series.png)\n### Subplot\n```\nimport numpy as np\nimport pandas as pd\ndf = pd.DataFrame(dict(\n monday = np.random.normal(5, 1, 100),\n tuesday = np.random.normal(5, 1.5, 100),\n wednesday = np.random.normal(5, 2, 100),\n thursday = np.random.normal(5, 2.5, 100),\n friday = np.random.normal(5, 3, 100),\n saturday = np.random.normal(5, 3.5, 100),\n sunday = np.random.normal(5, 4, 100),\n))\ndata = []\nfor x in df.columns:\n for y in df.columns:\n if x==y:\n data.append(lp.histogram(x=df[x], name=x))\n else:\n data.append(lp.scatter(x=df[x], y=df[y], name=f'{x}-{y}'))\n# making subplot\nlp.plot(data, rows=7)\n\n# or a boxplot collection\nlp.plot([lp.box(y=df[col], name=col) for col in df.columns])\n```\n![](https://github.com/billju/lazyplotly/raw/master/images/subplot.png)\n![](https://github.com/billju/lazyplotly/raw/master/images/boxplot.png)\n### Sunburst, Pie, Donut\n```\ndf = dict(\n parents = ['', 'Eve', 'Eve', 'Seth', 'Seth', 'Eve', 'Eve', 'Awan', 'Eve' ],\n labels = ['Eve', 'Cain', 'Seth', 'Enos', 'Noam', 'Abel', 'Awan', 'Enoch', 'Azura'],\n values = [10, 14, 12, 10, 2, 6, 6, 4, 4]\n)\nsunburst = lp.pie(x='parents',x2='labels',y='values', df=df)\npie = lp.pie(x='labels', y='values', df=df)\ndonut = lp.pie(x='labels', y='values', df=df, hole=0.4)\nlp.plot([sunburst, pie, donut], cols=3)\n```\n![](https://github.com/billju/lazyplotly/raw/master/images/pie.png)\n### 3D scatter\n```\nimport numpy as np\ndf = dict(\n x=np.random.randint(100,size=100),\n y=np.random.randint(100,size=100),\n z=np.random.randint(100,size=100)\n)\nscatter3d = lp.scatter3d(x='x',y='y',z='z', df=df, cmap=lp.cmap[16])\nmesh3d = lp.mesh3d(x='x',y='y',z='z', df=df, color=lp.color[0])\nlp.plot([scatter3d,mesh3d], no_padding=True)\n```\n![](https://github.com/billju/lazyplotly/raw/master/images/scatter3d.png)\n\n### Sankey Diagram\n```\n# sankey diagram\ndf = dict(\n origin=['Eve', 'Cain', 'Abel', 'Abel', 'Noam'],\n destin=['Abel', 'Abel', 'Awan', 'Enoch', 'Abel'],\n count=[23,27,50,60,60]\n)\nsankey = lp.sankey(x='origin', y='destin', z='count', df=df)\nlp.plot(sankey)\n```\n![](https://github.com/billju/lazyplotly/raw/master/images/sankey.png)\n### Map\n```\ntoken = 'your mapbox api access token, get your own one at https://account.mapbox.com/'\ndf = dict(\n lon=[121.1,121.2,121.5,121.3],\n lat=[24.1,24.3,24.5,24.2],\n volume=[20,30,40,50],\n stop=['A','B','C','detail information about bus stop D']\n)\nscattermapbox = lp.scattermapbox(x='lon',y='lat',z='volume',tooltip='stop',name='bus route',df=df)\nscattermapbox['mode'] = 'markers+lines'\nlp.mapbox(scattermapbox,token=token,zoom=9)\n```\n![](https://github.com/billju/lazyplotly/raw/master/images/mapbox.png)\n### APIs\n```\nlp.cmap # show all colorscales available in plotly\nlp.color # show all defined css color name in plotly\nplot(data=[], layout=dict, output=bool, config=dict,cols=int, rows=int,\n rangeslider=bool,no_padding=bool, title=str, xlabel=str, ylabel=str)\ndropdown(datas=[[]], btn_labels=[], layout=dict, output=bool, config=dict,\n no_padding=bool, title=str, xlabel=str, ylabel=str)\nslider(datas=[[]], prefix=str, layout=dict, output=bool, config=dict,\n no_padding=bool, title=str, xlabel=str, ylabel=str)\nbar(x, y, df, name, color, cmap)\nscatter(x, y, df, name, color)\nscatter3d(x, y, z, df, name, color, cmap)\nline(x, y, df, name, color)\nline3d(x, y, z, df, name, color)\narea(x, y, y2, df, name, color)\narea3d(x, y, z, df, name, color)\nmesh3d(x, y, z, df, name, color)\nbox(y, df, name, color)\nhistogram(x, df, name, color, bins, cum, prob)\npie(x, x2, y, df, name, hole, color)\nheatmap(df, cmap)\nsankey(x, y, z, df)\nscattermapbox(x, y, z, tooltip, df, name)\nmapbox(data, token, zoom, output, config)\n```\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/billju/lazyplotly", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "lazyplotly", "package_url": "https://pypi.org/project/lazyplotly/", "platform": "", "project_url": "https://pypi.org/project/lazyplotly/", "project_urls": { "Homepage": "https://github.com/billju/lazyplotly" }, "release_url": "https://pypi.org/project/lazyplotly/1.2/", "requires_dist": null, "requires_python": "", "summary": "A wrapper of plolty which makes adding widget much more easy (and lazy)", "version": "1.2" }, "last_serial": 5351070, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "800b51dfd4d3216a7c41fdf1f58a9764", "sha256": "140fc13d1a3ca08e0227f59eeaa463685a9fed923e64a916c05b76cc0c2e7b8e" }, "downloads": -1, "filename": "lazyplotly-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "800b51dfd4d3216a7c41fdf1f58a9764", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6859, "upload_time": "2019-06-03T06:53:26", "url": "https://files.pythonhosted.org/packages/ea/cf/c0b1e9dcc67ad33e22977bb6d072afc9868bb01d6622d413c653a2c72f4a/lazyplotly-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c134a4affaa8b7d367b22ceba35d9988", "sha256": "30d8dfffd6a5446c24773ebdbd606fc317c22706b925b66d21fab57fc3d13351" }, "downloads": -1, "filename": "lazyplotly-1.1.tar.gz", "has_sig": false, "md5_digest": "c134a4affaa8b7d367b22ceba35d9988", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5179, "upload_time": "2019-05-27T12:42:24", "url": "https://files.pythonhosted.org/packages/3c/2b/c380f738407a8bb144329e6e702ff6672b8afe7f414e10f185b2bf44c280/lazyplotly-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "24aedd76f4c831c5686598f484ded129", "sha256": "df458733118765f974354e66a93fa8e176a56bb3793e9eb755af179da8d4d026" }, "downloads": -1, "filename": "lazyplotly-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "24aedd76f4c831c5686598f484ded129", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6857, "upload_time": "2019-06-03T06:56:55", "url": "https://files.pythonhosted.org/packages/02/b6/cf5f098b0b93a8c6f848ae536641e1250f01b8c648f9efda82e434a7eba5/lazyplotly-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "024480efc57209f6463da7effdb39fda", "sha256": "de6e4e74a165246ed0c6a6e17fea7a57195011a8c79b323814b43fa51071ce94" }, "downloads": -1, "filename": "lazyplotly-1.2.tar.gz", "has_sig": false, "md5_digest": "024480efc57209f6463da7effdb39fda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7108, "upload_time": "2019-06-03T06:56:56", "url": "https://files.pythonhosted.org/packages/36/79/df4df1eb9425fd46f6ee95f96f4ec8c702418674a4d65eab4815eff0c18e/lazyplotly-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "24aedd76f4c831c5686598f484ded129", "sha256": "df458733118765f974354e66a93fa8e176a56bb3793e9eb755af179da8d4d026" }, "downloads": -1, "filename": "lazyplotly-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "24aedd76f4c831c5686598f484ded129", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6857, "upload_time": "2019-06-03T06:56:55", "url": "https://files.pythonhosted.org/packages/02/b6/cf5f098b0b93a8c6f848ae536641e1250f01b8c648f9efda82e434a7eba5/lazyplotly-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "024480efc57209f6463da7effdb39fda", "sha256": "de6e4e74a165246ed0c6a6e17fea7a57195011a8c79b323814b43fa51071ce94" }, "downloads": -1, "filename": "lazyplotly-1.2.tar.gz", "has_sig": false, "md5_digest": "024480efc57209f6463da7effdb39fda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7108, "upload_time": "2019-06-03T06:56:56", "url": "https://files.pythonhosted.org/packages/36/79/df4df1eb9425fd46f6ee95f96f4ec8c702418674a4d65eab4815eff0c18e/lazyplotly-1.2.tar.gz" } ] }