# Deephaven Plugin for Plotly
The Deephaven Plugin for Plotly. Allows for opening Plotly plots in a Deephaven environment. Any Plotly plot
should be viewable by default. For example:
### Scatter Plot
```python
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species",
size='petal_length', hover_data=['petal_width'])
```
### Box Plot
```python
import plotly.express as px
df = px.data.tips()
fig = px.box(df, x="time", y="total_bill")
```
### Multiple Series
It's possible to have multiple kinds of series in the same figure. Here is an example driving a line and a bar plot:
```python
from plotly.subplots import make_subplots
import plotly.graph_objects as go
fig = make_subplots(rows=1, cols=2)
fig.add_trace(
go.Scatter(x=[1, 2, 3], y=[4, 5, 6]),
row=1, col=1)
fig.add_trace(
go.Bar(x=[1, 2, 3], y=[4, 5, 6], marker=dict(color=[4, 5, 6], coloraxis="coloraxis")),
row=1, col=2)
fig.update_layout(title_text="Side By Side Subplots", showlegend=False)
```
### Plot data from a Deephaven table
```python
from deephaven import empty_table, numpy
import plotly.express as px
t = empty_table(300).update(formulas=["X = (double)i", "Y = Math.sin(X)"])
data = numpy.to_numpy(t, ["X", "Y"])
fig = px.line(x=data[:,0], y=data[:,1])
```
## Build
To create your build / development environment:
```sh
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip setuptools
pip install build deephaven-plugin plotly
```
To build:
```sh
python -m build --wheel
```
The wheel is stored in `dist/`.
To test within [deephaven-core](https://github.com/deephaven/deephaven-core), note where this wheel is stored (using `pwd`, for example).
Then, follow the directions in the [deephaven-js-plugins](https://github.com/deephaven/deephaven-js-plugins) repo.
Raw data
{
"_id": null,
"home_page": "https://github.com/deephaven/deephaven-plugin-plotly",
"name": "deephaven-plugin-plotly",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "deephaven,plugin,plotly",
"author": "Devin Smith, Vlad Babich",
"author_email": "vladbabich@deephaven.io",
"download_url": "https://files.pythonhosted.org/packages/fd/65/a7f0d99aa0ecf9d2dc16cf8fa0d43ac4dd4026825e5130b67d5abc9fffdc/deephaven-plugin-plotly-0.2.0.tar.gz",
"platform": "any",
"description": "# Deephaven Plugin for Plotly\n\nThe Deephaven Plugin for Plotly. Allows for opening Plotly plots in a Deephaven environment. Any Plotly plot\nshould be viewable by default. For example:\n\n### Scatter Plot\n```python\nimport plotly.express as px\ndf = px.data.iris()\nfig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", color=\"species\",\n size='petal_length', hover_data=['petal_width'])\n```\n\n### Box Plot\n```python\nimport plotly.express as px\ndf = px.data.tips()\nfig = px.box(df, x=\"time\", y=\"total_bill\")\n```\n\n### Multiple Series\nIt's possible to have multiple kinds of series in the same figure. Here is an example driving a line and a bar plot:\n```python\nfrom plotly.subplots import make_subplots\nimport plotly.graph_objects as go\nfig = make_subplots(rows=1, cols=2)\nfig.add_trace(\n go.Scatter(x=[1, 2, 3], y=[4, 5, 6]),\n row=1, col=1)\nfig.add_trace(\n go.Bar(x=[1, 2, 3], y=[4, 5, 6], marker=dict(color=[4, 5, 6], coloraxis=\"coloraxis\")),\n row=1, col=2)\nfig.update_layout(title_text=\"Side By Side Subplots\", showlegend=False)\n```\n\n### Plot data from a Deephaven table\n```python\nfrom deephaven import empty_table, numpy\nimport plotly.express as px\nt = empty_table(300).update(formulas=[\"X = (double)i\", \"Y = Math.sin(X)\"])\ndata = numpy.to_numpy(t, [\"X\", \"Y\"])\nfig = px.line(x=data[:,0], y=data[:,1])\n```\n\n## Build\n\nTo create your build / development environment:\n\n```sh\npython -m venv .venv\nsource .venv/bin/activate\npip install --upgrade pip setuptools\npip install build deephaven-plugin plotly\n```\n\nTo build:\n\n```sh\npython -m build --wheel\n```\n\nThe wheel is stored in `dist/`. \n\nTo test within [deephaven-core](https://github.com/deephaven/deephaven-core), note where this wheel is stored (using `pwd`, for example).\nThen, follow the directions in the [deephaven-js-plugins](https://github.com/deephaven/deephaven-js-plugins) repo.\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Deephaven Plugin for Plotly",
"version": "0.2.0",
"project_urls": {
"Bug Tracker": "https://github.com/deephaven/deephaven-plugin-plotly/issues",
"Homepage": "https://github.com/deephaven/deephaven-plugin-plotly",
"Source Code": "https://github.com/deephaven/deephaven-plugin-plotly"
},
"split_keywords": [
"deephaven",
"plugin",
"plotly"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eb195361852b833afaec8b75969e5f175e014ff14050ca84526c9612e173f787",
"md5": "5b610966d800069b292d8660607913ad",
"sha256": "80318feedadfa94cb53e5e2846cb2b5700e275642c5a4ed40a85f8b7de037cab"
},
"downloads": -1,
"filename": "deephaven_plugin_plotly-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5b610966d800069b292d8660607913ad",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 8472,
"upload_time": "2023-08-10T20:58:13",
"upload_time_iso_8601": "2023-08-10T20:58:13.529463Z",
"url": "https://files.pythonhosted.org/packages/eb/19/5361852b833afaec8b75969e5f175e014ff14050ca84526c9612e173f787/deephaven_plugin_plotly-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fd65a7f0d99aa0ecf9d2dc16cf8fa0d43ac4dd4026825e5130b67d5abc9fffdc",
"md5": "a2efeb17b64e8f25e5031989cf20db6b",
"sha256": "b1bd5faada8512c9e48f2c25265b2993bac5ab829f17109b51f8a05ac2a1c5af"
},
"downloads": -1,
"filename": "deephaven-plugin-plotly-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "a2efeb17b64e8f25e5031989cf20db6b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7587,
"upload_time": "2023-08-10T20:58:15",
"upload_time_iso_8601": "2023-08-10T20:58:15.108635Z",
"url": "https://files.pythonhosted.org/packages/fd/65/a7f0d99aa0ecf9d2dc16cf8fa0d43ac4dd4026825e5130b67d5abc9fffdc/deephaven-plugin-plotly-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-10 20:58:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "deephaven",
"github_project": "deephaven-plugin-plotly",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "deephaven-plugin-plotly"
}