Skip to content

Commit

Permalink
Cleanup wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Aug 19, 2016
1 parent a78a398 commit 9f4fc82
Show file tree
Hide file tree
Showing 13 changed files with 196 additions and 314 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
// dependencies
define(['plugin/charts/nvd3/common/wrapper'], function(NVD3) {

// widget
return Backbone.Model.extend({
initialize: function(app, options) {
options.type = 'multiBarChart';
new NVD3(app, options);
}
});

define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) {
return Backbone.Model.extend({
initialize: function( app, options ) {
options.type = 'multiBarChart';
new NVD3( app, options );
}
});
});
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
// dependencies
define(['plugin/charts/nvd3/common/wrapper'], function(NVD3) {

// widget
return Backbone.Model.extend({
initialize: function(app, options) {
options.type = 'multiBarHorizontalChart';
new NVD3(app, options);
}
});

define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) {
return Backbone.Model.extend({
initialize: function( app, options ) {
options.type = 'multiBarHorizontalChart';
new NVD3( app, options );
}
});
});
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
// dependencies
define(['plugin/charts/nvd3/common/wrapper'], function(NVD3) {

// widget
return Backbone.Model.extend({
initialize: function(app, options) {
options.type = 'multiBarHorizontalChart';
options.makeConfig = function(nvd3_model) {
nvd3_model.stacked(true);
};
new NVD3(app, options);
}
});

define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) {
return Backbone.Model.extend({
initialize: function( app, options ) {
options.type = 'multiBarHorizontalChart';
options.makeConfig = function( nvd3_model ) {
nvd3_model.stacked( true );
};
new NVD3( app, options );
}
});
});
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
// dependencies
define(['plugin/charts/nvd3/common/wrapper'], function(NVD3) {

// widget
return Backbone.Model.extend({
initialize: function(app, options) {
options.type = 'multiBarChart';
options.makeConfig = function(nvd3_model) {
nvd3_model.stacked(true);
};
new NVD3(app, options);
}
});

define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) {
return Backbone.Model.extend({
initialize: function( app, options ) {
options.type = 'multiBarChart';
options.makeConfig = function( nvd3_model ) {
nvd3_model.stacked( true );
};
new NVD3( app, options );
}
});
});
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
// dependencies
define(['plugin/charts/nvd3/common/wrapper'], function(NVD3) {

// widget
return Backbone.Model.extend({
initialize: function(app, options) {
// link request
var request_dictionary = options.request_dictionary;

// configure request
var index = 1;
for (var i in request_dictionary.groups) {
var group = request_dictionary.groups[i];
group.columns = {
x: {
index : 0,
is_numeric : true
},
y: {
index : index++
define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) {
return Backbone.Model.extend({
initialize: function( app, options ) {
var request_dictionary = options.request_dictionary;
var index = 1;
for ( var i in request_dictionary.groups ) {
var group = request_dictionary.groups[ i ];
group.columns = {
x: {
index : 0,
is_numeric : true
},
y: {
index : index++
}
}
}
options.type = 'multiBarChart';
options.makeConfig = function( nvd3_model ) {
nvd3_model.options( { showControls: true } );
};
new NVD3( app, options );
}

// setup chart wrapper
options.type = 'multiBarChart';
options.makeConfig = function(nvd3_model) {
nvd3_model.options({showControls: true});
};
new NVD3(app, options);
}
});

});
});
Original file line number Diff line number Diff line change
@@ -1,44 +1,30 @@
// dependencies
define(['plugin/charts/nvd3/common/wrapper'], function(NVD3) {

// widget
return Backbone.Model.extend({
initialize: function(app, options) {
// link request
var request_dictionary = options.request_dictionary;

// configure request
var index = 1;
var tmp_dict = {
id : request_dictionary.id,
groups : []
};

// configure groups
for (var group_index in request_dictionary.groups) {
var group = request_dictionary.groups[group_index];
tmp_dict.groups.push({
key : group.key,
columns : {
x: {
index : 0,
is_label : true
},
y: {
index : index++
define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) {
return Backbone.Model.extend({
initialize: function( app, options ) {
var request_dictionary = options.request_dictionary;
var index = 1;
var tmp_dict = { id : request_dictionary.id, groups : [] };
for ( var group_index in request_dictionary.groups ) {
var group = request_dictionary.groups[ group_index ];
tmp_dict.groups.push({
key : group.key,
columns : {
x: {
index : 0,
is_label : true
},
y: {
index : index++
}
}
}
});
});
}
options.type = 'multiBarChart';
options.request_dictionary = tmp_dict;
options.makeConfig = function( nvd3_model ) {
nvd3_model.options( { showControls: true } );
};
new NVD3( app, options );
}

// setup chart wrapper
options.type = 'multiBarChart';
options.request_dictionary = tmp_dict;
options.makeConfig = function(nvd3_model) {
nvd3_model.options({showControls: true});
};
new NVD3(app, options);
}
});

});
});
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
// dependencies
define(['plugin/charts/nvd3/common/wrapper'], function(NVD3) {

// widget
return Backbone.Model.extend({
initialize: function(app, options) {
options.type = 'lineChart';
new NVD3(app, options);
}
});

define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) {
return Backbone.Model.extend({
initialize: function( app, options ) {
options.type = 'lineChart';
new NVD3( app, options );
}
});
});
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
// dependencies
define(['plugin/charts/nvd3/common/wrapper'], function(NVD3) {

// widget
return Backbone.Model.extend({
initialize: function(app, options) {
options.type = 'lineWithFocusChart';
new NVD3(app, options);
}
});

define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) {
return Backbone.Model.extend({
initialize: function( app, options ) {
options.type = 'lineWithFocusChart';
new NVD3( app, options );
}
});
});
Loading

0 comments on commit 9f4fc82

Please sign in to comment.