Skip to content

Commit

Permalink
Merge pull request #38 from GMOD/update_dash
Browse files Browse the repository at this point in the history
Upgrade dash and dash-browse dependencies
  • Loading branch information
teresam856 authored Apr 8, 2022
2 parents b23dd28 + b690e5c commit 4899962
Show file tree
Hide file tree
Showing 25 changed files with 89 additions and 74 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ $ python -m pytest tests/
```
We use flake8 for linting. You can run
```
$ pip install flake8
$ flake8 --count
```
from the root of this repo to see any lint errors
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ $ pip install jbrowse-jupyter
![Launching hg19 CGV in python notebook](https://github.com/GMOD/jbrowse-jupyter/raw/main/images/notebook2.png)
*JBrowse Linear Genome view in python Dash application*
```python
import dash
import dash_html_components as html
from dash import html, Dash
from jbrowse_jupyter import create, create_component

app = dash.Dash(__name__)
app = Dash(__name__)

jbrowse_conf = create("LGV", genome="hg38")

Expand Down
Binary file modified docs/docs/doctrees/contact.doctree
Binary file not shown.
Binary file modified docs/docs/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/docs/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/docs/doctrees/installation.doctree
Binary file not shown.
Binary file modified docs/docs/doctrees/jbrowse_jupyter.doctree
Binary file not shown.
Binary file modified docs/docs/doctrees/modules.doctree
Binary file not shown.
Binary file modified docs/docs/doctrees/quickstart.doctree
Binary file not shown.
Binary file modified docs/docs/doctrees/tutorial.doctree
Binary file not shown.
Binary file modified docs/docs/doctrees/util.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/docs/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 43a7918517821381983e049c73d75535
config: 0925fe609f33614d2923588cc7a96bc2
tags: 645f666f9bcd5a90fca523b33c5a78b7
5 changes: 2 additions & 3 deletions docs/docs/html/_sources/quickstart.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ Using the package, we can create a Dash JBrowse LinearGenomeView to embed in a
3. Use `create_component` to create a Dash JBrowse Linear Genome View component. The example below uses dash and dash_html_components to create a python application.

