diff --git a/config/plugins/visualizations/scatterplot/Gruntfile.js b/config/plugins/visualizations/scatterplot/Gruntfile.js
index c75a16404bd..821ca92c70e 100644
--- a/config/plugins/visualizations/scatterplot/Gruntfile.js
+++ b/config/plugins/visualizations/scatterplot/Gruntfile.js
@@ -5,29 +5,13 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
- handlebars: {
- // compile all hb templates into a single file in the build dir
- compile: {
- options: {
- namespace: 'scatterplot',
- processName : function( filepath ){
- return filepath.match( /\w*\.handlebars/ )[0].replace( '.handlebars', '' );
- }
- },
- files: {
- "build/compiled-templates.js" : "src/handlebars/*.handlebars"
- }
- }
- },
-
concat: {
- // concat the template file and any js files in the src dir into a single file in the build dir
+ // concat any js files in the src dir into a single file in the build dir
options: {
separator: ';\n'
},
dist: {
- //NOTE: mvc references templates - templates must be cat'd first
- src : [ 'build/compiled-templates.js', 'src/**/*.js' ],
+ src : [ 'src/**/*.js' ],
dest: 'build/scatterplot-concat.js'
}
},
@@ -47,17 +31,16 @@ module.exports = function(grunt) {
watch: {
// watch for changes in the src dir
- files: [ 'src/**.js', 'src/handlebars/*.handlebars' ],
+ files: [ 'src/**.js' ],
tasks: [ 'default' ]
}
});
- grunt.loadNpmTasks( 'grunt-contrib-handlebars' );
grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
- grunt.registerTask( 'default', [ 'handlebars', 'concat', 'uglify' ]);
+ grunt.registerTask( 'default', [ 'concat', 'uglify' ]);
// you can run grunt watch directly:
// grunt watch
};
diff --git a/config/plugins/visualizations/scatterplot/package.json b/config/plugins/visualizations/scatterplot/package.json
index c70e2d502a3..1adcb96d4d0 100644
--- a/config/plugins/visualizations/scatterplot/package.json
+++ b/config/plugins/visualizations/scatterplot/package.json
@@ -17,7 +17,6 @@
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-contrib-concat": "~0.3.0",
- "grunt-contrib-handlebars": "^0.9.3",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-watch": "~0.5.3"
}
diff --git a/config/plugins/visualizations/scatterplot/src/handlebars/chartcontrol.handlebars b/config/plugins/visualizations/scatterplot/src/handlebars/chartcontrol.handlebars
deleted file mode 100644
index d5964ba1c42..00000000000
--- a/config/plugins/visualizations/scatterplot/src/handlebars/chartcontrol.handlebars
+++ /dev/null
@@ -1,47 +0,0 @@
-
- Use the following controls to how the chart is displayed.
- The slide controls can be moved by the mouse or, if the 'handle' is in focus, your keyboard's arrow keys.
- Move the focus between controls by using the tab or shift+tab keys on your keyboard.
- Use the 'Draw' button to render (or re-render) the chart with the current settings.
-
-
-
-
-
{{datapointSize}}
-
-
- Size of the graphic representation of each data point
-
- Use the following control to change which columns are used by the chart. Click any cell
- from the last three rows of the table to select the column for the appropriate data.
- Use the 'Draw' button to render (or re-render) the chart with the current settings.
-
-
-
-
X Column: which column values will be used for the x axis of the chart.
-
Y Column: which column values will be used for the y axis of the chart.
-
ID Column: an additional column value displayed when the user hovers over a data point.
- It may be useful to select unique or categorical identifiers here (such as gene ids).
-
-
-
-
-
{{{ peek }}}
-
-
-
- Note: If it can be determined from the dataset's filetype that a column is not numeric,
- that column choice may be disabled for either the x or y axis.
-
-
- {{! data form, chart config form, chart all get their own tab }}
-
- {{! ---------------------------- tab for data settings form }}
-
- {{! rendered separately }}
-
-
- {{! ---------------------------- tab for chart graphics control form }}
-
- {{! rendered separately }}
-
-
- {{! ---------------------------- tab for actual chart }}
-
-
-
{{! end .tab-content }}
-
{{! end .chart-control }}
diff --git a/config/plugins/visualizations/scatterplot/src/scatterplot-config-editor.js b/config/plugins/visualizations/scatterplot/src/scatterplot-config-editor.js
index e0ccad78886..19d743d78e1 100644
--- a/config/plugins/visualizations/scatterplot/src/scatterplot-config-editor.js
+++ b/config/plugins/visualizations/scatterplot/src/scatterplot-config-editor.js
@@ -18,7 +18,7 @@ todo:
Drag & Drop other splots onto current (redraw with new axis and differentiate the datasets)
Remove 'chart' namessave
Somehow link out from info box?
-
+
Subclass on specific datatypes? (vcf, cuffdiff, etc.)
What can be common/useful to other visualizations?
@@ -33,7 +33,7 @@ var ScatterplotConfigEditor = Backbone.View.extend({
//TODO: !should be a view on a visualization model
//logger : console,
className : 'scatterplot-control-form',
-
+
/** initialize requires a configuration Object containing a dataset Object */
initialize : function( attributes ){
if( !this.model ){
@@ -139,7 +139,7 @@ var ScatterplotConfigEditor = Backbone.View.extend({
$dataControl.find( '[title]' ).tooltip();
return $dataControl;
},
-
+
/** tab content to control how the chart is rendered (data glyph size, chart size, etc.) */
_render_chartControls : function( $where ){
//TODO: as controls on actual chart
@@ -147,7 +147,7 @@ var ScatterplotConfigEditor = Backbone.View.extend({
var editor = this,
config = this.model.get( 'config' ),
$chartControls = $where.find( '#chart-control' );
-
+
// ---- skeleton/form for controls
$chartControls.html( ScatterplotConfigEditor.templates.chartControl( config ) );
//console.debug( '$chartControl:', $chartControls );
@@ -258,9 +258,130 @@ var ScatterplotConfigEditor = Backbone.View.extend({
});
ScatterplotConfigEditor.templates = {
- mainLayout : scatterplot.editor,
- dataControl : scatterplot.datacontrol,
- chartControl : scatterplot.chartcontrol
+ // tabbed, main layout for the editor (not used for scatterplot-display)
+ mainLayout : _.template([
+ '
',
+ // tab buttons/headers using Bootstrap
+ '
',
+ // start with the data controls as the displayed tab
+ '
',
+ // button for saving the visualization config on the server
+ '
',
+ '',
+ '
',
+ '
',
+
+ // data form, chart config form, chart all get their own tab
+ '
',
+ // tab for data settings form
+ '',
+
+ // tab for chart graphics control form
+ '',
+
+ // tab for actual chart
+ '',
+
+ '
',
+ '
',
+ ].join('')),
+
+ // the controls for data selection (this is mostly done with column selector now)
+ // TODO: this could be moved to the main template above
+ // TODO: localize
+ dataControl : _.template([
+ '
',
+ 'Use the following control to change which columns are used by the chart. Click any cell ',
+ 'from the last three rows of the table to select the column for the appropriate data. ',
+ 'Use the \'Draw\' button to render (or re-render) the chart with the current settings. ',
+ '
',
+
+ '
',
+ '
X Column: which column values will be used for the x axis of the chart.
',
+ '
Y Column: which column values will be used for the y axis of the chart.
',
+ '
ID Column: an additional column value displayed when the user hovers over a data point. ',
+ 'It may be useful to select unique or categorical identifiers here (such as gene ids).',
+ '
',
+ '
',
+
+ '
',
+ // the only dynamic thing
+ '
<%= peek %>
',
+ '
',
+
+ '
',
+ 'Note: If it can be determined from the dataset\'s filetype that a column is not numeric, ',
+ 'that column choice may be disabled for either the x or y axis.',
+ '
',
+ 'Use the following controls to how the chart is displayed. The slide controls can be moved ',
+ 'by the mouse or, if the \'handle\' is in focus, your keyboard\'s arrow keys. ',
+ 'Move the focus between controls by using the tab or shift+tab keys on your keyboard. ',
+ 'Use the \'Draw\' button to render (or re-render) the chart with the current settings. ',
+ '
',
+
+ '
',
+ '',
+ '
<%- datapointSize %>
',
+ '',
+ '
',
+ 'Size of the graphic representation of each data point',
+ '
',
+ '
',
+
+ '
',
+ '',
+ '
<%- width %>
',
+ '',
+ '
',
+ '(not including chart margins and axes)',
+ '
',
+ '
',
+
+ '
',
+ '',
+ '
<%- height %>
',
+ '',
+ '
',
+ '(not including chart margins and axes)',
+ '
\n Use the following controls to how the chart is displayed.\n The slide controls can be moved by the mouse or, if the \'handle\' is in focus, your keyboard\'s arrow keys.\n Move the focus between controls by using the tab or shift+tab keys on your keyboard.\n Use the \'Draw\' button to render (or re-render) the chart with the current settings.\n
\n Use the following control to change which columns are used by the chart. Click any cell\n from the last three rows of the table to select the column for the appropriate data.\n Use the \'Draw\' button to render (or re-render) the chart with the current settings.\n
\n\n
\n
X Column: which column values will be used for the x axis of the chart.
\n
Y Column: which column values will be used for the y axis of the chart.
\n
ID Column: an additional column value displayed when the user hovers over a data point.\n It may be useful to select unique or categorical identifiers here (such as gene ids).\n
\n Note: If it can be determined from the dataset\'s filetype that a column is not numeric,\n that column choice may be disabled for either the x or y axis.\n
',"Use the following control to change which columns are used by the chart. Click any cell ","from the last three rows of the table to select the column for the appropriate data. ","Use the 'Draw' button to render (or re-render) the chart with the current settings. ","
",'
',"
X Column: which column values will be used for the x axis of the chart.
","
Y Column: which column values will be used for the y axis of the chart.
","
ID Column: an additional column value displayed when the user hovers over a data point. ","It may be useful to select unique or categorical identifiers here (such as gene ids).","
","
",'
','
<%= peek %>
',"
",'
',"Note: If it can be determined from the dataset's filetype that a column is not numeric, ","that column choice may be disabled for either the x or y axis.","
",''].join("")),chartControl:_.template(['
',"Use the following controls to how the chart is displayed. The slide controls can be moved ","by the mouse or, if the 'handle' is in focus, your keyboard's arrow keys. ","Move the focus between controls by using the tab or shift+tab keys on your keyboard. ","Use the 'Draw' button to render (or re-render) the chart with the current settings. ","
",'
','','
<%- datapointSize %>
','','
',"Size of the graphic representation of each data point","
"].join(""))}));d.empty().append(g)},toggleStats:function(a){var b=this.$el.find(".stats-display");a=void 0===a?b.is(":hidden"):a,a?(this.$el.find("svg").hide(),b.show(),this.$el.find(".controls .stats-toggle-btn").text("Plot")):(b.hide(),this.$el.find("svg").show(),this.$el.find(".controls .stats-toggle-btn").text("Stats"))},toString:function(){return"ScatterplotView()"}}),ScatterplotModel=Visualization.extend({defaults:{type:"scatterplot",config:{pagination:{currPage:0,perPage:3e3},width:400,height:400,margin:{top:16,right:16,bottom:40,left:54},xTicks:10,xLabel:"X",yTicks:10,yLabel:"Y",datapointSize:4,animDuration:500,scale:1,translate:[0,0]}}});
\ No newline at end of file