mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix PV Protein Viewer build
This commit is contained in:
@@ -18,6 +18,7 @@ const PLUGIN_BUILD_DIRS = [
|
||||
"media_player",
|
||||
"mvpapp",
|
||||
"openlayers",
|
||||
"pv",
|
||||
];
|
||||
|
||||
const paths = {
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
"dependencies": {
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"backbone": "^1.3.3",
|
||||
"bio-pv": "^1.8.1",
|
||||
"bootstrap": "^3.3.7",
|
||||
"jquery": "^3.1.1",
|
||||
"jquery": "^3.5.1",
|
||||
"parcel-bundler": "^1.4.1",
|
||||
"bio-pv": "^1.8.1"
|
||||
"underscore": "^1.11.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "parcel build src/pv.js -d static"
|
||||
|
||||
@@ -1,35 +1,40 @@
|
||||
import * as pv from "bio-pv";
|
||||
import _ from "underscore";
|
||||
import $ from "jquery";
|
||||
|
||||
_.extend(window.bundleEntries || {}, {
|
||||
load: function(options) {
|
||||
load: function (options) {
|
||||
var settings = options.chart.settings;
|
||||
var viewer = pv.Viewer(document.getElementById(options.targets[0]), {
|
||||
quality: settings.get('quality'),
|
||||
width: 'auto',
|
||||
height: 'auto',
|
||||
quality: settings.get("quality"),
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
antialias: true,
|
||||
outline: true
|
||||
outline: true,
|
||||
});
|
||||
$.ajax( {
|
||||
$.ajax({
|
||||
url: options.dataset.download_url,
|
||||
cache: true,
|
||||
success: function(response) {
|
||||
success: function (response) {
|
||||
var structure = pv.io.pdb(response);
|
||||
var viewer_options = {};
|
||||
_.each(settings.attributes, function(value, key) {
|
||||
viewer_options[key.replace('viewer|', '')] = value;
|
||||
_.each(settings.attributes, function (value, key) {
|
||||
viewer_options[key.replace("viewer|", "")] = value;
|
||||
});
|
||||
viewer.clear();
|
||||
viewer.renderAs('protein', structure, viewer_options.mode, viewer_options);
|
||||
viewer.renderAs("protein", structure, viewer_options.mode, viewer_options);
|
||||
viewer.centerOn(structure);
|
||||
viewer.autoZoom();
|
||||
options.chart.state('ok', 'Chart drawn.');
|
||||
options.chart.state("ok", "Chart drawn.");
|
||||
options.process.resolve();
|
||||
},
|
||||
error: function() {
|
||||
options.chart.state('ok', 'Failed to load pdb file.');
|
||||
error: function () {
|
||||
options.chart.state("ok", "Failed to load pdb file.");
|
||||
options.process.resolve();
|
||||
}
|
||||
},
|
||||
});
|
||||
$(window).resize(function() { viewer.fitParent() });
|
||||
}
|
||||
$(window).resize(function () {
|
||||
viewer.fitParent();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user