-
Notifications
You must be signed in to change notification settings - Fork 967
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5505 from guerler/revise_charts_ui
Integration of charts into the generic visualization framework
- Loading branch information
Showing
325 changed files
with
8,919 additions
and
25,150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as _ from "libs/underscore"; | ||
import Client from "mvc/visualization/chart/chart-client"; | ||
import Datasets from "mvc/visualization/chart/utilities/datasets"; | ||
import Series from "mvc/visualization/chart/utilities/series"; | ||
import Jobs from "mvc/visualization/chart/utilities/jobs"; | ||
|
||
window.bundleEntries = window.bundleEntries || {}; | ||
|
||
export const bundleEntries = { | ||
chart: function(options) { | ||
return new Client(options); | ||
}, | ||
chartUtilities: { | ||
Datasets: Datasets, | ||
Jobs: Jobs, | ||
Series: Series | ||
} | ||
}; | ||
|
||
_.extend(window.bundleEntries, bundleEntries); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
client/galaxy/scripts/mvc/visualization/chart/chart-client.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import Deferred from "utils/deferred"; | ||
import Modal from "mvc/ui/ui-modal"; | ||
import Ui from "mvc/ui/ui-misc"; | ||
import Chart from "mvc/visualization/chart/components/model"; | ||
import Editor from "mvc/visualization/chart/views/editor"; | ||
import Viewer from "mvc/visualization/chart/views/viewer"; | ||
import Menu from "mvc/visualization/chart/views/menu"; | ||
import * as Backbone from "backbone"; | ||
|
||
/* global $ */ | ||
/* global Galaxy */ | ||
|
||
export default Backbone.View.extend({ | ||
initialize: function(options) { | ||
this.modal = (window.parent.Galaxy && window.parent.Galaxy.modal) || new Modal.View(); | ||
this.setElement( | ||
$("<div/>") | ||
.addClass("charts-client") | ||
.append($("<div/>").addClass("charts-buttons")) | ||
.append($("<div/>").addClass("charts-center")) | ||
.append($("<div/>").addClass("charts-right")) | ||
); | ||
this.$center = this.$(".charts-center"); | ||
this.$right = this.$(".charts-right"); | ||
this.$buttons = this.$(".charts-buttons"); | ||
this.chart = new Chart({}, options); | ||
this.chart.plugin = options.visualization_plugin; | ||
this.chart.plugin.specs = this.chart.plugin.specs || {}; | ||
this.chart_load = options.chart_load; | ||
this.message = new Ui.Message(); | ||
this.deferred = new Deferred(); | ||
this.viewer = new Viewer(this); | ||
this.editor = new Editor(this); | ||
this.menu = new Menu(this); | ||
this.$center.append(this.viewer.$el); | ||
this.$right.append(this.message.$el).append(this.editor.$el); | ||
this.$buttons.append(this.menu.$el); | ||
$.ajax({ | ||
url: `${Galaxy.root}api/datasets/${options.dataset_id}` | ||
}) | ||
.done(dataset => { | ||
this.dataset = dataset; | ||
this.chart.load(); | ||
this.chart.trigger("redraw"); | ||
}) | ||
.fail(response => { | ||
let message = response.responseJSON && response.responseJSON.err_msg; | ||
this.errormessage = message || "Import failed for unkown reason."; | ||
}); | ||
} | ||
}); |
Oops, something went wrong.