{ "info": { "author": "Hadi Rahmat-Khah", "author_email": "rahmatkhah@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# **Notice**\nThis package is based on [Visdom](https://github.com/facebookresearch/visdom). It just has an additional method [Visdom.plotly()](https://github.com/rahmatkhah/visdom/blob/master/py/__init__.py#L1219) that directly supports plot.ly, see the [demo_plotly.py](https://github.com/rahmatkhah/visdom/blob/master/example/demo_plotly.py) example.\n\nRequires Python 3.6 and plot.ly\n\n```bash\n# Install Python server and client\npip install visdom_plotly\n\n```\n\n\n# **Visdom**\n\n![visdom_big](https://lh3.googleusercontent.com/-bqH9UXCw-BE/WL2UsdrrbAI/AAAAAAAAnYc/emrxwCmnrW4_CLTyyUttB0SYRJ-i4CCiQCLcB/s0/Screen+Shot+2017-03-06+at+10.51.02+AM.png\"visdom_big\")\n\nA flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.\n\n* [Overview](#overview)\n* [Concepts](#concepts)\n* [Setup](#setup)\n* [Usage](#usage)\n* [API](#api)\n* [To Do](#to-do)\n* [Contributing](#contributing)\n\n\n## Overview\n\nVisdom aims to facilitate visualization of (remote) data with an emphasis on supporting scientific experimentation.\n\n

\n\nBroadcast visualizations of plots, images, and text for yourself and your collaborators.\n\n

\n\nOrganize your visualization space programmatically or through the UI to create dashboards for live data, inspect results of experiments, or debug experimental code.\n\n

\n\n\n\n
\n\n## Concepts\nVisdom has a simple set of features that can be composed for various use-cases.\n\n#### Panes\n

\n\n\nThe UI begins as a blank slate -- you can populate it with plots, images, and text. These appear in windows that you can drag, drop, resize, and destroy. The windows live in `envs` and the state of `envs` is stored across sessions. You can download the content of windows -- including your plots in `svg`.\n\n\n\n> **Tip**: You can use the zoom of your browser to adjust the scale of the UI.\n\n\n\n#### Environments\n

\n\nYou can partition your visualization space with `envs`. By default, every user will have an env called `main`. New envs can be created in the UI or programmatically. The state of envs is chronically saved.\n\nYou can access a specific env via url: `http://localhost.com:8097/env/main`. If your server is hosted, you can share this url so others can see your visualizations too.\n\n>**Managing Envs:**\n>Your envs are loaded at initialization of the server, by default from `$HOME/.visdom/`. Custom paths can be passed as a cmd-line argument. Envs are removed by deleting the corresponding `.json` file from the env dir.\n\n#### State\nOnce you've created a few visualizations, state is maintained. The server automatically caches your visualizations -- if you reload the page, your visualizations reappear.\n\n

\n\n* **Save:** You can manually do so with the `save` button. This will serialize the env's state (to disk, in JSON), including window positions. You can save an `env` programmatically.\n
This is helpful for more sophisticated visualizations in which configuration is meaningful, e.g. a data-rich demo, a model training dashboard, or systematic experimentation. This also makes them easy to share and reuse.\n\n\n* **Fork:** If you enter a new env name, saving will create a new env -- effectively **forking** the previous env.\n\n#### Filter\nYou can use the `filter` to dynamically sift through windows present in an env -- just provide a regular expression with which to match titles of window you want to show. This can be helpful in use cases involving an env with many windows e.g. when systematically checking experimental results.\n\n

\n\n\n## Setup\n\nRequires Python 2.7/3 (and optionally Torch7)\n\n```bash\n# Install Python server and client\npip install visdom\n\n# Install Torch client\nluarocks install visdom\n\n```\n\n```bash\n# Install python from source\npip install -e .\n# If the above runs into issues, you can try the below\neasy_install .\n\n# Install Torch client from source (from th directory)\nluarocks make\n\n```\n\n## Usage\n\nStart the server (probably in a `screen` or `tmux`) :\n\n```bash\npython -m visdom.server\n```\n\nVisdom now can be accessed by going to `http://localhost:8097` in your browser, or your own host address if specified.\n\n>If the above does not work, try using an SSH tunnel to your server by adding the following line to your local `~/.ssh/config`:\n```LocalForward 127.0.0.1:8097 127.0.0.1:8097```.\n\n#### Python example\n```python\nimport visdom\nimport numpy as np\nvis = visdom.Visdom()\nvis.text('Hello, world!')\nvis.image(np.ones((3, 10, 10)))\n```\n\n#### Torch example\n```lua\nrequire 'image'\nvis = require 'visdom'()\nvis:text{text = 'Hello, world!'}\nvis:image{img = image.fabio()}\n```\n\nSome users have reported issues when connecting Lua clients to the Visdom server.\nA potential work-around may be to switch off IPv6:\n```\nvis = require 'visdom'()\nvis.ipv6 = false -- switches off IPv6\nvis:text{text = 'Hello, world!'}\n```\n\n\n### Demos\n\n```bash\npython example/demo.py\nth example/demo1.lua\nth example/demo2.lua\n```\n\n\n## API\nFor a quick introduction into the capabilities of `visdom`, have a look at the `example` directory, or read the details below.\n\n### Basics\nVisdom offers the following basic visualization functions:\n- [`vis.image`](#visimage) : image\n- [`vis.images`](#visimages) : list of images\n- [`vis.text`](#vistext) : arbitrary HTML\n- [`vis.video`](#visvideo) : videos\n- [`vis.svg`](#vissvg) : SVG object\n- [`vis.save`](#vissave) : serialize state server-side\n\n### Plotting\nWe have wrapped several common plot types to make creating basic visualizations easily. These visualizations are powered by [Plotly](https://plot.ly/).\n\nThe following API is currently supported:\n- [`vis.scatter`](#visscatter) : 2D or 3D scatter plots\n- [`vis.line`](#visline) : line plots\n- [`vis.updateTrace`](#visupdatetrace) : update existing line/scatter plots\n- [`vis.stem`](#visstem) : stem plots\n- [`vis.heatmap`](#visheatmap) : heatmap plots\n- [`vis.bar`](#visbar) : bar graphs\n- [`vis.histogram`](#vishistogram) : histograms\n- [`vis.boxplot`](#visboxplot) : boxplots\n- [`vis.surf`](#vissurf) : surface plots\n- [`vis.contour`](#viscontour) : contour plots\n- [`vis.quiver`](#visquiver) : quiver plots\n- [`vis.mesh`](#vismesh) : mesh plots\n\n### Generic Plots\nNote that the server API adheres to the Plotly convention of `data` and `layout` objects, such that you can produce your own arbitrary `Plotly` visualizations:\n\n```python\nimport visdom\nvis = visdom.Visdom()\n\ntrace = dict(x=[1, 2, 3], y=[4, 5, 6], mode=\"markers+lines\", type='custom'\n marker={'color': 'red', 'symbol': 104, 'size': \"10\"},\n text=[\"one\", \"two\", \"three\"], name='1st Trace')\nlayout = dict(title=\"First Plot\", xaxis={'title': 'x1'}, yaxis={'title': 'x2'})\n\nvis._send({'data': [trace], 'layout': layout, 'win': 'mywin'})\n```\n\n### Others\n- [`vis.close`](#visclose) : close a window by id\n- [`vis.win_exists`](#viswin_exists) : check if a window already exists by id\n- [`vis.check_connection`](#vischeck_connection): check if the server is connected\n\n## Details\n![visdom_big](https://lh3.googleusercontent.com/-bqH9UXCw-BE/WL2UsdrrbAI/AAAAAAAAnYc/emrxwCmnrW4_CLTyyUttB0SYRJ-i4CCiQCLcB/s0/Screen+Shot+2017-03-06+at+10.51.02+AM.png\"visdom_big\")\n\n### Basics\n\n#### vis.image\nThis function draws an `img`. It takes as input an `CxHxW` tensor `img`\nthat contains the image.\n\nThe following `opts` are supported:\n\n- `opts.jpgquality`: JPG quality (`number` 0-100; default = 100)\n- `opts.caption`: Caption for the image\n\n#### vis.images\n\nThis function draws a list of `images`. It takes an input `B x C x H x W` tensor or a `list of images` all of the same size. It makes a grid of images of size (B / nrow, nrow).\n\nThe following arguments and `opts` are supported:\n\n- `nrow`: Number of images in a row\n- `padding`: Padding around the image, equal padding around all 4 sides\n- `opts.jpgquality`: JPG quality (`number` 0-100; default = 100)\n- `opts.caption`: Caption for the image\n\n#### vis.text\nThis function prints text in a box. You can use this to embed arbitrary HTML.\nIt takes as input a `text` string.\nNo specific `opts` are currently supported.\n\n#### vis.video\nThis function plays a video. It takes as input the filename of the video\n`videofile` or a `LxHxWxC`-sized\n`tensor` containing all the frames of the video as input. The\nfunction does not support any plot-specific `opts`.\n\nThe following `opts` are supported:\n\n- `opts.fps`: FPS for the video (`integer` > 0; default = 25)\n\nNote: Using `tensor` input requires that ffmpeg is installed and working.\nYour ability to play video may depend on the browser you use: your browser has\nto support the Theano codec in an OGG container (Chrome supports this).\n\n#### vis.svg\nThis function draws an SVG object. It takes as input a SVG string `svgstr` or\nthe name of an SVG file `svgfile`. The function does not support any specific\n`opts`.\n\n#### vis.save\nThis function saves the `envs` that are alive on the visdom server. It takes input a list (in python) or table (in lua) of env ids to be saved.\n\n### Plotting\nFurther details on the wrapped plotting functions are given below.\n\nThe exact inputs into the plotting functions vary, although most of them take as input a tensor `X` than contains the data and an (optional) tensor `Y` that contains optional data variables (such as labels or timestamps). All plotting functions take as input an optional `win` that can be used to plot into a specific window; each plotting function also returns the `win` of the window it plotted in. One can also specify the `env` to which the visualization should be added.\n\n#### vis.scatter\n\nThis function draws a 2D or 3D scatter plot. It takes as input an `Nx2` or\n`Nx3` tensor `X` that specifies the locations of the `N` points in the\nscatter plot. An optional `N` tensor `Y` containing discrete labels that\nrange between `1` and `K` can be specified as well -- the labels will be\nreflected in the colors of the markers.\n\n`update` can be used to efficiently update the data of an existing plot. Use 'append' to append data, 'replace' to use new data. If updating a single trace, use `name` to specify the name of the trace to be updated. Update data that is all NaN is ignored (can be used for masking update).\n\nThe following `opts` are supported:\n\n- `opts.colormap` : colormap (`string`; default = `'Viridis'`)\n- `opts.markersymbol`: marker symbol (`string`; default = `'dot'`)\n- `opts.markersize` : marker size (`number`; default = `'10'`)\n- `opts.markercolor` : color per marker. (`torch.*Tensor`; default = `nil`)\n- `opts.legend` : `table` containing legend names\n\n`opts.markercolor` is a Tensor with Integer values. The tensor can be of size `N` or `N x 3` or `K` or `K x 3`.\n\n- Tensor of size `N`: Single intensity value per data point. 0 = black, 255 = red\n- Tensor of size `N x 3`: Red, Green and Blue intensities per data point. 0,0,0 = black, 255,255,255 = white\n- Tensor of size `K` and `K x 3`: Instead of having a unique color per data point, the same color is shared for all points of a particular label.\n\n\n#### vis.line\nThis function draws a line plot. It takes as input an `N` or `NxM` tensor\n`Y` that specifies the values of the `M` lines (that connect `N` points)\nto plot. It also takes an optional `X` tensor that specifies the\ncorresponding x-axis values; `X` can be an `N` tensor (in which case all\nlines will share the same x-axis values) or have the same size as `Y`.\n\n`update` can be used to efficiently update the data of an existing plot. Use 'append' to append data, 'replace' to use new data. If updating a single trace, use `name` to specify the name of the trace to be updated. Update data that is all NaN is ignored (can be used for masking update).\n\nThe following `opts` are supported:\n\n- `opts.fillarea` : fill area below line (`boolean`)\n- `opts.colormap` : colormap (`string`; default = `'Viridis'`)\n- `opts.markers` : show markers (`boolean`; default = `false`)\n- `opts.markersymbol`: marker symbol (`string`; default = `'dot'`)\n- `opts.markersize` : marker size (`number`; default = `'10'`)\n- `opts.legend` : `table` containing legend names\n\n\n#### vis.updateTrace\nThis function allows updating of data for extant line or scatter plots.\n\nIt is up to the user to specify `name` of an existing trace if they want\nto add to it, and a new `name` if they want to add a trace to the plot.\nBy default, if no legend is specified at time of first creation,\nthe `name` is the index of the line in the legend.\n\nIf no `name` is specified, all traces should be updated.\nTrace update data that is all `NaN` is ignored;\nthis can be used for masking update.\n\nThe `append` parameter determines if the update data should be appended\nto or replaces existing data.\n\nThere are no `opts` because they are assumed to be inherited from the\nspecified plot.\n\n*Note: This function will be deprecated in upcoming versions.*\n\n#### vis.stem\nThis function draws a stem plot. It takes as input an `N` or `NxM` tensor\n`X` that specifies the values of the `N` points in the `M` time series.\nAn optional `N` or `NxM` tensor `Y` containing timestamps can be specified\nas well; if `Y` is an `N` tensor then all `M` time series are assumed to\nhave the same timestamps.\n\nThe following `opts` are supported:\n\n- `opts.colormap`: colormap (`string`; default = `'Viridis'`)\n- `opts.legend` : `table` containing legend names\n\n#### vis.heatmap\nThis function draws a heatmap. It takes as input an `NxM` tensor `X` that\nspecifies the value at each location in the heatmap.\n\nThe following `opts` are supported:\n\n- `opts.colormap` : colormap (`string`; default = `'Viridis'`)\n- `opts.xmin` : clip minimum value (`number`; default = `X:min()`)\n- `opts.xmax` : clip maximum value (`number`; default = `X:max()`)\n- `opts.columnnames`: `table` containing x-axis labels\n- `opts.rownames` : `table` containing y-axis labels\n\n#### vis.bar\nThis function draws a regular, stacked, or grouped bar plot. It takes as\ninput an `N` or `NxM` tensor `X` that specifies the height of each of the\nbars. If `X` contains `M` columns, the values corresponding to each row\nare either stacked or grouped (depending on how `opts.stacked` is\nset). In addition to `X`, an (optional) `N` tensor `Y` can be specified\nthat contains the corresponding x-axis values.\n\nThe following plot-specific `opts` are currently supported:\n\n- `opts.rownames`: `table` containing x-axis labels\n- `opts.stacked` : stack multiple columns in `X`\n- `opts.legend` : `table` containing legend labels\n\n#### vis.histogram\nThis function draws a histogram of the specified data. It takes as input\nan `N` tensor `X` that specifies the data of which to construct the\nhistogram.\n\nThe following plot-specific `opts` are currently supported:\n\n- `opts.numbins`: number of bins (`number`; default = 30)\n\n#### vis.boxplot\nThis function draws boxplots of the specified data. It takes as input\nan `N` or an `NxM` tensor `X` that specifies the `N` data values of which\nto construct the `M` boxplots.\n\nThe following plot-specific `opts` are currently supported:\n\n- `opts.legend`: labels for each of the columns in `X`\n\n#### vis.surf\nThis function draws a surface plot. It takes as input an `NxM` tensor `X`\nthat specifies the value at each location in the surface plot.\n\nThe following `opts` are supported:\n\n- `opts.colormap`: colormap (`string`; default = `'Viridis'`)\n- `opts.xmin` : clip minimum value (`number`; default = `X:min()`)\n- `opts.xmax` : clip maximum value (`number`; default = `X:max()`)\n\n#### vis.contour\nThis function draws a contour plot. It takes as input an `NxM` tensor `X`\nthat specifies the value at each location in the contour plot.\n\nThe following `opts` are supported:\n\n- `opts.colormap`: colormap (`string`; default = `'Viridis'`)\n- `opts.xmin` : clip minimum value (`number`; default = `X:min()`)\n- `opts.xmax` : clip maximum value (`number`; default = `X:max()`)\n\n#### vis.quiver\nThis function draws a quiver plot in which the direction and length of the\narrows is determined by the `NxM` tensors `X` and `Y`. Two optional `NxM`\ntensors `gridX` and `gridY` can be provided that specify the offsets of\nthe arrows; by default, the arrows will be done on a regular grid.\n\nThe following `opts` are supported:\n\n- `opts.normalize`: length of longest arrows (`number`)\n- `opts.arrowheads`: show arrow heads (`boolean`; default = `true`)\n\n#### vis.mesh\nThis function draws a mesh plot from a set of vertices defined in an\n`Nx2` or `Nx3` matrix `X`, and polygons defined in an optional `Mx2` or\n`Mx3` matrix `Y`.\n\nThe following `opts` are supported:\n\n- `opts.color`: color (`string`)\n- `opts.opacity`: opacity of polygons (`number` between 0 and 1)\n\n### Customizing plots\n\nThe plotting functions take an optional `opts` table as input that can be used to change (generic or plot-specific) properties of the plots. All input arguments are specified in a single table; the input arguments are matches based on the keys they have in the input table.\n\nThe following `opts` are generic in the sense that they are the same for all visualizations (except `plot.image` and `plot.text`):\n\n- `opts.title` : figure title\n- `opts.width` : figure width\n- `opts.height` : figure height\n- `opts.showlegend` : show legend (`true` or `false`)\n- `opts.xtype` : type of x-axis (`'linear'` or `'log'`)\n- `opts.xlabel` : label of x-axis\n- `opts.xtick` : show ticks on x-axis (`boolean`)\n- `opts.xtickmin` : first tick on x-axis (`number`)\n- `opts.xtickmax` : last tick on x-axis (`number`)\n- `opts.xtickvals` : locations of ticks on x-axis (`table` of `number`s)\n- `opts.xticklabels` : ticks labels on x-axis (`table` of `string`s)\n- `opts.xtickstep` : distances between ticks on x-axis (`number`)\n- `opts.ytype` : type of y-axis (`'linear'` or `'log'`)\n- `opts.ylabel` : label of y-axis\n- `opts.ytick` : show ticks on y-axis (`boolean`)\n- `opts.ytickmin` : first tick on y-axis (`number`)\n- `opts.ytickmax` : last tick on y-axis (`number`)\n- `opts.ytickvals` : locations of ticks on y-axis (`table` of `number`s)\n- `opts.yticklabels` : ticks labels on y-axis (`table` of `string`s)\n- `opts.ytickstep` : distances between ticks on y-axis (`number`)\n- `opts.marginleft` : left margin (in pixels)\n- `opts.marginright` : right margin (in pixels)\n- `opts.margintop` : top margin (in pixels)\n- `opts.marginbottom`: bottom margin (in pixels)\n\nThe other options are visualization-specific, and are described in the\ndocumentation of the functions.\n\n### Others\n\n#### vis.close\n\nThis function closes a specific window. It takes input window id `win` and environment id `eid`. Use `win` as `None` to close all windows in an environment.\n\n#### vis.win_exists\n\nThis function returns a bool indicating whether or not a window `win` exists on the server already. Returns None if something went wrong.\n\nOptional arguments:\n- `env`: Environment to search for the window in. Default is `None`.\n\n#### vis.check_connection\n\nThis function returns a bool indicating whether or not the server is connected.\n\n## To Do\n\n- [ ] Command line tool for easy systematic plotting from live logs.\n- [ ] Filtering through windows with regex by title (or meta field)\n- [ ] Compiling react by python server at runtime\n\n## Contributing\nSee guidelines for contributing [here.](./CONTRIBUTING.md)\n\n## Acknowledgments\nVisdom was inspired by tools like [display](https://github.com/szym/display) and relies on [Plotly](https://plot.ly/) as a plotting front-end.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rahmatkhah/visdom", "keywords": "", "license": "CC-BY-4.0", "maintainer": "", "maintainer_email": "", "name": "visdom_plotly", "package_url": "https://pypi.org/project/visdom_plotly/", "platform": "", "project_url": "https://pypi.org/project/visdom_plotly/", "project_urls": { "Homepage": "https://github.com/rahmatkhah/visdom" }, "release_url": "https://pypi.org/project/visdom_plotly/0.1.6.4.4/", "requires_dist": null, "requires_python": "", "summary": "Visdom with the plot.ly support", "version": "0.1.6.4.4" }, "last_serial": 3423897, "releases": { "0.1.6.4.2": [ { "comment_text": "", "digests": { "md5": "3849f79c2885c4bb346d5d3fb93dda4b", "sha256": "1fbc0b904024033f98a0d4253ccdcf1ee57f1c9f9287c5709c522b5f1be019e1" }, "downloads": -1, "filename": "visdom_plotly-0.1.6.4.2.tar.gz", "has_sig": false, "md5_digest": "3849f79c2885c4bb346d5d3fb93dda4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39853, "upload_time": "2017-12-17T16:44:07", "url": "https://files.pythonhosted.org/packages/36/d7/c3166289a2daed8ace481e39dd16c9da7a9c05cb13621b761ba141ee2884/visdom_plotly-0.1.6.4.2.tar.gz" } ], "0.1.6.4.3": [ { "comment_text": "", "digests": { "md5": "9ea12d3d97b9e9208f42e25e216bacce", "sha256": "55322738716f016054e5c5db8cebc5a746b4324121aa7bbd4ce9643994267824" }, "downloads": -1, "filename": "visdom_plotly-0.1.6.4.3.tar.gz", "has_sig": false, "md5_digest": "9ea12d3d97b9e9208f42e25e216bacce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39801, "upload_time": "2017-12-17T19:39:12", "url": "https://files.pythonhosted.org/packages/97/33/1323ff5873dc4cd68afdbbc5bc5616b5ea8f33b68a3da09ebd7286522774/visdom_plotly-0.1.6.4.3.tar.gz" } ], "0.1.6.4.4": [ { "comment_text": "", "digests": { "md5": "6f8d2719ea10065745cf040663d042a7", "sha256": "1608193746ff9b08f137a288ddad5ba796ba57d30ee1eaf1df930116e830cf7b" }, "downloads": -1, "filename": "visdom_plotly-0.1.6.4.4.tar.gz", "has_sig": false, "md5_digest": "6f8d2719ea10065745cf040663d042a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39799, "upload_time": "2017-12-18T00:39:21", "url": "https://files.pythonhosted.org/packages/53/46/bb51ea40effbf690ea61ef3fbb975d21d1249ff90e75b695797118316143/visdom_plotly-0.1.6.4.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6f8d2719ea10065745cf040663d042a7", "sha256": "1608193746ff9b08f137a288ddad5ba796ba57d30ee1eaf1df930116e830cf7b" }, "downloads": -1, "filename": "visdom_plotly-0.1.6.4.4.tar.gz", "has_sig": false, "md5_digest": "6f8d2719ea10065745cf040663d042a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39799, "upload_time": "2017-12-18T00:39:21", "url": "https://files.pythonhosted.org/packages/53/46/bb51ea40effbf690ea61ef3fbb975d21d1249ff90e75b695797118316143/visdom_plotly-0.1.6.4.4.tar.gz" } ] }