Skip to content

Commit

Permalink
Use default load function for chart plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Feb 11, 2018
1 parent 67e911b commit ff84aa4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default Backbone.View.extend({
this.chart = new Chart({}, options);
this.chart.plugin = options.visualization_plugin;
this.chart.plugin.specs = this.chart.plugin.specs || {};
this.chart_func = options.chart_func;
this.chart_load = options.chart_load;
this.deferred = new Deferred();
this.viewer = new Viewer(this);
this.editor = new Editor(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ export default Backbone.View.extend({
var n_panels = chart.settings.get("__use_panels") == "true" ? chart.groups.length : 1;
this._createContainer(chart.plugin.specs.tag, n_panels);
chart.state("wait", "Please wait...");
this.app.chart_func({ process: process, chart: chart, dataset: this.app.dataset, targets: this.targets });
this.app.chart_load({ process: process, chart: chart, dataset: this.app.dataset, targets: this.targets });
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
<script type="text/javascript">
$(function() {
var config = ${h.dumps(config)};
var func = "${script_attributes.get("func")}";
if (!bundleEntries[func]) {
alert("Entry function '" + func + "' not found.");
var load = "${script_attributes.get("load")}";
if (!bundleEntries[load]) {
alert("Load function '" + load + "' not found.");
}
var app = bundleEntries.chart({
visualization_id: ${h.dumps(visualization_id)} || undefined,
visualization_name: ${h.dumps(visualization_name)},
visualization_plugin: ${h.dumps(visualization_plugin)},
dataset_id: config.dataset_id,
chart_dict: config.chart_dict,
chart_func: bundleEntries[func]
chart_load: bundleEntries[load]
});
$('body').append(app.$el);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<params>
<param type="dataset" var_name_in_template="hda" required="true">dataset_id</param>
</params>
<entry_point entry_point_type="chart" src="static/script.js" func="func"/>
<entry_point entry_point_type="chart" src="static/script.js"/>
<settings>
<input>
<label>Curve style</label>
Expand Down
2 changes: 1 addition & 1 deletion config/plugins/visualizations/cytoscape/src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function run_traversal_type( cytoscape, root_id, type ) {
};

_.extend(window.bundleEntries || {}, {
func: function(options) {
load: function(options) {
var self = this,
chart = options.chart,
dataset = options.dataset,
Expand Down
2 changes: 1 addition & 1 deletion config/plugins/visualizations/drawrna/src/script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DrawRNA from "./drawrnajs/drawrna";
_.extend(window.bundleEntries || {}, {
func: function(options) {
load: function(options) {
var chart = options.chart;
var dataset = options.dataset;
$.ajax({
Expand Down
4 changes: 4 additions & 0 deletions static/style/blue/base.css

Large diffs are not rendered by default.

0 comments on commit ff84aa4

Please sign in to comment.