{ "info": { "author": "fullflu", "author_email": "k.takayama0902@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6" ], "description": "# floweaver-path\n\n## Description\n\n![Demo](https://github.com/fullflu/floweaver-path/blob/master/demo/floweaver_path_demo.gif)\n\nThis library (floweaver-path) is an extension of the [floweaver](https://sankeyview.readthedocs.io/en/latest/) to handle the visualization of paths that pass through a selected node.\n\nWe focus on the visualization of longitudinal data.\n\nThe idea of our visualization is based on [pathSankey](https://bl.ocks.org/jeinarsson/e37aa55c3b0e11ae6fa1), that is an extension of [d3-sankey](https://github.com/d3/d3-sankey).\n\nThe color of paths that pass through a selected node is yellow-green (highlighted), and that of other paths is gray.\n\nYou can interactively select a node by using dropdowns in jupyter notebook.\n\nWe have two technical contributions to the field of visualization using Sankey diagrams.\n\nOne is to extend the layer number:\n- Ordinary Sankey diagrams can only visualize paths between 2 layers.\n- pathSankey can only visualize paths between 3 layers.\n- We can visualize the comparison of paths between two layers before and after (up to 5 layers).\n\nThe other is to create a notebook that can interact with users. We integrate several functions of ipywidgets into floweaver.\n\n## Requirement\n\n### installation using docker\n- docker (installs two libraries: floweaver(==2.0.0a5), ipysankeywidget==0.2.5)\n- input file (`*.csv, *.pickle or *.xlsx` should be put in `interaction/data` directory if you do not specify the data directory)\n\n### installation using pip\n- pip\n- python (3.6)\n- input file (`*.csv, *.pickle or *.xlsx` should be put in `interaction/data` directory if you do not specify the data directory)\n\nTwo libraries (floweaver>=2.0.0a5, ipysankeywidget>=0.2.5) will be installed.\n\n## Setup (when you install using docker)\n\n### build\n\n`scripts/build`\n\n### run notebook\n\n`scripts/run-notebooks`\n\nRun docker, and connect `interaction` to `work`.\n\nData and notebooks are shared between a docker image and your local system.\n\n### use notebooks in browser\n\nOpen a new browser tab and type `localhost: 10001` in the URL.\n\nCopy and paste a token to use notebooks. The token you can use is displayed in your terminal as follows:\n\n`http://( or 127.0.0.1):8888/?token=`\n\n## Setup (when you install using pip)\n\nYou can install floweaver_path by the ordinary installation command\n\n```\npip install floweaver_path\n```\n\nYou might need to execute the following commands\n\n```\njupyter nbextension install --py widgetsnbextension --user\njupyter nbextension install --py ipysankeywidget --user\njupyter nbextension enable widgetsnbextension --user --py\njupyter nbextension enable ipysankeywidget --user --py\n```\n\n## Usage\n\n### prepare data\n\nIf you install floweaver_path using docker, you need to put your local file under the `interaction` directory. You can use the jupyter notebook to upload your local file. You can also directly put your local file under the `interaction` directory.\n\nIf you install floweaver_path using pip, you do not need to move your local file because you can specify the all local paths.\n\nWe focus on longitudinal data. The format of your file should be as follows:\n```\n index date value1 value2\n0 1 2016/04/01 1 3\n1 2 2016/10/01 3 2\n2 1 2016/04/01 4 1\n```\n\n- index: This variable is handled as user id.\n- date: This variable is handled as the date and visualized in the x-axis (in terms of sankey diagrams, `layer`). Data should not be duplicated with respect to a pair of (index, date).\n- value[n] (): These variables are handled as target variables. One of those variables is visualized in the y-axis (in terms of sankey diagrams, `node` in each layer).\n\nThe name of each variable can be changed between files. You can select which variable to use interactively.\n\nNote that we support three types of file extensions: `.csv`, `.xlsx` and `.pickle`\nPlease check the details of the data by loading `data/template_data.csv`.\n\n### launch a working notebook\n\nThe template notebook (`template.ipynb`) should not be changed.\nI recommend you to duplicate the template notebook and work on the duplicated notebook.\n\n### call the visualizer\n\nYou can import the visualizer and call it as follows.\n\n```\nfrom floweaver_path import visualizer\nvisualizer()\n```\n\nThe `visualizer` function has 5 arguments:\n- data_dir (default='./data'): where you put your local files\n- width (default=1070): the width of visualized figures\n- height (default=500): the width of visualized figures\n- target_color (default='yellowgreen'): the color of paths that pass through a selected node.\n- base_color (default='gray'): the width of paths that do not pass through a selected node.\n\n\n### select a target node\n\nWe prepare 7 dropdowns for users to interact with floweaver.\n- multiple display?: whether this library displays multiple images or not.\n- file path: data to be analyzed.\n- index column: column name that contains id information (e.g., user_id).\n- date column: column name that contains date information (handled as a `layer` and visualized in the x-axis).\n- target varible: column name that you want to analyze (handled as a `node` in each layer and visualized in the y-axis).\n- target date: value name that you want to select as the value of your target date.\n- target value: value name that you want to select as the value of your target variable.\n\nThe dependence between the dropdowns is updated as soon as you select each value.\n\n\n## Authors\n\n- [@fullflu](https://github.com/fullflu) proposed to create this library and prepared basic scripts.\n- [@adamist](https://github.com/adamist) created `Dockerfile`, `build` and `run-notebook` scripts.\n\n\n## Contributors\n\nPlease feel free to create issues or to contribute to floweaver-path!\nIt would be useful to contribute to the original [floweaver](https://github.com/ricklupton/floweaver/blob/master/CONTRIBUTING.md) library.\n\n## License\n\n[MIT](https://github.com/fullflu/floweaver-path/blob/master/LICENSE)\n\n\n## Structure\n\n```\n\u251c\u2500\u2500 Dockerfile\n\u251c\u2500\u2500 LICENSE\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 demo\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 floweaver_path_demo.gif\n\u251c\u2500\u2500 interaction\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 data\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 template_data.csv\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 template.ipynb\n\u251c\u2500\u2500 requirements.txt\n\u251c\u2500\u2500 scripts\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 build\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 run-notebook\n\u251c\u2500\u2500 setup.py\n\u251c\u2500\u2500 src\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 floweaver_path\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 __init__.py\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 lib\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 __init__.py\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 ts_sankey.py\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 utils.py\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 visualizer.py\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 template\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 data\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 template.csv\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 notebooks\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 template.ipynb\n\u2514\u2500\u2500 tests\n \u251c\u2500\u2500 test_extract_files.py\n \u2514\u2500\u2500 test_load_file.py\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/fullflu/floweaver-path", "keywords": "floweaver-path", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "floweaver-path", "package_url": "https://pypi.org/project/floweaver-path/", "platform": "", "project_url": "https://pypi.org/project/floweaver-path/", "project_urls": { "Homepage": "https://github.com/fullflu/floweaver-path" }, "release_url": "https://pypi.org/project/floweaver-path/0.0.3/", "requires_dist": [ "floweaver", "ipysankeywidget" ], "requires_python": "", "summary": "floweaver extension to handle the path visualization", "version": "0.0.3" }, "last_serial": 5599818, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "59dd4b82983bef4f7cb10d242162e52b", "sha256": "9ef1ac83eda303b6a5b0b60890f3307083eceb662075ab5e872d45ecd721e72a" }, "downloads": -1, "filename": "floweaver_path-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "59dd4b82983bef4f7cb10d242162e52b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8418, "upload_time": "2019-07-29T14:27:57", "url": "https://files.pythonhosted.org/packages/67/d5/1809d7126ba59b68a95bc592b2e236b21c213cb2b4e2dd3087ead60febeb/floweaver_path-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ec56b558f179db7f8151746fe3aca7d", "sha256": "0fb0410256cbe6013f7e954dbdd6fc8ba85ea70c9ecb89ef178a2dcbae50f411" }, "downloads": -1, "filename": "floweaver-path-0.0.3.tar.gz", "has_sig": false, "md5_digest": "6ec56b558f179db7f8151746fe3aca7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8509, "upload_time": "2019-07-29T14:28:00", "url": "https://files.pythonhosted.org/packages/1c/29/07d3c0d6ec0421fbff5097e62bb4745ff0a54ae539d67ef13de403c87dba/floweaver-path-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "59dd4b82983bef4f7cb10d242162e52b", "sha256": "9ef1ac83eda303b6a5b0b60890f3307083eceb662075ab5e872d45ecd721e72a" }, "downloads": -1, "filename": "floweaver_path-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "59dd4b82983bef4f7cb10d242162e52b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8418, "upload_time": "2019-07-29T14:27:57", "url": "https://files.pythonhosted.org/packages/67/d5/1809d7126ba59b68a95bc592b2e236b21c213cb2b4e2dd3087ead60febeb/floweaver_path-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ec56b558f179db7f8151746fe3aca7d", "sha256": "0fb0410256cbe6013f7e954dbdd6fc8ba85ea70c9ecb89ef178a2dcbae50f411" }, "downloads": -1, "filename": "floweaver-path-0.0.3.tar.gz", "has_sig": false, "md5_digest": "6ec56b558f179db7f8151746fe3aca7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8509, "upload_time": "2019-07-29T14:28:00", "url": "https://files.pythonhosted.org/packages/1c/29/07d3c0d6ec0421fbff5097e62bb4745ff0a54ae539d67ef13de403c87dba/floweaver-path-0.0.3.tar.gz" } ] }