Skip to content

Commit

Permalink
Add webpack config and bundle files
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Feb 11, 2018
1 parent 964c823 commit 778f921
Show file tree
Hide file tree
Showing 12 changed files with 15,280 additions and 0 deletions.
41 changes: 41 additions & 0 deletions config/plugins/visualizations/nvd3bar/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "galaxy-charts-plugins",
"version": "0.1.0",
"description": "Charts visualization plugin.",
"keywords": [
"galaxy",
"visualization",
"d3"
],
"repository": {
"type": "git",
"url": "https://github.com/guerler/galaxy-charts"
},
"license": "AFL-3.0",
"dependencies": {
"amdi18n-loader": "^0.2.0",
"grunt": "^0.4.5",
"grunt-bower-install-simple": "^1.1.0",
"grunt-check-modules": "^1.0.0",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-copy": "^0.5.0",
"grunt-contrib-less": "^1.1.0",
"grunt-contrib-uglify": "^0.8.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-exec": "^0.4.6",
"grunt-spritesmith": "^4.7.1",
"i18n-webpack-plugin": "^0.2.7",
"webpack": "^1.10.1",
"webpack-dev-server": "^1.7.0",
"backbone": "^1.3.3",
"bootstrap": "^3.3.7",
"cytoscape": "^2.7.10",
"jquery": "^3.1.1",
"cytoscape-edgehandles": "^2.6.0"
},
"devDependencies": {
"css-loader": "^0.24.0",
"style-loader": "^0.13.1"
}
}
131 changes: 131 additions & 0 deletions config/plugins/visualizations/nvd3bar/static/bundle.js

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

1 change: 1 addition & 0 deletions config/plugins/visualizations/nvd3bar/static/bundle.js.map

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

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions config/plugins/visualizations/nvd3bar/static/nvd3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/** This is the common wrapper for nvd3 based visualizations. */
define( [ 'utilities/tabular-utilities', 'plugin/nv.d3', 'style!css!plugin/nv.d3.css' ], function( Utilities ) {
var CommonWrapper = Backbone.View.extend({
initialize: function( options ) {
var self = this;
this.options = options;
options.render = function( canvas_id, groups ) {
return self.render( canvas_id, groups )
};
Utilities.panelHelper( options );
},
render: function( canvas_id, groups ) {
var self = this;
var chart = this.options.chart;
var type = this.options.type;
var makeConfig = this.options.makeConfig;
var d3chart = nv.models[ type ]();
nv.addGraph( function() {
try {
d3chart.xAxis.axisLabel( chart.settings.get( 'x_axis_label' ) );
d3chart.yAxis.axisLabel( chart.settings.get( 'y_axis_label' ) ).axisLabelDistance( 30 );
d3chart.options( { showControls: false } );
d3chart.showLegend && d3chart.showLegend(chart.settings.get('show_legend') == 'true');
self._makeAxes( d3chart, groups, chart.settings );
makeConfig && makeConfig( d3chart );
chart.settings.get( '__use_panels' ) === 'true' && d3chart.options( { showControls: false } );
d3chart.xAxis.showMaxMin( false );
d3chart.yAxis.showMaxMin( chart.definition.showmaxmin );
d3chart.tooltipContent( function( key, x, y, graph ) {
return '<h3>' + ( graph.point.tooltip || key ) + '</h3>';
});
if ( $( '#' + canvas_id ).length > 0 ) {
var canvas = d3.select( '#' + canvas_id );
canvas.datum( groups ).call( d3chart );
if ( chart.definition.zoomable && chart.definition.zoomable != 'native' ) {
d3chart.clipEdge && d3chart.clipEdge( true );
Utilities.addZoom({
xAxis : d3chart.xAxis,
yAxis : d3chart.yAxis,
yDomain: d3chart.yDomain,
xDomain: d3chart.xDomain,
redraw : function() { d3chart.update() },
svg : canvas
});
}
nv.utils.windowResize( d3chart.update );
}
} catch ( err ) {
chart.state( 'failed', err );
}
});
return true;
},

/** Format axes ticks */
_makeAxes: function( d3chart, groups, settings ) {
var categories = Utilities.makeCategories( groups, [ 'x', 'y' ] );
function makeTickFormat( id ) {
Utilities.makeTickFormat({
categories : categories.array[ id ],
type : settings.get( id + '_axis_type|type' ),
precision : settings.get( id + '_axis_type|precision' ),
formatter : function( formatter ) {
formatter && d3chart[ id + 'Axis' ].tickFormat( function( value ) {
return formatter( value );
});
}
});
};
makeTickFormat( 'x' );
makeTickFormat( 'y' );
}
});

return {
nvd3_bar: function(options) {
options.type = 'multiBarChart';
new CommonWrapper( options );
}
}
});

0 comments on commit 778f921

Please sign in to comment.