Skip to content

Commit

Permalink
Merge pull request #6047 from guerler/fix_charts
Browse files Browse the repository at this point in the history
[18.05] Fix and repack chart tool-based visualizations
  • Loading branch information
martenson committed May 3, 2018
2 parents 618de01 + e11da5f commit ba6c3e6
Show file tree
Hide file tree
Showing 8 changed files with 515 additions and 493 deletions.
@@ -1,4 +1,5 @@
import * as _ from "underscore";
import * as d3 from "d3";

// TODO: This d3 must(?) just be global because various charts use different
// versions, and we want to use whichever one that is. I think. I hope.
Expand Down
Expand Up @@ -9,7 +9,6 @@ var Series = window.bundleEntries.chartUtilities.Series;
var Datasets = window.bundleEntries.chartUtilities.Datasets;
var Jobs = window.bundleEntries.chartUtilities.Jobs;

window.d3 = d3;
var CommonWrapper = Backbone.View.extend({
optionsDefault: {
margin: {
Expand Down Expand Up @@ -495,8 +494,7 @@ _.extend(window.bundleEntries || {}, {
options.dataset_id = dataset.id;
options.dataset_groups = dataset_groups;
options.render = function(canvas_id, groups) {
/* Where does HeatMap come from? It isn't in any local scope here. */
new HeatMap({
new CommonWrapper({
chart: options.chart,
canvas_id: canvas_id,
groups: groups
Expand Down

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions config/plugins/visualizations/jqplot/jqplot_bar/src/script.js
@@ -1,7 +1,8 @@
import * as d3 from "d3";
import * as d3 from 'd3';
import jqplot from 'jqplot-exported/jqplot';
import { LineRenderer } from 'jqplot-exported/LineRenderer';
import { BarRenderer } from 'jqplot-exported/plugins/BarRenderer';
import { OHLCRenderer } from 'jqplot-exported/plugins/OHLCRenderer';
import { EnhancedLegendRenderer } from 'jqplot-exported/plugins/EnhancedLegendRenderer';

var Series = window.bundleEntries.chartUtilities.Series;
Expand Down Expand Up @@ -230,17 +231,17 @@ _.extend(window.bundleEntries || {}, {
key : group.get( 'key' )
});
});
var plot = new Plot( {
var plot = new CommonWrapper( {
process : options.process,
chart : options.chart,
dataset_id : dataset.id,
dataset_groups : dataset_groups,
targets : options.targets,
makeConfig : function( groups, plot_config ){
var boundary = Utilities.getDomains( groups, 'x' );
var boundary = Series.getDomains( groups, 'x' );
$.extend( true, plot_config, {
seriesDefaults: {
renderer: $.jqplot.OHLCRenderer,
renderer: OHLCRenderer,
rendererOptions : {
candleStick : true,
fillUpBody : true,
Expand All @@ -264,7 +265,7 @@ _.extend(window.bundleEntries || {}, {
for ( var group_index in groups ) {
x_labels.push( groups[ group_index ].key );
}
Utilities.mapCategories ( groups, x_labels );
Series.mapCategories ( groups, x_labels );
return {
array: {
x : x_labels
Expand Down Expand Up @@ -332,11 +333,11 @@ _.extend(window.bundleEntries || {}, {
options.dataset_groups = dataset_groups;
options.makeConfig = function( groups, plot_config ){
$.extend( true, plot_config, {
seriesDefaults: { renderer: $.jqplot.BarRenderer },
seriesDefaults: { renderer: BarRenderer },
axes: { xaxis: { min : -1 }, yaxis: { pad : 1.2 } }
});
};
new Plot( options );
new CommonWrapper( options );
});
},
jqplot_line: function(options) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ba6c3e6

Please sign in to comment.