Skip to content

Commit

Permalink
Parse entry point in dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Feb 11, 2018
1 parent 33ae04a commit 80222ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
10 changes: 7 additions & 3 deletions client/galaxy/scripts/mvc/visualization/visualization-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ var View = Backbone.View.extend({
$.ajax({
url: `${Galaxy.root}api/visualizations/${options.id}`
})
.done(response => {
window.console.log(response);
this.chart = new Chart({}, response.latest_revision.config.chart_dict);
.done(visualization => {
window.console.log(visualization);
this.visualization = visualization;
this.chart = new Chart({}, visualization.latest_revision.config.chart_dict);
this.deferred = new Deferred();
this.viewer = new Viewer(this);
this.editor = new Editor(this);
this.$el.append(this.viewer.$el);
this.$el.append(this.editor.$el);
this.render();

})
.fail(response => {
let message = response.responseJSON && response.responseJSON.err_msg;
Expand All @@ -32,6 +34,8 @@ var View = Backbone.View.extend({

/** Build client ui */
render: function() {
let plugin_path = this.visualization.plugin.static_url + '/' + this.visualization.type;
//import Plugin from plugin_path;
/*this.go(this.chart.load() ? "viewer" : "editor");
require(["repository/build/" + chart.get("type")], function(ChartView) {
new ChartView({ process: process, chart: chart, dataset: self.app.dataset, targets: self.targets });
Expand Down
5 changes: 3 additions & 2 deletions lib/galaxy/visualization/plugins/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def to_dict(self):
'title' : self.config.get('title'),
'target' : self.config.get('render_target', 'galaxy_main'),
'embeddable' : self.config.get('embeddable', False),
'static_url' : self.static_url if self.serves_static else None
'entry_point' : self.config.get('entry_point'),
'static_url' : '/'.join(['plugins', self.static_url])
}

def _get_saved_visualization_config(self, visualization, revision=None, **kwargs):
Expand All @@ -170,7 +171,7 @@ def _check_path(self, path):
def _set_up_static_images(self):
default_path = 'static/logo.png'
if self._check_path(default_path):
self.config['logo'] = 'plugins/%s/%s' % (self.base_url, default_path)
self.config['logo'] = '/'.join(['plugins', self.base_url, default_path])

def _build_render_vars(self, config, trans=None, **kwargs):
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/visualization/plugins/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def get_visualization(self, trans, visualization_name, target_object):
param_data = data_source['to_params']
response = visualization.to_dict()
response['href'] = self.get_visualization_url(trans, target_object, visualization, param_data),

return response
return None

def is_object_applicable(self, trans, target_object, data_source_tests):
Expand Down

0 comments on commit 80222ba

Please sign in to comment.