Skip to content

Commit

Permalink
Removes deprecated package jupyter dash (#79)
Browse files Browse the repository at this point in the history
* rm jupyter dash

* require ipython
  • Loading branch information
carolinebridge authored Dec 7, 2023
1 parent 2456f88 commit c93cdaa
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 118 deletions.
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,15 @@ $ pip install jupyter-dash
```

```python
from jupyter_dash import JupyterDash

from dash import html
from dash import html, Dash, jupyter_dash
from jbrowse_jupyter import create, create_component
import jupyter_server_proxy

JupyterDash.infer_jupyter_proxy_config()
#JupyterDash()._server_proxy # true if the proxy works as expected
#JupyterDash().config # gives the proxy config
jupyter_dash.infer_jupyter_proxy_config()
#jupyter_dash._server_proxy # true if the proxy works as expected
#jupyter_dash.config # gives the proxy config

app = JupyterDash(__name__)
app = Dash(__name__)
jbrowse_conf = create("LGV", genome="hg38")

config = jbrowse_conf.get_config()
Expand Down Expand Up @@ -147,12 +145,12 @@ You can find examples in the root of this repo or in the examples folder,

- `browser.py` - uses the Dash library to create a python application with the
Dash JBrowse LinearGenomeView component
- `browser.ipynb` - jupyter notebook using the JupyterDash library to embed a
Dash JBrowse LinearGenomeView component in a cell
- `browser.ipynb` - jupyter notebook using the Dash library to embed a Dash
JBrowse LinearGenomeView component in a cell
- `examples/cgv_examples.py` - uses the Dash library to create a python
application with the Dash JBrowse CircularGenomeView component
- `examples/cgv_examples.ipynb` - jupyter notebook using the JupyterDash library
to embed a Dash JBrowse CircularGenomeView component in a cell
- `examples/cgv_examples.ipynb` - jupyter notebook using the Dash library to
embed a Dash JBrowse CircularGenomeView component in a cell
- `local_support.ipynb` - jupyter notebook with tutorial on using your local
data and passing it to JBrowse views

Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
dash==2.3.0
dash-jbrowse>=1.0.2
jupyter_dash>=0.4.2
Werkzeug==2.0.3
pandas>=1.1.5
pytest>=6.2.5
Expand Down
8 changes: 4 additions & 4 deletions docs/source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ You can find examples in the root of the directory.

`browser.py` uses the Dash library to create a python application with the Dash
JBrowse LinearGenomeView component and configured with the help of this package.
`browser.ipynb` is jupyter notebook using the JupyterDash library to embed a
Dash JBrowse LinearGenomeView component in a cell. `cgv_examples.py` a Dash
`browser.ipynb` is jupyter notebook using the Dash library to embed a Dash
JBrowse LinearGenomeView component in a cell. `cgv_examples.py` a Dash
application using the Dash JBrowse CircularGenomeView component
`cgv_examples.ipynb` is jupyter notebook using the JupyterDash library to embed
a Dash JBrowse CircularGenomeView component in a cell.
`cgv_examples.ipynb` is jupyter notebook using the Dash library to embed a Dash
JBrowse CircularGenomeView component in a cell.

To run the Python Dash application

Expand Down
6 changes: 2 additions & 4 deletions examples/dash_callbacks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
"metadata": {},
"outputs": [],
"source": [
"from dash import html, Dash\n",
"from dash import dcc, html, Dash\n",
"from dash.dependencies import Input, Output\n",
"from dash import dcc\n",
"from jupyter_dash import JupyterDash\n",
"from jbrowse_jupyter import create, create_component"
]
},
Expand All @@ -27,7 +25,7 @@
"outputs": [],
"source": [
"# Create a Jupyter dash app\n",
"app = JupyterDash(__name__)\n",
"app = Dash(__name__)\n",
"server = app.server\n",
"\n",
"# Docs: https://github.com/plotly/jupyter-dash"
Expand Down
12 changes: 5 additions & 7 deletions jbrowse_jupyter/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import json
import pkg_resources
import dash_jbrowse as jb
from dash import html
from dash import html, Dash
from urllib.parse import urlparse
from jupyter_dash import JupyterDash


def is_url(filePath):
"""
Expand Down Expand Up @@ -128,7 +126,7 @@ def create_component(conf, **kwargs):
def launch(conf, **kwargs):
"""
Launches a LinearGenomeView Dash JBrowse component in a
server with the help of JupyterDash.
server.
e.g
launch(conf, dash_comp="CGV",height=400, port=8002)
Expand All @@ -141,11 +139,11 @@ def launch(conf, **kwargs):
launch. Currently supporting LGV and CGV.
defaults to `LGV` when no dash_comp= is specified
:param int port: (optional) port to utilize when running
the JupyterDash app
the Dash app
:param int height: (optional) the height to utilize for
the JupyterDash app
the Dash app
"""
app = JupyterDash(__name__)
app = Dash(__name__)
# could add other JBrowse view types e.g Circular, Dotplot
supported = set({"LGV", "CGV"})
dash_comp = kwargs.get("dash_comp", "LGV")
Expand Down
6 changes: 3 additions & 3 deletions local_support.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"outputs": [],
"source": [
"from jbrowse_jupyter import launch, create, serve\n",
"from jupyter_dash import JupyterDash\n",
"from dash import jupyter_dash\n",
"import requests"
]
},
Expand Down Expand Up @@ -210,8 +210,8 @@
"source": [
"# Uncomment and run the next line if you are running this in jupyterlab/jupyternotebook\n",
"\n",
"import jupyter_server_proxy\n",
"JupyterDash.infer_jupyter_proxy_config() "
"from dash import jupyter_dash\n",
"jupyter_dash.infer_jupyter_proxy_config() "
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dash>=2.11.1
dash-jbrowse>=1.2.0
jupyter_dash>=0.4.2
Werkzeug==2.0.3
pandas>=1.1.5
IPython>=8.18.1
Loading

0 comments on commit c93cdaa

Please sign in to comment.