Merge branch 'dev' into visualization_header

This commit is contained in:
guerler
2018-03-22 08:41:09 -04:00
112 changed files with 3356 additions and 1451 deletions
@@ -0,0 +1,11 @@
{
"presets": ["env"],
"plugins": [
[
"auto-import",
{
"declarations": [{ "default": "$", "path": "jquery" }, { "default": "jQuery", "path": "jquery" }]
}
]
]
}
@@ -4,7 +4,6 @@
"description": "Scatterplot visualization plugin for the Galaxy informatics framework",
"main": " ",
"scripts": {
"test": "test",
"build": "parcel build src/scatterplot.js -d static/"
},
"keywords": [
@@ -13,14 +12,16 @@
"d3"
],
"author": "Carl Eberhard",
"license": "BSD",
"license": "0BSD",
"dependencies": {
"babel-plugin-auto-import": "^0.7.1",
"babel-preset-env": "^1.6.1",
"backbone": "^1.3.3",
"bootstrap": "^3.3.7",
"d3": "^3.5.17",
"jquery": "^3.2.1",
"jquery-ui-bundle": "^1.12.1",
"parcel-bundler": "^1.4.1",
"npm": "^5.7.1"
"jquery-ui-bundle": "^1.12.1-migrate",
"parcel-bundler": "^1.6.2",
"underscore": "^1.8.3"
}
}
@@ -0,0 +1,2 @@
import $ from "jquery";
window.jQuery = window.$ = window.jquery = $;
@@ -1,9 +1,14 @@
import * as bootstrap from "bootstrap";
import "./jqglobals";
// This is a really annoying hack to get bootstrap/jqui jquery bindings available correctly.
/* global $ */
import * as Backbone from "backbone";
import * as d3 from "d3";
import "jquery-ui-bundle";
import * as _ from "underscore";
import "../../../../../client/galaxy/scripts/ui/peek-column-selector";
import "../../../../../client/galaxy/scripts/ui/pagination";
import "jquery-ui-bundle";
import "bootstrap";
//TODO: Finish unlinking this from the Galaxy codebase (package it, use that way?)
var Visualization = Backbone.Model.extend({
@@ -244,7 +249,7 @@ export function scatterplot(renderTo, config, data) {
//console.log( 'grid.h.lines:', grid.h.lines );
return grid;
}
var grid = renderGrid();
renderGrid();
//// .................................................................... datapoints
var datapoints = content
@@ -305,7 +310,7 @@ export function scatterplot(renderTo, config, data) {
$(".chart-info-box").remove();
axis.redraw();
_redrawDatapointsClipped();
grid = renderGrid();
renderGrid();
$(svg.node()).trigger("zoom.scatterplot", {
scale: zoom.scale(),
@@ -627,7 +632,7 @@ var ScatterplotConfigEditor = Backbone.View.extend({
.save()
.fail(function(xhr, status, message) {
console.error(xhr, status, message);
editor.trigger("save:error", view);
editor.trigger("save:error", this);
alert("Error loading data:\n" + xhr.responseText);
})
.then(function() {
@@ -805,7 +810,8 @@ ScatterplotConfigEditor.templates = {
*/
var ScatterplotDisplay = Backbone.View.extend({
initialize: function(attributes) {
(this.data = null), (this.dataset = attributes.dataset);
this.data = null;
this.dataset = attributes.dataset;
this.lineCount = this.dataset.metadata_data_lines || null;
},
@@ -815,8 +821,8 @@ var ScatterplotDisplay = Backbone.View.extend({
var view = this,
config = this.model.get("config"),
//TODO: very tied to datasets - should be generalized eventually
baseUrl = window.parent && parent.galaxy_config ? parent.galaxy_config.root : "/",
xhr = jQuery.getJSON(baseUrl + "api/datasets/" + this.dataset.id, {
baseUrl = window.parent && window.parent.galaxy_config ? window.parent.galaxy_config.root : "/",
xhr = $.getJSON(baseUrl + "api/datasets/" + this.dataset.id, {
data_type: "raw_data",
provider: "dataset-column",
limit: config.pagination.perPage,
@@ -978,9 +984,9 @@ var ScatterplotDisplay = Backbone.View.extend({
if (!this.data) {
return;
}
var view = this,
config = this.model.get("config"),
meanWorker = new Worker("worker-stats.js");
var view = this;
var config = this.model.get("config");
var meanWorker = new window.Worker("worker-stats.js");
meanWorker.postMessage({
data: this.data,
keys: [config.xColumn, config.yColumn]
File diff suppressed because one or more lines are too long
@@ -26,9 +26,6 @@ ${h.stylesheet_link( root + 'plugins/visualizations/scatterplot/static/scatterpl
<script type="text/javascript">
window.Galaxy = { root: '${ root }' };
</script>
${h.js( 'libs/jquery/jquery',
'libs/underscore',
'libs/d3')}
${h.javascript_link( root + 'plugins/visualizations/scatterplot/static/scatterplot.js' )}
<script type="text/javascript">
@@ -42,7 +39,6 @@ ${h.javascript_link( root + 'plugins/visualizations/scatterplot/static/scatterpl
function getHDAJSON(){
return ${h.dumps( trans.security.encode_dict_ids( hda.to_dict() ), indent=2 )};
}
window.jQuery = window.jquery = window.$;
</script>
</head>