');
+ for (let i = 0; i < pool.length; i++) {
(function (i) {
body.append(
$(
@@ -686,9 +671,9 @@ define(['kbwidget', 'bootstrap', 'jquery', 'kbasePrompt'], (
// //// Restore pipeline
if (self.state.pipe_pool) {
- var pool = self.state.pipe_pool;
- var body = $('
');
- for (i = 0; i < pool.length; i++) {
+ const pool = self.state.pipe_pool;
+ const body = $('
');
+ for (let i = 0; i < pool.length; i++) {
(function (i) {
console.log(pool[i]);
body.append(
@@ -736,13 +721,13 @@ define(['kbwidget', 'bootstrap', 'jquery', 'kbasePrompt'], (
import_btn_sel.append(contig_import_auto);
import_btn_sel.append('
');
- for (i = 0; i < assemblies.length; i++) {
+ for (let i = 0; i < assemblies.length; i++) {
(function (i) {
const contig_import = $('
' + assemblies[i].name + '');
contig_import.on('click', () => {
- shock_url = assemblies[i].file_infos[0].shock_url;
- shock_id = assemblies[i].file_infos[0].shock_id;
- ws_contig_name = job_id + '_' + assemblies[i].name;
+ const shock_url = assemblies[i].file_infos[0].shock_url,
+ shock_id = assemblies[i].file_infos[0].shock_id,
+ ws_contig_name = job_id + '_' + assemblies[i].name;
self.import_contigs_to_ws(
token,
self.fba_url,
diff --git a/kbase-extension/static/kbase/js/widgets/function_output/kbaseBlastOutput.js b/kbase-extension/static/kbase/js/widgets/function_output/kbaseBlastOutput.js
index 8eabf69e99..305ecbfd4a 100644
--- a/kbase-extension/static/kbase/js/widgets/function_output/kbaseBlastOutput.js
+++ b/kbase-extension/static/kbase/js/widgets/function_output/kbaseBlastOutput.js
@@ -6,17 +6,7 @@ define([
'd3',
'kbaseAuthenticatedWidget',
'kbaseTabs',
- 'jquery-dataTables',
-], (
- KBWidget,
- bootstrap,
- $,
- StringUtil,
- d3,
- kbaseAuthenticatedWidget,
- kbaseTabs,
- jquery_dataTables
-) => {
+], (KBWidget, bootstrap, $, StringUtil, d3, kbaseAuthenticatedWidget, kbaseTabs) => {
return KBWidget({
name: 'kbaseBlastOutput',
parent: kbaseAuthenticatedWidget,
@@ -271,12 +261,6 @@ define([
width = 540 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
- const padding = margin.left + margin.right;
-
- const scaley = margin.top + 20;
- const rect1 = margin.top + 10;
- const fullscalelength = 10 - (Number(querylength) % 10) + Number(querylength);
-
const x = d3.scale
.linear()
.domain([0, querylength])
@@ -368,12 +352,10 @@ define([
const hseq = hsp['Hsp_hseq'];
const identity = hsp['Hsp_identity'];
const midline = hsp['Hsp_midline'];
- const num = hsp['Hsp_num'];
const positive = hsp['Hsp_positive'];
const qseq = hsp['Hsp_qseq'];
const query_frame = hsp['Hsp_query-frame'];
const query_from = hsp['Hsp_query-from'];
- const query_to = hsp['Hsp_query-to'];
const score = hsp['Hsp_score'];
if (gaps == null) {
@@ -438,8 +420,8 @@ define([
let i = 0;
while (i < hseq.length) {
- start = i;
- end = i + 60;
+ const start = i;
+ const end = i + 60;
const p1 = hseq.substring(start, end);
const p2 = midline.substring(start, end);
const p3 = qseq.substring(start, end);
@@ -496,13 +478,13 @@ define([
return this;
},
- loggedInCallback: function (event, auth) {
+ loggedInCallback: function (_event, auth) {
this.token = auth.token;
this.render();
return this;
},
- loggedOutCallback: function (event, auth) {
+ loggedOutCallback: function () {
this.token = null;
this.render();
return this;
diff --git a/kbase-extension/static/kbase/js/widgets/function_output/kbaseChromatographyMatrix.js b/kbase-extension/static/kbase/js/widgets/function_output/kbaseChromatographyMatrix.js
index 1edeff7bc2..c70a3e916e 100644
--- a/kbase-extension/static/kbase/js/widgets/function_output/kbaseChromatographyMatrix.js
+++ b/kbase-extension/static/kbase/js/widgets/function_output/kbaseChromatographyMatrix.js
@@ -1,11 +1,10 @@
-define([
- 'kbwidget',
- 'bootstrap',
- 'jquery',
- 'kbaseMatrix2DAbstract',
- 'kbaseTabs',
- 'jquery-dataTables',
-], (KBWidget, bootstrap, $, kbaseMatrix2DAbstract, kbaseTabs, jquery_dataTables) => {
+define(['kbwidget', 'jquery', 'kbaseMatrix2DAbstract', 'kbaseTabs'], (
+ KBWidget,
+ $,
+ kbaseMatrix2DAbstract,
+ kbaseTabs
+) => {
+ 'use strict';
return KBWidget({
name: 'kbaseChromatographyMatrix',
parent: kbaseMatrix2DAbstract,
@@ -22,7 +21,6 @@ define([
this.matrix.metadata.row_metadata,
'TimeSeries'
);
- // var substancesSummary = this.getSubstancesSummary(substances);
this.loading(false);
const $container = $('
');
@@ -160,7 +158,7 @@ define([
}
}
- substance = {
+ const substance = {
substanceId: columnId,
label: substanceName,
maxValue: maxValue,
diff --git a/kbase-extension/static/kbase/js/widgets/function_output/kbaseDomainAnnotation.js b/kbase-extension/static/kbase/js/widgets/function_output/kbaseDomainAnnotation.js
index 3283511fc2..02c3515442 100644
--- a/kbase-extension/static/kbase/js/widgets/function_output/kbaseDomainAnnotation.js
+++ b/kbase-extension/static/kbase/js/widgets/function_output/kbaseDomainAnnotation.js
@@ -11,8 +11,7 @@ define([
'narrativeConfig',
'kbaseAuthenticatedWidget',
'kbaseTabs',
- 'jquery-dataTables',
-], (KBWidget, bootstrap, $, Config, kbaseAuthenticatedWidget, kbaseTabs, jquery_dataTables) => {
+], (KBWidget, bootstrap, $, Config, kbaseAuthenticatedWidget, kbaseTabs) => {
return KBWidget({
name: 'kbaseDomainAnnotation',
parent: kbaseAuthenticatedWidget,
@@ -52,7 +51,7 @@ define([
return this;
},
- loggedInCallback: function (event, auth) {
+ loggedInCallback: function (_event, auth) {
// error if not properly initialized
if (this.options.domainAnnotationID == null) {
this.showMessage("[Error] Couldn't retrieve domain annotation data.");
@@ -68,7 +67,7 @@ define([
return this;
},
- loggedOutCallback: function (event, auth) {
+ loggedOutCallback: function () {
this.ws = null;
this.isLoggedIn = false;
return this;
@@ -233,13 +232,13 @@ define([
const domainsTableData = [];
const domains = self.domains;
- for (var domainID in domains) {
+ for (const domainID in domains) {
const domain = domains[domainID];
// try to map each domain to a prefix,
// for external crossrefs and to show only
// the most relevant match per set
- var domainRef = domainID;
+ let domainRef = domainID;
$.each(self.prefixToURL, (prefix, url) => {
if (domainID.match('^' + prefix)) {
self.accessionToPrefix[domainID] = prefix;
@@ -255,7 +254,7 @@ define([
// Build concatenated list of gene references
let geneRefs = '';
for (let i = 0; i < domain.genes.length; i++) {
- gene = domain.genes[i];
+ const gene = domain.genes[i];
if (i > 0) {
geneRefs += '
';
}
@@ -355,19 +354,19 @@ define([
let geneLength = (geneEnd - geneStart + 1) / 3;
// hack to correct display bug in genes with incorrect stated lengths
- for (var domainID in domainsInfo) {
- var domainsArray = domainsInfo[domainID];
- for (var i = 0; i < domainsArray.length; i++) {
- var domainEnd = domainsArray[i][1];
+ for (const domainID in domainsInfo) {
+ const domainsArray = domainsInfo[domainID];
+ for (let i = 0; i < domainsArray.length; i++) {
+ const domainEnd = domainsArray[i][1];
if (domainEnd > geneLength) geneLength = domainEnd;
}
}
- for (var domainID in domainsInfo) {
- var domainsArray = domainsInfo[domainID];
- for (var i = 0; i < domainsArray.length; i++) {
+ for (const domainID in domainsInfo) {
+ const domainsArray = domainsInfo[domainID];
+ for (let i = 0; i < domainsArray.length; i++) {
const domainStart = domainsArray[i][0];
- var domainEnd = domainsArray[i][1];
+ const domainEnd = domainsArray[i][1];
const eValue = domainsArray[i][2];
const domainImgWidth =
@@ -470,8 +469,6 @@ define([
const genesArray = dad.data[contigID];
for (let i = 0; i < genesArray.length; i++) {
const geneID = genesArray[i][0];
- // var geneStart = genesArray[i][1];
- // var geneEnd = genesArray[i][2];
const domainsInfo = genesArray[i][4];
if ($.isEmptyObject(domainsInfo)) continue;
diff --git a/kbase-extension/static/kbase/js/widgets/function_output/kbaseFbaModelComparison.js b/kbase-extension/static/kbase/js/widgets/function_output/kbaseFbaModelComparison.js
index beba3bccb8..44efb5769e 100644
--- a/kbase-extension/static/kbase/js/widgets/function_output/kbaseFbaModelComparison.js
+++ b/kbase-extension/static/kbase/js/widgets/function_output/kbaseFbaModelComparison.js
@@ -1,11 +1,9 @@
-define([
- 'kbwidget',
- 'bootstrap',
- 'jquery',
- 'kbaseAuthenticatedWidget',
- 'kbaseTabs',
- 'jquery-dataTables',
-], (KBWidget, bootstrap, $, kbaseAuthenticatedWidget, kbaseTabs, jquery_dataTables) => {
+define(['kbwidget', 'jquery', 'kbaseAuthenticatedWidget', 'kbaseTabs'], (
+ KBWidget,
+ $,
+ kbaseAuthenticatedWidget,
+ kbaseTabs
+) => {
return KBWidget({
name: 'FbaModelComparisonWidget',
parent: kbaseAuthenticatedWidget,
@@ -61,7 +59,6 @@ define([
'"> Loading models and comparison data...
'
);
- const pref = this.uuid();
const kbws = new Workspace(this.wsUrl, { token: self.authToken() });
const get_object_input = [
{ ref: self.ws_name + '/' + self.fba_model1_id },
@@ -81,9 +78,9 @@ define([
self.genome2_ref = self.fba_model2.genome_ref;
if (data[2]) {
let ftrs = data[2].data.proteome1names;
- for (var i = 0; i < ftrs.length; i++) {
- var hits = data[2].data.data1[i];
- for (var j = 0; j < hits.length; j++) {
+ for (let i = 0; i < ftrs.length; i++) {
+ const hits = data[2].data.data1[i];
+ for (let j = 0; j < hits.length; j++) {
//if (hits[j][2] == 100) {
if (self.gene_translation[ftrs[i]] === undefined) {
self.gene_translation[ftrs[i]] = [];
@@ -95,9 +92,9 @@ define([
}
}
ftrs = data[2].data.proteome2names;
- for (var i = 0; i < ftrs.length; i++) {
- var hits = data[2].data.data2[i];
- for (var j = 0; j < hits.length; j++) {
+ for (let i = 0; i < ftrs.length; i++) {
+ const hits = data[2].data.data2[i];
+ for (let j = 0; j < hits.length; j++) {
//if (hits[j][2] == 100) {
if (self.gene_translation[ftrs[i]] === undefined) {
self.gene_translation[ftrs[i]] = [];
@@ -135,35 +132,35 @@ define([
}
);
- var prepare_model = function (model) {
+ const prepare_model = function (model) {
model.cpdhash = {};
model.rxnhash = {};
model.cmphash = {};
- for (var i = 0; i < model.modelcompartments.length; i++) {
+ for (let i = 0; i < model.modelcompartments.length; i++) {
const cmp = model.modelcompartments[i];
model.cmphash[cmp.id] = cmp;
}
- for (var i = 0; i < model.modelcompounds.length; i++) {
+ for (let i = 0; i < model.modelcompounds.length; i++) {
const cpd = model.modelcompounds[i];
cpd.cmpkbid = cpd.modelcompartment_ref.split('/').pop();
cpd.cpdkbid = cpd.compound_ref.split('/').pop();
if (cpd.name === undefined) {
cpd.name = cpd.id;
}
- cpd.name = cpd.name.replace(/_[a-zA-z]\d+$/, '');
+ cpd.name = cpd.name.replace(/_[a-zA-Z]\d+$/, '');
model.cpdhash[cpd.id] = cpd;
if (cpd.cpdkbid != 'cpd00000') {
model.cpdhash[cpd.cpdkbid + '_' + cpd.cmpkbid] = cpd;
}
}
- for (var i = 0; i < model.modelreactions.length; i++) {
+ for (let i = 0; i < model.modelreactions.length; i++) {
const rxn = model.modelreactions[i];
rxn.rxnkbid = rxn.reaction_ref.split('/').pop();
rxn.cmpkbid = rxn.modelcompartment_ref.split('/').pop();
- rxn.dispid = rxn.id.replace(/_[a-zA-z]\d+$/, '') + '[' + rxn.cmpkbid + ']';
- rxn.name = rxn.name.replace(/_[a-zA-z]\d+$/, '');
+ rxn.dispid = rxn.id.replace(/_[a-zA-Z]\d+$/, '') + '[' + rxn.cmpkbid + ']';
+ rxn.name = rxn.name.replace(/_[a-zA-Z]\d+$/, '');
if (rxn.name == 'CustomReaction') {
- rxn.name = rxn.id.replace(/_[a-zA-z]\d+$/, '');
+ rxn.name = rxn.id.replace(/_[a-zA-Z]\d+$/, '');
}
model.rxnhash[rxn.id] = rxn;
if (rxn.rxnkbid != 'rxn00000') {
@@ -180,7 +177,7 @@ define([
} else if (rxn.direction == '<') {
sign = '<=';
}
- for (var j = 0; j < rxn.modelReactionReagents.length; j++) {
+ for (let j = 0; j < rxn.modelReactionReagents.length; j++) {
const rgt = rxn.modelReactionReagents[j];
rgt.cpdkbid = rgt.modelcompound_ref.split('/').pop();
if (rgt.coefficient < 0) {
@@ -188,7 +185,7 @@ define([
reactants += ' + ';
}
if (rgt.coefficient != -1) {
- var abscoef = Math.round(-1 * 100 * rgt.coefficient) / 100;
+ const abscoef = Math.round(-1 * 100 * rgt.coefficient) / 100;
reactants += '(' + abscoef + ') ';
}
reactants +=
@@ -201,7 +198,7 @@ define([
products += ' + ';
}
if (rgt.coefficient != 1) {
- var abscoef = Math.round(100 * rgt.coefficient) / 100;
+ const abscoef = Math.round(100 * rgt.coefficient) / 100;
products += '(' + abscoef + ') ';
}
products +=
@@ -212,7 +209,7 @@ define([
}
}
rxn.ftrhash = {};
- for (var j = 0; j < rxn.modelReactionProteins.length; j++) {
+ for (let j = 0; j < rxn.modelReactionProteins.length; j++) {
const prot = rxn.modelReactionProteins[j];
for (let k = 0; k < prot.modelReactionProteinSubunits.length; k++) {
const subunit = prot.modelReactionProteinSubunits[k];
@@ -233,28 +230,28 @@ define([
};
const compare_models = function () {
- model1 = self.fba_model1;
- model2 = self.fba_model2;
+ const model1 = self.fba_model1;
+ const model2 = self.fba_model2;
self.overlap_rxns = [];
self.exact_matches = 0;
model1.unique_rxn = [];
- for (var i = 0; i < model1.modelreactions.length; i++) {
- var rxn = model1.modelreactions[i];
+ for (let i = 0; i < model1.modelreactions.length; i++) {
+ const rxn = model1.modelreactions[i];
if (rxn.rxnkbid == 'rxn00000') {
if (model2.rxnhash[rxn.id] === undefined) {
model1.unique_rxn.push(rxn);
} else {
- var rxn2 = model2.rxnhash[rxn.id];
- var model1ftrs = '';
- var exact = 1;
- for (var gene in rxn.ftrhash) {
+ const rxn2 = model2.rxnhash[rxn.id];
+ let model1ftrs = '';
+ let exact = 1;
+ for (const gene in rxn.ftrhash) {
if (model1ftrs.length > 0) {
model1ftrs += '
';
}
if (self.gene_translation[gene]) {
- var transftrs = self.gene_translation[gene];
- var found = 0;
- for (var n = 0; n < transftrs.length; n++) {
+ const transftrs = self.gene_translation[gene];
+ let found = 0;
+ for (let n = 0; n < transftrs.length; n++) {
if (rxn2.ftrhash[transftrs[n]]) {
model1ftrs += gene;
found = 1;
@@ -272,15 +269,15 @@ define([
model1ftrs += gene;
}
}
- var model2ftrs = '';
- for (var gene in rxn2.ftrhash) {
+ let model2ftrs = '';
+ for (const gene in rxn2.ftrhash) {
if (model2ftrs.length > 0) {
model2ftrs += '
';
}
if (self.gene_translation[gene]) {
- var transftrs = self.gene_translation[gene];
- var found = 0;
- for (var n = 0; n < transftrs.length; n++) {
+ const transftrs = self.gene_translation[gene];
+ let found = 0;
+ for (let n = 0; n < transftrs.length; n++) {
if (rxn.ftrhash[transftrs[n]]) {
model2ftrs += gene;
found = 1;
@@ -313,17 +310,17 @@ define([
} else if (model2.rxnhash[rxn.rxnkbid + '_' + rxn.cmpkbid] === undefined) {
model1.unique_rxn.push(rxn);
} else {
- var rxn2 = model2.rxnhash[rxn.rxnkbid + '_' + rxn.cmpkbid];
- var model1ftrs = '';
- var exact = 1;
- for (var gene in rxn.ftrhash) {
+ const rxn2 = model2.rxnhash[rxn.rxnkbid + '_' + rxn.cmpkbid];
+ let model1ftrs = '';
+ let exact = 1;
+ for (const gene in rxn.ftrhash) {
if (model1ftrs.length > 0) {
model1ftrs += '
';
}
if (self.gene_translation[gene]) {
- var transftrs = self.gene_translation[gene];
- var found = 0;
- for (var n = 0; n < transftrs.length; n++) {
+ const transftrs = self.gene_translation[gene];
+ let found = 0;
+ for (let n = 0; n < transftrs.length; n++) {
if (rxn2.ftrhash[transftrs[n]]) {
model1ftrs += gene;
found = 1;
@@ -341,15 +338,15 @@ define([
model1ftrs += gene;
}
}
- var model2ftrs = '';
- for (var gene in rxn2.ftrhash) {
+ let model2ftrs = '';
+ for (const gene in rxn2.ftrhash) {
if (model2ftrs.length > 0) {
model2ftrs += '
';
}
if (self.gene_translation[gene]) {
- var transftrs = self.gene_translation[gene];
- var found = 0;
- for (var n = 0; n < transftrs.length; n++) {
+ const transftrs = self.gene_translation[gene];
+ let found = 0;
+ for (let n = 0; n < transftrs.length; n++) {
if (rxn.ftrhash[transftrs[n]]) {
model2ftrs += gene;
found = 1;
@@ -381,8 +378,8 @@ define([
}
}
model2.unique_rxn = [];
- for (var i = 0; i < model2.modelreactions.length; i++) {
- var rxn = model2.modelreactions[i];
+ for (let i = 0; i < model2.modelreactions.length; i++) {
+ const rxn = model2.modelreactions[i];
if (rxn.rxnkbid == 'rxn00000') {
if (model1.rxnhash[rxn.id] === undefined) {
model2.unique_rxn.push(rxn);
@@ -393,7 +390,7 @@ define([
}
};
- var dataIsReady = function () {
+ const dataIsReady = function () {
compare_models();
///////////////////////////////////// Instantiating Tabs ////////////////////////////////////////////
container.empty();
@@ -639,13 +636,13 @@ define([
return this;
},
- loggedInCallback: function (event, auth) {
+ loggedInCallback: function (_event, auth) {
this.token = auth.token;
this.render();
return this;
},
- loggedOutCallback: function (event, auth) {
+ loggedOutCallback: function () {
this.token = null;
this.render();
return this;
diff --git a/kbase-extension/static/kbase/js/widgets/function_output/kbaseGenomeAnnotationViewer.js b/kbase-extension/static/kbase/js/widgets/function_output/kbaseGenomeAnnotationViewer.js
index c2a87b8739..fcfc601cf5 100644
--- a/kbase-extension/static/kbase/js/widgets/function_output/kbaseGenomeAnnotationViewer.js
+++ b/kbase-extension/static/kbase/js/widgets/function_output/kbaseGenomeAnnotationViewer.js
@@ -6,28 +6,20 @@
define([
'kbwidget',
- 'bootstrap',
'jquery',
- 'bluebird',
'narrativeConfig',
'ContigBrowserPanel',
- 'util/string',
'kbaseAuthenticatedWidget',
'kbaseTabs',
- 'jquery-dataTables',
'GenomeAnnotationAPI-client-api',
'kbaseTable',
], (
KBWidget,
- bootstrap,
$,
- Promise,
Config,
ContigBrowserPanel,
- StringUtil,
kbaseAuthenticatedWidget,
kbaseTabs,
- jquery_dataTables,
gaa,
kbaseTable
) => {
@@ -99,12 +91,6 @@ define([
},
numberWithCommas: function (x) {
- //x = x.toString();
- //var pattern = /(-?\d+)(\d{3})/;
- //while (pattern.test(x))
- // x = x.replace(pattern, "$1,$2");
- //return x;
- // speedup over above code, which can help on very long lists
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
},
@@ -247,8 +233,6 @@ define([
},
settingsForType: function (type) {
- const $self = this;
-
if (type == 'contigs') {
const columns = [
{ title: 'Contig Id', data: 'name' },
@@ -256,10 +240,6 @@ define([
{ title: 'Genes', data: 'genecount' },
];
- //for (type of Object.keys(this.summary.annotation.feature_type_counts).sort(this.sortCaseInsensitively)) {
- // columns.push( { title: type + 's', data : type + 'count'} );
- //}
-
return {
pagingType: 'full_numbers',
displayLength: 10,
@@ -267,10 +247,7 @@ define([
columns: columns,
data: [],
language: {
- search: 'Search contig:',
emptyTable: 'No contigs found.',
- },
- language: {
lengthMenu: '_MENU_ Contigs per page',
zeroRecords: 'No Matching Contigs Found',
info: 'Showing _START_ to _END_ of _TOTAL_ Contigs',
@@ -278,21 +255,6 @@ define([
infoFiltered: '(filtered from _MAX_)',
search: 'Search Contigs',
},
- //"createdRow" : function (row, data, index) {
-
- /* creates a contig browser tab -- not working yet, so commented out */
- /*var $linkCell = $('td', row).eq(0);
- $linkCell.empty();
-
- $linkCell.append(
- $.jqElem('a')
- .on('click', function(e) {
- $self.showContig(data.name);
- })
- .append(data.name)
- );*/
-
- //},
};
} else {
return {
@@ -321,36 +283,6 @@ define([
infoFiltered: '(filtered from _MAX_)',
search: 'Search Features',
},
-
- // Gene view and simple contig browser not working, so comment out */
- /*"createdRow" : function (row, data, index) {
-
- if (data.type == 'gene') {
- var $featureCell = $('td', row).eq(0);
- $featureCell.empty();
-
- $featureCell.append(
- $.jqElem('a')
- .on('click', function(e) {
- $self.showGene(data.id);
- })
- .append(data.id)
- );
- }
-
- var $contigCell = $('td', row).eq(2);
- $contigCell.empty();
-
- $contigCell.append(
- $.jqElem('a')
- .on('click', function(e) {
- $self.showContig(data.contig);
- })
- .append(data.contig)
- );
-
- },*/
- //"fnDrawCallback": function() { geneEvents(); contigEvents(); }
};
}
},
@@ -364,10 +296,10 @@ define([
const $target = $.jqElem('div').append($self.loaderElem());
- var $selector = $.jqElem('select').on('change', () => {
+ const $selector = $.jqElem('select').on('change', () => {
$self.showContent($selector.val(), $target);
});
- for (type in Object.keys(this.summary.annotation.feature_type_counts).sort(
+ for (const type in Object.keys(this.summary.annotation.feature_type_counts).sort(
this.sortCaseInsensitively
)) {
$selector
@@ -417,14 +349,8 @@ define([
.then((features) => {
const contigMap = $self.contigMap;
- const cdsData = []; //XXX plants baloney. Extra tab for CDS data. See below on line 372 or so.
- const mrnaData = []; //XXX plants baloney. We throw away mrnaData. See below on line 372 or so.
-
$self.content['contigs'] = $self.setDataTableStyles($.jqElem('table'));
- const genomeType = 'genome'; //self.genomeType(gnm); XXX THIS NEEDS TO BE FIXED TO IDENTIFY TRANSCRIPTOMES AGAIN!
- const featurelist = {};
-
$.each(features, (feature_id, feature) => {
$self.content[feature.feature_type] = $self.setDataTableStyles(
$.jqElem('table')
@@ -454,14 +380,14 @@ define([
};
$.each(
$self.summary.annotation.feature_type_counts,
- (type, v) => {
- contigMap[contig.contig_id].features[type] = [];
+ (type_) => {
+ contigMap[contig.contig_id].features[type_] = [];
}
);
}
});
- contigName = feature.feature_locations[0].contig_id;
+ const contigName = feature.feature_locations[0].contig_id;
let dataArray = $self.genomeAnnotationData[feature.feature_type];
if (dataArray == undefined) {
@@ -470,7 +396,6 @@ define([
}
dataArray.push({
- // id: '
'+geneId+'',
id: feature_id,
contig: feature.feature_locations
.map((v) => {
@@ -484,7 +409,6 @@ define([
})
.join('
')
),
- //dir: location.strand,
dir: $self.numberWithCommas(
feature.feature_locations
.map((v) => {
@@ -492,7 +416,6 @@ define([
})
.join('
')
),
- //len: $self.numberWithCommas(location.length),
len: $self.numberWithCommas(
feature.feature_locations
.map((v) => {
@@ -505,13 +428,6 @@ define([
aliases: aliases.join(', '),
});
- /*$.each(
- feature.feature_locations,
- function (i, location) {
-
- }
- );*/
-
$self.geneMap[feature_id] = feature;
const contig = contigMap[contigName];
@@ -542,7 +458,7 @@ define([
length: $self.numberWithCommas(contig.length),
};
- for (f in contig.features) {
+ for (const f in contig.features) {
contigRow[f + 'count'] = $self.numberWithCommas(
contig.features[f].length
);
@@ -595,10 +511,8 @@ define([
const $tabObj = $self.data('tabObj');
- var $content = Date.now();
-
if (!$tabObj.hasTab(geneId)) {
- var $content = $.jqElem('div');
+ const $content = $.jqElem('div');
const gene = $self.geneMap[geneId];
console.log('SHOWS GENE', geneId, gene);
@@ -636,7 +550,7 @@ define([
geneId +
'',
$.jqElem('a')
- .on('click', (e) => {
+ .on('click', () => {
$self.showContig(contigName);
})
.append(contigName),
@@ -679,6 +593,7 @@ define([
}
}
+ // what the f??
if (f.protein_translation) {
elemTable.append(
'
| Protein Translation | ' +
@@ -705,10 +620,8 @@ define([
const $tabObj = $self.data('tabObj');
- var $content = Date.now();
-
if (!$tabObj.hasTab(contigId)) {
- var $content = $.jqElem('div');
+ const $content = $.jqElem('div');
const contig = $self.contigMap[contigName];
const elemTable = $(
' {
+], (KBWidget, $, kbaseAuthenticatedWidget, kbaseTabs, StringUtil, Config) => {
return KBWidget({
name: 'kbaseGenomeComparisonViewer',
parent: kbaseAuthenticatedWidget,
@@ -57,7 +46,6 @@ define([
const kbws = new Workspace(self.wsUrl, { token: self.authToken() });
- //var request = {auth: self.authToken(), workspace: self.ws_name, id: self.simulation_id, type: 'KBasePhenotypes.PhenotypeSimulationSet'};
kbws.get_objects(
[{ ref: self.ws + '/' + self.id }],
(data) => {
@@ -139,20 +127,20 @@ define([
tabGenomes.append(tableGenomes);
const headings = ['Genome', 'Legend'];
const numGenomes = genomes.length;
- for (var i = 0; i < numGenomes; i++) {
+ for (let i = 0; i < numGenomes; i++) {
headings.push('G' + (i + 1));
}
tableGenomes.append(
'| ' + headings.join(' | ') + ' | '
);
- for (var i = 0; i < numGenomes; i++) {
+ for (let i = 0; i < numGenomes; i++) {
const genome = genomes[i];
const row = [
'G' + (i + 1) + '-' + genome.name,
'# of families: # of functions:',
];
- for (var j in genomes) {
- var compgenome = genomes[j];
+ for (const j in genomes) {
+ const compgenome = genomes[j];
if (genome.genome_similarity[compgenome.genome_ref]) {
row.push(
genome.genome_similarity[compgenome.genome_ref][0] +
@@ -195,7 +183,7 @@ define([
);
tabFamilies.append(tableFamilies);
const fam_data = [];
- tableSettings = {
+ const tableSettings = {
sPaginationType: 'full_numbers',
iDisplayLength: 10,
aaData: fam_data,
@@ -219,8 +207,8 @@ define([
},
fnDrawCallback: events,
};
- for (var i in families) {
- var fam = families[i];
+ for (const i in families) {
+ const fam = families[i];
const famdata = {
id:
'');
const flux_threshold = 0.001;
const heat_colors = ['#731d1d', '#8a2424', '#b35050', '#d05060', '#f28e8e'];
- const neg_heat_colors = ['#4f4f04', '#7c7c07', '#8b8d08', '#acc474', '#dded00'];
- const gapfill_color = '#f000ff';
- const gene_stroke = '#777';
const g_present_color = '#8bc7e5';
const grid = 50;
const r_width = grid * (4 / 5);
@@ -49,23 +43,23 @@
$.when(graph_AJAX).done((core_data) => {
const core = join_model_to_core(core_data, models_data, kbids, fbas_data);
- const stage = core_model(core, true);
+ const stage = core_model(core);
});
}
// Fixme: This looks a little worse than it is, but can be refactored.
function join_model_to_core(core, models, kbids, fba_data) {
const org_names = [];
- for (var i in models) {
+ for (const i in models) {
org_names.push(models[i].name);
}
// Adding data structures to core data or each organism
- for (var i in core) {
- var obj = core[i];
+ for (const i in core) {
+ const obj = core[i];
obj['kbids'] = {};
- for (var j in kbids) {
- kbid = kbids[j];
+ for (const j in kbids) {
+ const kbid = kbids[j];
const kb_gid = get_genome_id(kbid);
obj.kbids[kb_gid] = [];
}
@@ -73,7 +67,7 @@
for (const n in models) {
const model = models[n];
- rxn_list = model.reactions;
+ const rxn_list = model.reactions;
let model_fba = [];
for (const k in fba_data) {
@@ -83,7 +77,7 @@
}
}
- for (var i in rxn_list) {
+ for (const i in rxn_list) {
const rxn_obj = rxn_list[i];
const rxn_id = rxn_obj.reaction;
const data = find_shape_by_rxn(core, rxn_id);
@@ -93,8 +87,8 @@
if (!data) continue;
// for each obj in the core graph json
- for (var j in data) {
- obj = data[j];
+ for (const j in data) {
+ const obj = data[j];
const dict = $.extend({}, rxn_obj);
@@ -138,56 +132,54 @@
}
}
- function core_model(data, show_flux) {
+ function core_model(data) {
const stage = Raphael('core-model', 1000, 1500);
// Draw shapes
- for (var i in data) {
- var obj = data[i];
-
+ for (const i in data) {
+ const obj = data[i];
+ let text;
const x = (obj.x - 2) * grid; //Fixme: update json
const y = (obj.y - 2) * grid;
if (obj.shape == 'rect') {
- const rect = stage.core_rect(obj, x, y, r_width, r_height, show_flux);
- //var text = stage.text(x+r_width/2+50, y+r_height/2, obj.rxns.join('\n'))
- //text.attr({'font-size':8})
+ // rect = stage.core_rect(obj, x, y, r_width, r_height, show_flux);
} else if (obj.shape == 'circ') {
- const circle = stage.circle(x + r_width / 2, y + r_height / 2, radius);
+ // circle = stage.circle(x + r_width / 2, y + r_height / 2, radius);
if (obj.textPos) {
if (obj.textPos == 'left') {
- var text = stage.text(x, y + r_height / 2, obj.text);
+ text = stage.text(x, y + r_height / 2, obj.text);
- var offset = (-1 * text.getBBox().width) / 2 + (radius + 3);
+ const offset = (-1 * text.getBBox().width) / 2 + (radius + 3);
text.translate(offset, 0);
} else if (obj.textPos == 'above') {
- var text = stage.text(x, y - r_height / 2, obj.text);
+ text = stage.text(x, y - r_height / 2, obj.text);
} else if (obj.textPos == 'below') {
- var text = stage.text(x, y + r_height / 2 + r_height, obj.text);
+ text = stage.text(x, y + r_height / 2 + r_height, obj.text);
}
} else {
- var text = stage.text(x + r_width / 2, y + r_height / 2, obj.text);
+ text = stage.text(x + r_width / 2, y + r_height / 2, obj.text);
- var offset = text.getBBox().width / 2 + radius + 3;
+ const offset = text.getBBox().width / 2 + radius + 3;
text.translate(offset, 0);
}
}
}
// Draw arrows
- for (var i = 0; i < data.length; i++) {
- var obj = data[i];
+ for (let i = 0; i < data.length; i++) {
+ const obj = data[i];
if (obj.shape != 'circ') continue;
const conns = obj.connects;
if (!conns) continue;
if (conns instanceof Array) {
- for (var j = 0; j < conns.length; j++) {
- var conn_id = conns[j];
+ for (let j = 0; j < conns.length; j++) {
+ const conn_id = conns[j];
- for (var k = 0; k < data.length; k++) {
- var link_obj = data[k];
+ for (let k = 0; k < data.length; k++) {
+ const link_obj = data[k];
if (link_obj.id == conn_id) {
stage.draw_arrow(obj, link_obj);
}
@@ -199,11 +191,11 @@
stage.draw_curve(obj);
}
if (key == 'dashed') {
- for (var j = 0; j < conns.dashed.length; j++) {
- var conn_id = conns.dashed[j];
+ for (let j = 0; j < conns.dashed.length; j++) {
+ const conn_id = conns.dashed[j];
- for (var k = 0; k < data.length; k++) {
- var link_obj = data[k];
+ for (let k = 0; k < data.length; k++) {
+ const link_obj = data[k];
if (link_obj.id == conn_id) {
stage.draw_arrow(obj, link_obj, '--');
}
@@ -211,11 +203,11 @@
}
}
if (key == 'conns') {
- for (var j = 0; j < conns.conns.length; j++) {
- var conn_id = conns.conns[j];
+ for (let j = 0; j < conns.conns.length; j++) {
+ const conn_id = conns.conns[j];
- for (var k = 0; k < data.length; k++) {
- var link_obj = data[k];
+ for (let k = 0; k < data.length; k++) {
+ const link_obj = data[k];
if (link_obj.id == conn_id) {
stage.draw_arrow(obj, link_obj);
}
@@ -228,7 +220,7 @@
// event for reaction view
$('.model-rxn').unbind('click');
- $('.model-rxn').click(function (event) {
+ $('.model-rxn').click(function () {
const rxns = $(this).data('rxns').split(',');
self.trigger('rxnClick', { rxns: rxns });
});
@@ -238,15 +230,12 @@
Raphael.fn.core_rect = function (obj, x, y, r_width, r_height, show_flux) {
const orgs = obj.kbids;
- let org_count = 0;
- for (var i in orgs) {
- org_count++;
- }
+ const org_count = orgs.length;
const offset = r_width / org_count;
if (orgs) {
- var i = 0;
+ let i = 0;
for (const kbid in orgs) {
// draw box for that org
const rect = this.rect(x + i * offset, y, offset, r_height);
@@ -257,20 +246,26 @@
// Go through rxns for each org,
// if at least one gene is present (or has flux), mark
- var has_flux = false;
+ let has_flux = false;
let flux = 0;
- var gene_present = false;
+ let gene_present = false;
let tip = '';
for (const j in rxn_list) {
const rxn_obj = rxn_list[j];
- if (rxn_obj.gene_present == true) var gene_present = true;
+ if (rxn_obj.gene_present === true) {
+ gene_present = true;
+ }
flux += rxn_obj.flux;
tip += core_tooltip(rxn_obj, rxn_obj.flux);
}
- if (Math.abs(flux) > flux_threshold) var has_flux = true;
- if (orgs[kbid][0]) var org_name = orgs[kbid][0].org_name;
- else var org_name = '';
+ if (Math.abs(flux) > flux_threshold) {
+ has_flux = true;
+ }
+ let org_name = '';
+ if (orgs[kbid][0]) {
+ org_name = orgs[kbid][0].org_name;
+ }
$(rect.node).popover({
content: tip,
title: org_name,
@@ -280,23 +275,19 @@
placement: 'bottom',
});
- //var rect = this.rect(x+(i*offset), y, offset, r_height)
-
+ let color;
if (has_flux && show_flux) {
- //rect.attr({'fill':'#e06060'});
- //rect.attr({'fill':comp_colors[i]});
-
if (!rxn_list[0]) continue;
if (Math.abs(flux) >= 100) {
- var color = heat_colors[0];
+ color = heat_colors[0];
} else if (Math.abs(flux) >= 50) {
- var color = heat_colors[1];
+ color = heat_colors[1];
} else if (Math.abs(flux) >= 10) {
- var color = heat_colors[2];
+ color = heat_colors[2];
} else if (Math.abs(flux) >= 5) {
- var color = heat_colors[3];
+ color = heat_colors[3];
} else {
- var color = heat_colors[4];
+ color = heat_colors[4];
}
rect.attr({ fill: color });
} else if (gene_present) {
@@ -323,20 +314,21 @@
Raphael.fn.draw_curve = function (obj) {
const xys = obj.connects.curve.path;
+ let x1, x3, y1, y2, y3;
if (obj.pathPos == 'below') {
- var x1 = (xys[0][0] - 2) * grid + r_width / 2;
- var y1 = (xys[0][1] - 2) * grid + radius * 3;
- var x2 = (xys[1][0] - 2) * grid + r_width / 2;
- var y2 = (xys[1][1] - 2) * grid + r_width / 2;
- var x3 = (xys[2][0] - 2) * grid + r_width / 2;
- var y3 = (xys[2][1] - 2) * grid + radius * 3;
+ x1 = (xys[0][0] - 2) * grid + r_width / 2;
+ y1 = (xys[0][1] - 2) * grid + radius * 3;
+ // x2 = (xys[1][0] - 2) * grid + r_width / 2;
+ y2 = (xys[1][1] - 2) * grid + r_width / 2;
+ x3 = (xys[2][0] - 2) * grid + r_width / 2;
+ y3 = (xys[2][1] - 2) * grid + radius * 3;
} else if (obj.pathPos == 'above') {
- var x1 = (xys[0][0] - 2) * grid + r_width / 2;
- var y1 = (xys[0][1] - 2) * grid - radius;
- var x2 = (xys[1][0] - 2) * grid + r_width / 2;
- var y2 = (xys[1][1] - 2) * grid;
- var x3 = (xys[2][0] - 2) * grid + r_width / 2;
- var y3 = (xys[2][1] - 2) * grid - radius;
+ x1 = (xys[0][0] - 2) * grid + r_width / 2;
+ y1 = (xys[0][1] - 2) * grid - radius;
+ // x2 = (xys[1][0] - 2) * grid + r_width / 2;
+ y2 = (xys[1][1] - 2) * grid;
+ x3 = (xys[2][0] - 2) * grid + r_width / 2;
+ y3 = (xys[2][1] - 2) * grid - radius;
}
const path = this.path(
'M' +
@@ -362,20 +354,21 @@
Raphael.fn.draw_curved_arrow = function (obj) {
const xys = obj.connects.curve.path;
+ let x1, x2, x3, y1, y2, y3;
if (obj.pathPos == 'below') {
- var x1 = xys[0][0] * grid - 2 + r_width / 2;
- var y1 = xys[0][1] * grid - 2 + radius * 3;
- var x2 = xys[1][0] * grid - 2 + r_width / 2;
- var y2 = xys[1][1] * grid - 2 + r_width / 2;
- var x3 = xys[2][0] * grid - 2 + r_width / 2;
- var y3 = xys[2][1] * grid - 2 + radius * 3;
+ x1 = xys[0][0] * grid - 2 + r_width / 2;
+ y1 = xys[0][1] * grid - 2 + radius * 3;
+ x2 = xys[1][0] * grid - 2 + r_width / 2;
+ y2 = xys[1][1] * grid - 2 + r_width / 2;
+ x3 = xys[2][0] * grid - 2 + r_width / 2;
+ y3 = xys[2][1] * grid - 2 + radius * 3;
} else if (obj.pathPos == 'above') {
- var x1 = (xys[0][0] - 2) * grid + r_width / 2;
- var y1 = (xys[0][1] - 2) * grid - radius;
- var x2 = (xys[1][0] - 2) * grid + r_width / 2;
- var y2 = (xys[1][1] - 2) * grid;
- var x3 = (xys[2][0] - 2) * grid + r_width / 2;
- var y3 = (xys[2][1] - 2) * grid - radius;
+ x1 = (xys[0][0] - 2) * grid + r_width / 2;
+ y1 = (xys[0][1] - 2) * grid - radius;
+ x2 = (xys[1][0] - 2) * grid + r_width / 2;
+ y2 = (xys[1][1] - 2) * grid;
+ x3 = (xys[2][0] - 2) * grid + r_width / 2;
+ y3 = (xys[2][1] - 2) * grid - radius;
}
let angle = Math.atan2(x1 - x2, y2 - y1);
@@ -428,48 +421,49 @@
};
Raphael.fn.draw_arrow = function (obj, link_obj, dashed) {
+ let x1, x2, y1, y2;
if (link_obj.y < obj.y) {
- var x1 = (obj.x - 2) * grid + r_width / 2;
- var y1 = (obj.y - 2) * grid + r_height / 2 - 10;
- var x2 = (link_obj.x - 2) * grid + r_width / 2;
- var y2 = (link_obj.y - 2) * grid + r_height / 2 + 10;
+ x1 = (obj.x - 2) * grid + r_width / 2;
+ y1 = (obj.y - 2) * grid + r_height / 2 - 10;
+ x2 = (link_obj.x - 2) * grid + r_width / 2;
+ y2 = (link_obj.y - 2) * grid + r_height / 2 + 10;
} else if (link_obj.y > obj.y) {
- var x1 = (obj.x - 2) * grid + r_width / 2;
- var y1 = (obj.y - 2) * grid + r_height / 2 + 10;
- var x2 = (link_obj.x - 2) * grid + r_width / 2;
- var y2 = (link_obj.y - 2) * grid + r_height / 2 - 10;
+ x1 = (obj.x - 2) * grid + r_width / 2;
+ y1 = (obj.y - 2) * grid + r_height / 2 + 10;
+ x2 = (link_obj.x - 2) * grid + r_width / 2;
+ y2 = (link_obj.y - 2) * grid + r_height / 2 - 10;
}
if (link_obj.x < obj.x && link_obj.y > obj.y) {
- var x1 = (obj.x - 2) * grid + r_width / 2 - 10;
- var y1 = (obj.y - 2) * grid + r_height / 2 + 10;
- var x2 = (link_obj.x - 2) * grid + r_width / 2 + 10;
- var y2 = (link_obj.y - 2) * grid + r_height / 2 - 10;
+ x1 = (obj.x - 2) * grid + r_width / 2 - 10;
+ y1 = (obj.y - 2) * grid + r_height / 2 + 10;
+ x2 = (link_obj.x - 2) * grid + r_width / 2 + 10;
+ y2 = (link_obj.y - 2) * grid + r_height / 2 - 10;
} else if (link_obj.x < obj.x && link_obj.y < obj.y) {
- var x1 = (obj.x - 2) * grid + r_width / 2 - 10;
- var y1 = (obj.y - 2) * grid + r_height / 2 - 10;
- var x2 = (link_obj.x - 2) * grid + r_width / 2 + 10;
- var y2 = (link_obj.y - 2) * grid + r_height / 2 + 10;
+ x1 = (obj.x - 2) * grid + r_width / 2 - 10;
+ y1 = (obj.y - 2) * grid + r_height / 2 - 10;
+ x2 = (link_obj.x - 2) * grid + r_width / 2 + 10;
+ y2 = (link_obj.y - 2) * grid + r_height / 2 + 10;
} else if (link_obj.x > obj.x && link_obj.y > obj.y) {
- var x1 = (obj.x - 2) * grid + r_width / 2 + 10;
- var y1 = (obj.y - 2) * grid + r_height / 2 + 10;
- var x2 = (link_obj.x - 2) * grid + r_width / 2 - 10;
- var y2 = (link_obj.y - 2) * grid + r_height / 2 - 10;
+ x1 = (obj.x - 2) * grid + r_width / 2 + 10;
+ y1 = (obj.y - 2) * grid + r_height / 2 + 10;
+ x2 = (link_obj.x - 2) * grid + r_width / 2 - 10;
+ y2 = (link_obj.y - 2) * grid + r_height / 2 - 10;
} else if (link_obj.x > obj.x && link_obj.y < obj.y) {
- var x1 = (obj.x - 2) * grid + r_width / 2 + 10;
- var y1 = (obj.y - 2) * grid + r_height / 2 - 10;
- var x2 = (link_obj.x - 2) * grid + r_width / 2 - 10;
- var y2 = (link_obj.y - 2) * grid + r_height / 2 + 10;
+ x1 = (obj.x - 2) * grid + r_width / 2 + 10;
+ y1 = (obj.y - 2) * grid + r_height / 2 - 10;
+ x2 = (link_obj.x - 2) * grid + r_width / 2 - 10;
+ y2 = (link_obj.y - 2) * grid + r_height / 2 + 10;
} else if (link_obj.x < obj.x && link_obj.y == obj.y) {
- var x1 = (obj.x - 2) * grid + r_width / 2 - 10;
- var y1 = (obj.y - 2) * grid + r_height / 2;
- var x2 = (link_obj.x - 2) * grid + r_width / 2 + 10;
- var y2 = (link_obj.y - 2) * grid + r_height / 2;
+ x1 = (obj.x - 2) * grid + r_width / 2 - 10;
+ y1 = (obj.y - 2) * grid + r_height / 2;
+ x2 = (link_obj.x - 2) * grid + r_width / 2 + 10;
+ y2 = (link_obj.y - 2) * grid + r_height / 2;
} else if (link_obj.x > obj.x && link_obj.y == obj.y) {
- var x1 = (obj.x - 2) * grid + r_width / 2 + 10;
- var y1 = (obj.y - 2) * grid + r_height / 2;
- var x2 = (link_obj.x - 2) * grid + r_width / 2 - 10;
- var y2 = (link_obj.y - 2) * grid + r_height / 2;
+ x1 = (obj.x - 2) * grid + r_width / 2 + 10;
+ y1 = (obj.y - 2) * grid + r_height / 2;
+ x2 = (link_obj.x - 2) * grid + r_width / 2 - 10;
+ y2 = (link_obj.y - 2) * grid + r_height / 2;
}
if (dashed) {
return this.arrow(x1, y1, x2, y2, 4, dashed);
@@ -512,12 +506,9 @@
function get_genome_id(ws_id) {
const pos = ws_id.indexOf('.');
- var ws_id = ws_id.slice(0, ws_id.indexOf('.', pos + 1));
- return ws_id;
+ return ws_id.slice(0, ws_id.indexOf('.', pos + 1));
}
- //this._rewireIds(this.$elem, this);
-
return self;
}, //end init
diff --git a/kbase-extension/static/kbase/js/widgets/function_output/kbaseSEEDFunctions.js b/kbase-extension/static/kbase/js/widgets/function_output/kbaseSEEDFunctions.js
index 56f16dfbe4..50dd79587b 100644
--- a/kbase-extension/static/kbase/js/widgets/function_output/kbaseSEEDFunctions.js
+++ b/kbase-extension/static/kbase/js/widgets/function_output/kbaseSEEDFunctions.js
@@ -63,10 +63,10 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
/*
I need to load the SEED subsystem ontology. I am going to use
- the "subsys.txt" file I found at:
+ the "subsys.txt" file I found at:
ftp.theseed.org/subsystems/subsys.txt
-
- Note that this file is updated weekly, but not versioned. It's
+
+ Note that this file is updated weekly, but not versioned. It's
possible that errors will arise because the subsystems assigned
in the genome object are out of date relative to the current
subsys.txt file.
@@ -101,7 +101,7 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
const data = d3.tsv.parseRows(text);
let totalGenesWithFunctionalRoles = 0;
- for (i = 0; i < data.length; i++) {
+ for (let i = 0; i < data.length; i++) {
let geneCount = 0;
let nodeHierarchy = '';
let parentHierarchy = 'Functional Categories';
@@ -115,7 +115,7 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
totalGenesWithFunctionalRoles += subsysToGeneMap[data[i][3]].length;
}
- for (j = 0; j < ontologyDepth; j++) {
+ for (let j = 0; j < ontologyDepth; j++) {
// some node names are an empty string "". I'm going to set these to
// a modified version of their parent node name
data[i][j] =
@@ -125,7 +125,7 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
// create new node for top level of hierarchy if it's not already defined.
if (j === 0) {
if (nodeMap[nodeHierarchy] === undefined) {
- var node = { name: data[i][j], size: 0, children: [] };
+ const node = { name: data[i][j], size: 0, children: [] };
SEEDTree.children.push(node);
nodeMap[nodeHierarchy] = node;
Level1[data[i][j]] = 0;
@@ -133,7 +133,7 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
Level1[data[i][j]] += geneCount;
} else {
if (nodeMap[nodeHierarchy] === undefined) {
- var node = { name: data[i][j], size: 0, children: [] };
+ const node = { name: data[i][j], size: 0, children: [] };
nodeMap[parentHierarchy].children.push(node);
nodeMap[nodeHierarchy] = node;
@@ -162,7 +162,7 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
);
} else {
// Set maxCount to scale bars
- for (k in Level1) {
+ for (const k in Level1) {
self.maxCount = self.maxCount > Level1[k] ? self.maxCount : Level1[k];
}
@@ -185,7 +185,6 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
500,
nodes.length * self.barHeight + self.margin.top + self.margin.bottom
);
- const i = self.i;
d3.selectAll('#mainview')
.select('svg')
@@ -212,18 +211,18 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
.enter()
.append('g')
.attr('class', 'KBSnode')
- .attr('transform', (d) => {
+ .attr('transform', () => {
return 'translate(' + source.y0 + ',' + source.x0 + ')';
})
.style('opacity', 1e-6)
- .on('mouseover', function (d) {
+ .on('mouseover', function () {
d3.select(this)
.selectAll('text, rect')
.style('font-weight', 'bold')
.style('font-size', '90%')
.style('stroke-width', '3px');
})
- .on('mouseout', function (d) {
+ .on('mouseout', function () {
d3.select(this)
.selectAll('text, rect')
.style('font-weight', 'normal')
@@ -302,7 +301,7 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
node.exit()
.transition()
.duration(self.duration)
- .attr('transform', (d) => {
+ .attr('transform', () => {
return 'translate(' + source.y + ',' + source.x + ')';
})
.style('opacity', 1e-6)
@@ -392,7 +391,7 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
} else {
prom = this.wsClient.get_objects([obj]);
}
- //var prom = this.options.kbCache.req('ws', 'get_objects', [obj]);
+ //let prom = this.options.kbCache.req('ws', 'get_objects', [obj]);
$.when(prom).fail(
$.proxy((error) => {
@@ -406,9 +405,9 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
const genomeObj = genome[0].data;
/*
- First I am going to iterate over the Genome Typed Object and
+ First I am going to iterate over the Genome Typed Object and
create a mapping of the assigned functional roles (by SEED) to
- an array of genes with those roles.
+ an array of genes with those roles.
subsysToGeneMap [ SEED Role ] = Array of Gene Ids
*/
@@ -430,14 +429,14 @@ define(['kbwidget', 'bootstrap', 'jquery', 'narrativeConfig', 'd3'], (
);
},
- loggedInCallback: function (event, auth) {
+ loggedInCallback: function (_event, auth) {
this.authToken = auth;
this.wsClient = new Workspace(this.wsUrl, this.authToken);
this.render();
return this;
},
- loggedOutCallback: function (event, auth) {
+ loggedOutCallback: function () {
this.authToken = null;
this.wsClient = null;
return this;
diff --git a/kbase-extension/static/kbase/js/widgets/function_output/kbaseSamplePropertyHistogram.js b/kbase-extension/static/kbase/js/widgets/function_output/kbaseSamplePropertyHistogram.js
index 58bcd8a678..4ffa8e4b30 100644
--- a/kbase-extension/static/kbase/js/widgets/function_output/kbaseSamplePropertyHistogram.js
+++ b/kbase-extension/static/kbase/js/widgets/function_output/kbaseSamplePropertyHistogram.js
@@ -5,6 +5,7 @@ define(['kbwidget', 'bootstrap', 'jquery', 'plotly', 'kbaseSamplePropertyMatrixA
Plotly,
kbaseSamplePropertyMatrixAbstract
) => {
+ 'use strict';
return KBWidget({
name: 'kbaseSamplePropertyHistogram',
parent: kbaseSamplePropertyMatrixAbstract,
@@ -52,7 +53,7 @@ define(['kbwidget', 'bootstrap', 'jquery', 'plotly', 'kbaseSamplePropertyMatrixA
s2 += data.values[rIndex][cIndex] * data.values[rIndex][cIndex];
}
const avg = s1 / n;
- se = n > 1 ? Math.sqrt((s2 * n - s1 * s1) / (n - 1) / n / n) : 0;
+ const se = n > 1 ? Math.sqrt((s2 * n - s1 * s1) / (n - 1) / n / n) : 0;
x.push(sampleProperty.name);
y.push(avg);
yErrors.push(se);
diff --git a/kbase-extension/static/kbase/js/widgets/function_output/kbaseSamplePropertyMatrixAbstract.js b/kbase-extension/static/kbase/js/widgets/function_output/kbaseSamplePropertyMatrixAbstract.js
index 24cc4aa896..6d4283f604 100644
--- a/kbase-extension/static/kbase/js/widgets/function_output/kbaseSamplePropertyMatrixAbstract.js
+++ b/kbase-extension/static/kbase/js/widgets/function_output/kbaseSamplePropertyMatrixAbstract.js
@@ -1,22 +1,5 @@
-define([
- 'kbwidget',
- 'bootstrap',
- 'jquery',
- 'plotly',
- 'kbaseMatrix2DAbstract',
- 'kbaseAuthenticatedWidget',
- 'kbaseTabs',
- 'jquery-dataTables',
-], (
- KBWidget,
- bootstrap,
- $,
- Plotly,
- kbaseMatrix2DAbstract,
- kbaseAuthenticatedWidget,
- kbaseTabs,
- jquery_dataTables
-) => {
+define(['kbwidget', 'kbaseMatrix2DAbstract'], (KBWidget, kbaseMatrix2DAbstract) => {
+ 'use strict';
return KBWidget({
name: 'kbaseSamplePropertyMatrixAbstract',
parent: kbaseMatrix2DAbstract,
@@ -76,14 +59,14 @@ define([
buildSeriesSamplePorperties: function (seriesColumns, columnMetadata, sorted) {
const sampleProperties = [];
- for (var i in seriesColumns) {
+ for (const i in seriesColumns) {
const seriesId = seriesColumns[i].seriesId;
const columns = seriesColumns[i].columns;
// Build property name
const samplePropertyNames = {};
- for (var i in columns) {
- var val = this.getPropertyValue(
+ for (const i in columns) {
+ const val = this.getPropertyValue(
columns[i].properties,
this.TERM_PROPERTY,
this.TERM_NAME
@@ -93,7 +76,7 @@ define([
}
}
let samplePropertyName = '';
- for (var val in samplePropertyNames) {
+ for (const val in samplePropertyNames) {
if (samplePropertyName != '') {
samplePropertyName += '; ';
}
@@ -102,7 +85,7 @@ define([
// Build property units
const samplePropertyUnits = {};
- for (var i in columns) {
+ for (const i in columns) {
const pv = this.getProperty(
columns[i].properties,
this.TERM_PROPERTY,
@@ -113,12 +96,12 @@ define([
}
}
let samplePropertyUnit = '';
- for (var val in samplePropertyUnits) {
- if (val == null || val == '') continue;
+ for (const _val in samplePropertyUnits) {
+ if (_val == '') continue;
if (samplePropertyUnit != '') {
samplePropertyUnit += '; ';
}
- samplePropertyUnit += val;
+ samplePropertyUnit += _val;
}
// Build sampleProperty
@@ -196,7 +179,6 @@ define([
const n = samples.length;
let s1 = 0;
let s2 = 0;
- var se = 0;
let count = 0;
for (const j in samples) {
const sample = samples[j];
@@ -216,7 +198,7 @@ define([
const avg = s1 / n;
const std = n > 1 ? Math.sqrt((s2 * n - s1 * s1) / (n - 1) / n) : 0;
- var se = n > 1 ? Math.sqrt((s2 * n - s1 * s1) / (n - 1) / n / n) : 0;
+ const se = n > 1 ? Math.sqrt((s2 * n - s1 * s1) / (n - 1) / n / n) : 0;
samplePropertyStat.push({
name: sampleProperty.name,
diff --git a/kbase-extension/static/kbase/js/widgets/function_output/kbaseSeqCompView.js b/kbase-extension/static/kbase/js/widgets/function_output/kbaseSeqCompView.js
index b5fffa0c8a..1451e7ac27 100644
--- a/kbase-extension/static/kbase/js/widgets/function_output/kbaseSeqCompView.js
+++ b/kbase-extension/static/kbase/js/widgets/function_output/kbaseSeqCompView.js
@@ -5,25 +5,13 @@
define([
'kbwidget',
- 'bootstrap',
'jquery',
'util/string',
'narrativeConfig',
'd3',
'kbaseAuthenticatedWidget',
'kbaseTabs',
- 'jquery-dataTables',
-], (
- KBWidget,
- bootstrap,
- $,
- StringUtil,
- Config,
- d3,
- kbaseAuthenticatedWidget,
- kbaseTabs,
- jquery_dataTables
-) => {
+], (KBWidget, $, StringUtil, Config, d3, kbaseAuthenticatedWidget, kbaseTabs) => {
return KBWidget({
name: 'kbaseSeqCompView',
parent: kbaseAuthenticatedWidget,
@@ -52,9 +40,9 @@ define([
// this.ws_id = 'ecoli.dnadiff.output';
// this.ws_name = 'fangfang:1454986986211';
- console.log('WS parameters:');
- console.log(this.ws_id);
- console.log(this.ws_name);
+ // console.log('WS parameters:');
+ // console.log(this.ws_id);
+ // console.log(this.ws_name);
return this;
},
@@ -86,14 +74,14 @@ define([
// kbws.get_object_subset([{ref: 'fangfang:1452395167784' +"/"+ 'Rhodobacter_CACIA_14H1_contigs', included: ['contigs/[*]/id', 'contigs/[*]/length', 'id', 'name', 'source', 'source_id', 'type']}], function(data) {
container.empty();
- var data = data[0].data;
- console.log(data);
+ const dataData = data[0].data;
+ console.log(dataData);
const tabPane = $('');
container.append(tabPane);
const tabWidget = new kbaseTabs(tabPane, { canDelete: true, tabs: [] });
const tabNames = ['Legend', 'DNAdiff Comparisons'];
const tabIds = ['legend', 'comparisons'];
- for (var i = 0; i < tabIds.length; i++) {
+ for (let i = 0; i < tabIds.length; i++) {
const tabDiv = $(' ');
tabWidget.addTab({
tab: tabNames[i],
@@ -110,19 +98,17 @@ style="margin-left: auto; margin-right: auto;" id="' +
pref +
'legend-table"/>'
);
- // var legendLabels = ['KBase ID', 'Name', 'Object ID', 'Source', "Source ID", "Type"];
- // var legendData = [data.id, data.name, self.ws_id, data.source, data.source_id, data.type];
const legendLabels = [];
const legendData = [];
- const n_genomes = data.genome_names.length;
- for (var i = 0; i < n_genomes; i++) {
- const name = data.genome_names[i];
- var ii = i + 1;
+ const n_genomes = dataData.genome_names.length;
+ for (let i = 0; i < n_genomes; i++) {
+ const name = dataData.genome_names[i];
+ const ii = i + 1;
legendLabels.push(ii.toString());
legendData.push(name);
}
const legendTable = $('#' + pref + 'legend-table');
- for (var i = 0; i < legendData.length; i++) {
+ for (let i = 0; i < legendData.length; i++) {
legendTable.append(
' | ' +
legendLabels[i] +
@@ -138,22 +124,19 @@ style="margin-left: auto; margin-right: auto;" id="' +
pref +
'comparisons-table"/>'
);
- // $('#'+pref+'comparisons').append('');
- // $('#'+pref+'comparisons').append('');
- const comparisonsData = [];
const compTable = $('#' + pref + 'comparisons-table');
- var row = ' | | Query \\ Reference | ';
- for (var i = 0; i < n_genomes; i++) {
- var ii = i + 1;
+ let row = ' | Query \\ Reference | ';
+ for (let i = 0; i < n_genomes; i++) {
+ const ii = i + 1;
row += '' + ii.toString() + ' | ';
}
row += ' ';
compTable.append(row);
let minSim = 1;
- for (var i = 0; i < data.genome_comparisons.length; i++) {
- console.log(data.genome_comparisons[i].similarity);
- if (data.genome_comparisons[i].similarity < minSim) {
- minSim = data.genome_comparisons[i].similarity;
+ for (let i = 0; i < dataData.genome_comparisons.length; i++) {
+ console.log(dataData.genome_comparisons[i].similarity);
+ if (dataData.genome_comparisons[i].similarity < minSim) {
+ minSim = dataData.genome_comparisons[i].similarity;
}
}
// console.log(minSim);
@@ -162,19 +145,19 @@ style="margin-left: auto; margin-right: auto;" id="' +
.domain([minSim, (minSim + 1.0) / 2, 1.0])
.range(['PaleVioletRed', 'pink', 'white']);
const reports = [];
- for (var i = 0; i < n_genomes; i++) {
- var ii = i + 1;
- let iname = ii + '. ' + data.genome_names[i];
+ for (let i = 0; i < n_genomes; i++) {
+ const ii = i + 1;
+ let iname = ii + '. ' + dataData.genome_names[i];
const lp = iname.indexOf('(');
if (lp > 0) {
iname = iname.substring(0, lp - 1);
}
- var row = ' | ' + iname + ' | ';
- for (var j = 0; j < n_genomes; j++) {
- var jj = j + 1;
- comp = data.genome_comparisons.pop();
+ let row = ' | ' + iname + ' | ';
+ for (let j = 0; j < n_genomes; j++) {
+ const jj = j + 1;
+ const comp = dataData.genome_comparisons.pop();
reports.push(comp.report);
- cellId = pref + '_td_' + ii + '_' + jj;
+ const cellId = pref + '_td_' + ii + '_' + jj;
row +=
'";
+ const ix = renderer.index;
+ target.innerHTML = "";
target.firstChild.setAttribute(
'style',
'width: ' +
@@ -354,18 +354,18 @@
renderer.settings.height +
'px;'
);
- jQuery('#graph_div' + index).svg();
+ jQuery('#graph_div' + ix).svg();
let cmax = 0;
if (
renderer.settings.type == 'deviation' &&
!renderer.settings.data[0].data.hasOwnProperty('upper')
) {
- renderer.calculateData(renderer.settings.data, index);
+ renderer.calculateData(renderer.settings.data, ix);
cmax = renderer.cmax;
}
- rendererGraph[index].drawImage(jQuery('#graph_div' + index).svg('get'), cmax, index);
+ rendererGraph[ix].drawImage(jQuery('#graph_div' + ix).svg('get'), cmax, ix);
return renderer;
},
@@ -484,30 +484,18 @@
'url(#fadePurple)',
];
- const colors = [
- '#0044CC', // blue
- '#BD362F', // red
- '#51A351', // green
- '#F89406', // yellow
- '#2F96B4', // lightblue
- '#bd2fa6', // purple
- ];
-
const defs = svg.defs();
let max = 0;
let y2max = 0;
- for (i = 0; i < renderer.settings.data.length; i++) {
- for (h = 0; h < renderer.settings.data[i].data.length; h++) {
- if (
- renderer.settings.data[i].settings &&
- renderer.settings.data[i].settings.isY2
- ) {
- if (parseFloat(renderer.settings.data[i].data[h]) > y2max) {
- y2max = parseFloat(renderer.settings.data[i].data[h]);
+ for (const element of renderer.settings.data) {
+ for (let h = 0; h < element.data.length; h++) {
+ if (element.settings && element.settings.isY2) {
+ if (parseFloat(element.data[h]) > y2max) {
+ y2max = parseFloat(element.data[h]);
}
} else {
- if (parseFloat(renderer.settings.data[i].data[h]) > max) {
- max = parseFloat(renderer.settings.data[i].data[h]);
+ if (parseFloat(element.data[h]) > max) {
+ max = parseFloat(element.data[h]);
}
}
}
@@ -554,16 +542,16 @@
svg.graph.noDraw().gridlines({ stroke: 'gray', strokeDashArray: '2,2' }, 'gray');
}
- for (i = 0; i < renderer.settings.data.length; i++) {
+ for (const element of renderer.settings.data) {
svg.graph
.noDraw()
.addSeries(
- renderer.settings.data[i].name,
- renderer.settings.data[i].data,
+ element.name,
+ element.data,
null,
- renderer.settings.data[i].lineColor || 'white',
- renderer.settings.data[i].lineWidth || renderer.settings.default_line_width,
- renderer.settings.data[i].settings ? renderer.settings.data[i].settings : {}
+ element.lineColor || 'white',
+ element.lineWidth || renderer.settings.default_line_width,
+ element.settings ? element.settings : {}
);
}
@@ -645,7 +633,7 @@
: legendAreas[chartLegend]
)
.end();
- for (i = 0; i < renderer.settings.data.length; i++) {
+ for (let i = 0; i < renderer.settings.data.length; i++) {
svg.graph
.noDraw()
.series(i)
@@ -668,7 +656,7 @@
let min = data[0].data[0];
let max = data[0].data[0];
- for (var i = 0; i < data.length; i++) {
+ for (let i = 0; i < data.length; i++) {
data[i].data = data[i].data.sort((a, b) => {
return a - b;
});
@@ -681,7 +669,6 @@
fivenumbers[i] = [];
fivenumbers[i]['min'] = data[i].data[0];
fivenumbers[i]['max'] = data[i].data[data[i].data.length - 1];
- const boxarray = [];
if (data[i].data.length % 2 == 1) {
const med = parseInt(data[i].data.length / 2);
fivenumbers[i]['median'] = data[i].data[med];
@@ -714,7 +701,7 @@
}
}
- for (var i = 0; i < data.length; i++) {
+ for (let i = 0; i < data.length; i++) {
renderer.settings.data[i].data = [fivenumbers[i]];
}
renderer.cmax = max;
diff --git a/kbase-extension/static/kbase/js/widgets/kbStandalonePlot.js b/kbase-extension/static/kbase/js/widgets/kbStandalonePlot.js
index 542c73c838..04f487be5a 100644
--- a/kbase-extension/static/kbase/js/widgets/kbStandalonePlot.js
+++ b/kbase-extension/static/kbase/js/widgets/kbStandalonePlot.js
@@ -416,30 +416,17 @@
[0.2, 0.9, 0.8, 0.995],
];
- const colors = [
- '#BD362F', // red
- '#0044CC', // blue
- '#51A351', // green
- '#F89406', // yellow
- '#2F96B4', // lightblue
- '#bd2fa6', // purple
- ];
-
if (renderer.settings.x_min === undefined) {
let x_min = undefined;
let x_max = undefined;
let y_min = undefined;
let y_max = undefined;
- for (var i = 0; i < renderer.settings.data.points.length; i++) {
- for (let h = 0; h < renderer.settings.data.points[i].length; h++) {
- if (x_min === undefined || renderer.settings.data.points[i][h].x < x_min)
- x_min = renderer.settings.data.points[i][h].x;
- if (x_max === undefined || renderer.settings.data.points[i][h].x > x_max)
- x_max = renderer.settings.data.points[i][h].x;
- if (y_min === undefined || renderer.settings.data.points[i][h].y < y_min)
- y_min = renderer.settings.data.points[i][h].y;
- if (y_max === undefined || renderer.settings.data.points[i][h].y > y_max)
- y_max = renderer.settings.data.points[i][h].y;
+ for (const element of renderer.settings.data.points) {
+ for (let h = 0; h < element.length; h++) {
+ if (x_min === undefined || element[h].x < x_min) x_min = element[h].x;
+ if (x_max === undefined || element[h].x > x_max) x_max = element[h].x;
+ if (y_min === undefined || element[h].y < y_min) y_min = element[h].y;
+ if (y_max === undefined || element[h].y > y_max) y_max = element[h].y;
}
}
const sx = rendererPlot[0].niceScale({ min: x_min, max: x_max });
@@ -458,9 +445,6 @@
renderer.settings.title_color,
renderer.settings.title_settings
);
- for (i = 0; i < renderer.settings.data.length; i++) {
- const d = renderer.settings.data[i];
- }
svg.plot.plotPoints = renderer.settings.data.points;
svg.plot.connected = renderer.settings.connected;
diff --git a/kbase-extension/static/kbase/js/widgets/kbaseButtonControls.js b/kbase-extension/static/kbase/js/widgets/kbaseButtonControls.js
index c06312b7db..c84287c12c 100644
--- a/kbase-extension/static/kbase/js/widgets/kbaseButtonControls.js
+++ b/kbase-extension/static/kbase/js/widgets/kbaseButtonControls.js
@@ -34,7 +34,8 @@ define([
'geometry_rectangle',
'geometry_point',
'geometry_size',
-], (KBWidget, bootstrap, $, geometry_rectangle, geometry_point, geometry_size) => {
+], (KBWidget, bootstrap, $, Rectangle, Point, Size) => {
+ 'use strict';
return KBWidget({
name: 'kbaseButtonControls',
@@ -113,9 +114,6 @@ define([
this._rewireIds($elem, this);
if (this.options.onMouseover && this.options.type == 'floating') {
- const overControls = false;
- let overParent = false;
-
const $controls = this;
$elem
@@ -130,44 +128,22 @@ define([
$(this).children().first().show();
window._active_kbaseButtonControls = $controlButtons;
- overParent = true;
})
.mouseout((e) => {
e.preventDefault();
e.stopPropagation();
- const controlBounds = $controls.bounds($controlButtons);
const controlBoundsV = $controls.visibleBounds($controlButtons);
- const elemBounds = $controls.bounds($elem);
-
- const bounds = elemBounds.intersectRect(controlBounds);
if (!controlBoundsV.containsPoint(new Point(e.pageX, e.pageY))) {
- //if (! $.contains($elem.get(0), e.target)) {
window._active_kbaseButtonControls.hide();
window._active_kbaseButtonControls = undefined;
}
- overParent = false;
})
.children()
.first()
.hide();
-
- /*$controlButtons
- .mouseover(
- function(e) {
- overControls = true;
- }
- )
- .mouseout(
- function(e) {
- overControls = false;
- if (! overParent) {
- $(this).hide();
- }
- }
- )*/
}
this.setControls(this.options.controls);
@@ -185,7 +161,7 @@ define([
setControls: function (controls) {
this.data('control-buttons').empty();
- for (control in this._controls) {
+ for (const control in this._controls) {
this._controls[control] = undefined;
}
@@ -193,7 +169,7 @@ define([
$.each(
controls,
- $.proxy(function (idx, val) {
+ $.proxy(function (_idx, val) {
if (val.condition) {
if (
val.condition.call(
@@ -212,24 +188,20 @@ define([
btnClass = btnClass + ' btn-' + val.type;
}
- tooltip = val.tooltip;
+ let tooltip = val.tooltip;
if (typeof val.tooltip == 'string') {
tooltip = { title: val.tooltip };
}
if (tooltip != undefined && tooltip.container == undefined) {
- tooltip.container = this.data('control-buttons'); //this.$elem;//'body';//this.$elem;//'body';
+ tooltip.container = this.data('control-buttons');
}
if (tooltip != undefined && tooltip.placement == undefined) {
tooltip.placement = 'top';
}
- //if (tooltip != undefined) {
- // tooltip.trigger = 'manual';
- //}
-
if (tooltip != undefined) {
tooltip.delay = 1;
}
@@ -250,18 +222,6 @@ define([
}
val.callback.call(this, e, $buttonControls.options.context);
});
- /*.on('mouseover',
- function(e) {
- e.preventDefault(); e.stopPropagation();
- $(this).tooltip('show');
- }
- )
- .on('mouseout',
- function(e) {
- e.preventDefault(); e.stopPropagation();
- $(this).tooltip('hide');
- }
- );*/
if (val.id) {
this._controls[val.id] = $button;
}
| |