Skip to content

Commit

Permalink
Bump version for 0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
abought committed Sep 13, 2018
1 parent 1e5cfff commit a5bd165
Show file tree
Hide file tree
Showing 12 changed files with 1,435 additions and 1,430 deletions.
18 changes: 9 additions & 9 deletions assets/js/app/LocusZoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @namespace
*/
var LocusZoom = {
version: "0.8.0"
version: "0.8.1"
};

/**
Expand Down Expand Up @@ -179,24 +179,24 @@ LocusZoom.prettyTicks = function(range, clip_range, target_tick_count){
target_tick_count = 5;
}
target_tick_count = parseInt(target_tick_count);

var min_n = target_tick_count / 3;
var shrink_sml = 0.75;
var high_u_bias = 1.5;
var u5_bias = 0.5 + 1.5 * high_u_bias;

var d = Math.abs(range[0] - range[1]);
var c = d / target_tick_count;
if ((Math.log(d) / Math.LN10) < -2){
c = (Math.max(Math.abs(d)) * shrink_sml) / min_n;
}

var base = Math.pow(10, Math.floor(Math.log(c)/Math.LN10));
var base_toFixed = 0;
if (base < 1 && base !== 0){
base_toFixed = Math.abs(Math.round(Math.log(base)/Math.LN10));
}

var unit = base;
if ( ((2 * base) - c) < (high_u_bias * (c - unit)) ){
unit = 2 * base;
Expand All @@ -207,7 +207,7 @@ LocusZoom.prettyTicks = function(range, clip_range, target_tick_count){
}
}
}

var ticks = [];
var i = parseFloat( (Math.floor(range[0]/unit)*unit).toFixed(base_toFixed) );
while (i < range[1]){
Expand All @@ -218,7 +218,7 @@ LocusZoom.prettyTicks = function(range, clip_range, target_tick_count){
}
}
ticks.push(i);

if (typeof clip_range == "undefined" || ["low", "high", "both", "neither"].indexOf(clip_range) === -1){
clip_range = "neither";
}
Expand All @@ -228,7 +228,7 @@ LocusZoom.prettyTicks = function(range, clip_range, target_tick_count){
if (clip_range === "high" || clip_range === "both"){
if (ticks[ticks.length-1] > range[1]){ ticks.pop(); }
}

return ticks;
};

Expand Down Expand Up @@ -279,7 +279,7 @@ LocusZoom.createCORSPromise = function (method, url, body, headers, timeout) {
}
// Send the request
xhr.send(body);
}
}
return response.promise;
};

Expand Down
2 changes: 1 addition & 1 deletion dist/ext/lz-dynamic-urls.min.js

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

2 changes: 1 addition & 1 deletion dist/ext/lz-dynamic-urls.min.js.map

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions dist/locuszoom.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
} // ESTemplate: module content goes here
// ESTemplate: module content goes here
;
var LocusZoom = { version: '0.8.0' };
var LocusZoom = { version: '0.8.1' };
/**
* Populate a single element with a LocusZoom plot.
* selector can be a string for a DOM Query or a d3 selector.
Expand Down Expand Up @@ -8071,10 +8071,10 @@
* Ensure the server response is in a canonical form, an array of one object per record. [ {field: oneval} ].
* If the server response contains columns, reformats the response from {column1: [], column2: []} to the above.
*
* Does not apply namespacing or transformations.
* Does not apply namespacing, transformations, or field extraction.
*
* May be overridden by data sources that inherently return more complex payloads, or that exist to annotate other
* sources.
* sources (eg, if the payload provides extra data rather than a series of records).
*
* @param {Object[]|Object} data The original parsed server response
* @protected
Expand Down Expand Up @@ -8328,9 +8328,24 @@
};
};
LocusZoom.Data.AssociationSource.prototype.getURL = function (state, chain, fields) {
var analysis = state.analysis || chain.header.analysis || this.params.analysis || 3;
var analysis = state.analysis || chain.header.analysis || this.params.analysis;
if (typeof analysis == 'undefined') {
throw 'Association source must specify an analysis ID to plot';
}
return this.url + 'results/?filter=analysis in ' + analysis + ' and chromosome in \'' + state.chr + '\'' + ' and position ge ' + state.start + ' and position le ' + state.end;
};
LocusZoom.Data.AssociationSource.prototype.normalizeResponse = function (data) {
// Some association sources do not sort their data in a predictable order, which makes it hard to reliably
// align with other sources (such as LD). For performance reasons, sorting is an opt-in argument.
// TODO: Consider more fine grained sorting control in the future
data = LocusZoom.Data.Source.prototype.normalizeResponse.call(this, data);
if (this.params && this.params.sort && data.length && data[0]['position']) {
data.sort(function (a, b) {
return a['position'] - b['position'];
});
}
return data;
};
/**
* Data Source for LD Data, as fetched from the LocusZoom API server (or compatible)
* This source is designed to connect its results to association data, and therefore depends on association data having
Expand All @@ -8352,7 +8367,7 @@
};
LocusZoom.Data.LDSource.prototype.findMergeFields = function (chain) {
// since LD may be shared across sources with different namespaces
// we use regex to find columns to join on rather than
// we use regex to find columns to join on rather than
// requiring exact matches
var exactMatch = function (arr) {
return function () {
Expand Down
2 changes: 1 addition & 1 deletion dist/locuszoom.app.js.map

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions dist/locuszoom.app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/locuszoom.app.min.js.map

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions dist/locuszoom.vendor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/locuszoom.vendor.min.js.map

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css"/>

<!-- Necessary includes for LocusZoom.js -->
<script src="dist/locuszoom.vendor.min.js" type="text/javascript"></script>
<script src="dist/locuszoom.app.min.js" type="text/javascript"></script>
<script type="application/javascript" src="dist/ext/lz-dynamic-urls.min.js"></script>

<link rel="stylesheet" href="dist/locuszoom.css" type="text/css"/>

<title>LocusZoom.js</title>

<style>
Expand Down Expand Up @@ -40,7 +40,7 @@

<h1 style="margin-top: 1em;"><strong>LocusZoom.js</strong></h1>
<h5 style="color: #777">A Javascript/d3 embeddable plugin for interactively visualizing and navigating statistical genetic data from customizable sources.</h5>

<hr>

<a name="try_it"></a>
Expand All @@ -62,67 +62,67 @@ <h4>Top Hits</h4>

<a name="get_it"></a>
<h3>Get LocusZoom.js</h3>
<h5><strong>Current stable release: <a href="https://github.com/statgen/locuszoom/releases/tag/v0.8.0">v0.8.0</a></strong></h5>

<h5><strong>Current stable release: <a href="https://github.com/statgen/locuszoom/releases/tag/v0.8.1">v0.8.1</a></strong></h5>
<p>To use LocusZoom.js in your application you will need <i>both</i> LocusZoom's compiled Javascript and CSS <i>and</i> two third-party Javascript libraries (available here in a single vendor bundle).</p>

<div class="row">
<div class="three columns">
<h6><strong>Javascript</strong></h6>
</div>
<div class="nine columns">
<tt><a href="https://statgen.github.io/locuszoom/versions/0.8.0/locuszoom.app.js">https://statgen.github.io/locuszoom/versions/0.8.0/locuszoom.app.js</a></tt>
<tt><a href="https://statgen.github.io/locuszoom/versions/0.8.1/locuszoom.app.js">https://statgen.github.io/locuszoom/versions/0.8.1/locuszoom.app.js</a></tt>
<br>
<small><i>minified:</i> <tt><a href="https://statgen.github.io/locuszoom/versions/0.8.0/locuszoom.app.min.js">locuszoom.app.min.js</a></tt></small>
<small><i>minified:</i> <tt><a href="https://statgen.github.io/locuszoom/versions/0.8.1/locuszoom.app.min.js">locuszoom.app.min.js</a></tt></small>
</div>
</div>

<br>

<div class="row">
<div class="three columns">
<h6><strong>CSS</strong></h6>
</div>
<div class="nine columns">
<tt><a href="https://statgen.github.io/locuszoom/versions/0.8.0/locuszoom.css">https://statgen.github.io/locuszoom/versions/0.8.0/locuszoom.css</a></tt>
<tt><a href="https://statgen.github.io/locuszoom/versions/0.8.1/locuszoom.css">https://statgen.github.io/locuszoom/versions/0.8.1/locuszoom.css</a></tt>
<br>
<small><i>All CSS classes are namespaced to avoid collisions</i></small>
</div>
</div>

<br>

<div class="row">
<div class="three columns">
<h6><strong>Dependencies</strong></h6>
</div>
<div class="nine columns">
<tt><a href="https://statgen.github.io/locuszoom/versions/0.8.0/locuszoom.vendor.min.js">https://statgen.github.io/locuszoom/versions/0.8.0/locuszoom.vendor.min.js</a></tt>
<tt><a href="https://statgen.github.io/locuszoom/versions/0.8.1/locuszoom.vendor.min.js">https://statgen.github.io/locuszoom/versions/0.8.1/locuszoom.vendor.min.js</a></tt>
<br>
<small><i>Contains <a href="https://github.com/d3/d3">d3</a> v3.5.6 and <a href="https://github.com/kriskowal/Q">Q</a> (any version)</i></small>
</div>
</div>

<br>

<p>To download or link to past builds of LocusZoom.js use the URL structure above and the version number of your choice. A complete list of past releases can be seen <a href="https://github.com/statgen/locuszoom/releases">here</a>.</p>

<h5>Download Full Source (Latest Version)</h5>
<div>
<a class="button lz-dashboard-button-yellow" href="https://github.com/statgen/locuszoom/zipball/master">Download .zip</a>
<a class="button lz-dashboard-button-yellow" href="https://github.com/statgen/locuszoom/tarball/master">Download .tar.gz</a>
<a class="button lz-dashboard-button-green" href="https://github.com/statgen/locuszoom" id="view-on-github">View on GitHub</a>
</div>
</div>

<hr>

<a name="docs_and_support"></a>
<h3>Documentation and Support</h3>

<a class="button lz-dashboard-button-blue" href="https://github.com/statgen/locuszoom/wiki">Complete LocusZoom.js API Documentation</a>
<br>
<a class="button lz-dashboard-button-purple" href="https://groups.google.com/forum/#!forum/locuszoom">LocusZoom Message Board</a>

<hr>

<a name="examples"></a>
Expand Down Expand Up @@ -196,7 +196,7 @@ <h6><strong>Aggregation Tests</strong></h6>
// Determine if we're online, based on browser state or presence of an optional query parameter
var online = !(typeof navigator != "undefined" && !navigator.onLine);
if (window.location.search.indexOf("offline") != -1){ online = false; }

// Define LocusZoom Data Sources object differently depending on online status
var apiBase, data_sources;
if (online){
Expand Down Expand Up @@ -285,6 +285,6 @@ <h6><strong>Aggregation Tests</strong></h6>
});

</script>

</body>
</html>
Loading

0 comments on commit a5bd165

Please sign in to comment.