```python
import dash
import dash_html_components as html
from dash import html, Dash
from jbrowse_jupyter import create, create_component

app = dash.Dash(__name__)
app = Dash(__name__)

jbrowse_conf = create("LGV", genome="hg38")

Expand Down
72 changes: 52 additions & 20 deletions docs/docs/html/_static/doctools.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ var Documentation = {
this.fixFirefoxAnchorBug();
this.highlightSearchWords();
this.initIndexTable();
if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) {
this.initOnKeyListeners();
}
this.initOnKeyListeners();
},

/**
Expand Down Expand Up @@ -269,6 +267,13 @@ var Documentation = {
window.history.replaceState({}, '', url);
},

/**
* helper function to focus on search bar
*/
focusSearchBar : function() {
$('input[name=q]').first().focus();
},

/**
* make the url absolute
*/
Expand All @@ -291,27 +296,54 @@ var Documentation = {
},

initOnKeyListeners: function() {
// only install a listener if it is really needed
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS &&
!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS)
return;

$(document).keydown(function(event) {
var activeElementType = document.activeElement.tagName;
// don't navigate when in search box, textarea, dropdown or button
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
&& activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey
&& !event.shiftKey) {
switch (event.keyCode) {
case 37: // left
var prevHref = $('link[rel="prev"]').prop('href');
if (prevHref) {
window.location.href = prevHref;
return false;
}
break;
case 39: // right
var nextHref = $('link[rel="next"]').prop('href');
if (nextHref) {
window.location.href = nextHref;
return false;
}
break;
&& activeElementType !== 'BUTTON') {
if (event.altKey || event.ctrlKey || event.metaKey)
return;

if (!event.shiftKey) {
switch (event.key) {
case 'ArrowLeft':
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS)
break;
var prevHref = $('link[rel="prev"]').prop('href');
if (prevHref) {
window.location.href = prevHref;
return false;
}
break;
case 'ArrowRight':
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS)
break;
var nextHref = $('link[rel="next"]').prop('href');
if (nextHref) {
window.location.href = nextHref;
return false;
}
break;
case 'Escape':
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS)
break;
Documentation.hideSearchWords();
return false;
}
}

// some keyboard layouts may need Shift to get /
switch (event.key) {
case '/':
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS)
break;
Documentation.focusSearchBar();
return false;
}
}
});
Expand Down
6 changes: 4 additions & 2 deletions docs/docs/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.2.1',
VERSION: '1.2.2',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
FILE_SUFFIX: '.html',
LINK_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false
NAVIGATION_WITH_KEYS: false,
SHOW_SEARCH_SUMMARY: true,
ENABLE_SEARCH_SHORTCUTS: true,
};
8 changes: 2 additions & 6 deletions docs/docs/html/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ var Search = {
}
// stem the word
var word = stemmer.stemWord(tmp[i].toLowerCase());
// prevent stemmer from cutting word smaller than two chars
if(word.length < 3 && tmp[i].length >= 3) {
word = tmp[i];
}
var toAppend;
// select the correct list
if (word[0] == '-') {
Expand Down Expand Up @@ -276,7 +272,7 @@ var Search = {
setTimeout(function() {
displayNextItem();
}, 5);
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
} else if (DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY) {
$.ajax({url: requestUrl,
dataType: "text",
complete: function(jqxhr, textstatus) {
Expand All @@ -293,7 +289,7 @@ var Search = {
}, 5);
}});
} else {
// no source available, just display title
// just display title
Search.output.append(listItem);
setTimeout(function() {
displayNextItem();
Expand Down
5 changes: 2 additions & 3 deletions docs/docs/html/quickstart.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ <h2>Python Dash Application<a class="headerlink" href="#python-dash-application"
</li>
<li><p>Use <code class="docutils literal notranslate"><span class="pre">create_component</span></code> to create a Dash JBrowse Linear Genome View component. The example below uses dash and dash_html_components to create a python application.</p></li>
</ol>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">dash</span>
<span class="kn">import</span> <span class="nn">dash_html_components</span> <span class="k">as</span> <span class="nn">html</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">dash</span> <span class="kn">import</span> <span class="n">html</span><span class="p">,</span> <span class="n">Dash</span>
<span class="kn">from</span> <span class="nn">jbrowse_jupyter</span> <span class="kn">import</span> <span class="n">create</span><span class="p">,</span> <span class="n">create_component</span>

<span class="n">app</span> <span class="o">=</span> <span class="n">dash</span><span class="o">.</span><span class="n">Dash</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
<span class="n">app</span> <span class="o">=</span> <span class="n">Dash</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>

<span class="n">jbrowse_conf</span> <span class="o">=</span> <span class="n">create</span><span class="p">(</span><span class="s2">&quot;LGV&quot;</span><span class="p">,</span> <span class="n">genome</span><span class="o">=</span><span class="s2">&quot;hg38&quot;</span><span class="p">)</span>

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/html/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 6 additions & 13 deletions docs/docs/html/util.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,12 @@ <h1>Creating components<a class="headerlink" href="#creating-components" title="
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">create</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">view_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'LGV'</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Creates a JBrowseConfig given a view type.</p>
<p>e.g
create() -</p>
<blockquote>
<div><p>creates empty LGV JBrowseConfig</p>
</div></blockquote>
<dl class="simple">
<dt>create(“CGV”) -</dt><dd><p>creates empty CGV JBrowseConfig</p>
</dd>
<dt>create(“LGV”, genome=”hg19”) -</dt><dd><p>creates LGV JBrowseConfig with hg19 default config</p>
</dd>
<dt>create(“CGV”, conf={“my”: “conf”}) -</dt><dd><p>creates CGV JBrowseConfig given a conf obj</p>
</dd>
</dl>
<ul class="simple">
<li><p>create(): creates empty LGV JBrowseConfig</p></li>
<li><p>create(“CGV”):creates empty CGV JBrowseConfig</p></li>
<li><p>create(“LGV”, genome=”hg19”):creates LGV JBrowseConfig w/ default genome</p></li>
<li><p>create(“CGV”, conf={“k”: “v”}):creates CGV JBrowseConfig w/ a conf obj</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
Expand Down
8 changes: 4 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dash>=2.0
dash-jbrowse>=0.0.2
flake8>=4.0.1
jupyter_dash>=0.4.0
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
Sphinx>=4.3.1
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = 'Teresa De Jesus Martinez, JBrowse Team'

# The full version, including alpha/beta/rc tags
release = '1.2.1'
release = '1.2.2'


# -- General configuration ---------------------------------------------------
Expand Down
Loading

0 comments on commit 4899962

Please sign in to comment.