commit/galaxy-central: carlfeberhard: scatterplot.js: minor changes; data_providers/basic.py: ensure numeric stats only on numeric columns;
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/60757a1ab164/ changeset: 60757a1ab164 user: carlfeberhard date: 2012-10-11 16:24:43 summary: scatterplot.js: minor changes; data_providers/basic.py: ensure numeric stats only on numeric columns; affected #: 5 files diff -r 3b9db9c4206602859dee02164aa32a925138866e -r 60757a1ab16476d3fc19b21bc1fb9bd42f567cf3 lib/galaxy/visualization/data_providers/basic.py --- a/lib/galaxy/visualization/data_providers/basic.py +++ b/lib/galaxy/visualization/data_providers/basic.py @@ -163,16 +163,19 @@ f.close() for index, meta in enumerate( response[ 'meta' ] ): - count = meta[ 'count' ] - meta[ 'mean' ] = float( meta[ 'sum' ] ) / count + column_type = column_types[ index ] - sorted_data = sorted( response[ 'data' ][ index ] ) - # even data count - - middle_index = count / 2 - 1 - if count % 2 == 0: - meta[ 'median' ] = sum( sorted_data[ middle_index : ( middle_index + 1 ) ] ) / 2.0 + if( column_type == 'float' or column_type == 'int' ): + count = meta[ 'count' ] + meta[ 'mean' ] = float( meta[ 'sum' ] ) / count - else: - meta[ 'median' ] = sorted_data[ middle_index ] + sorted_data = sorted( response[ 'data' ][ index ] ) + # even data count - + middle_index = count / 2 - 1 + if count % 2 == 0: + meta[ 'median' ] = sum( sorted_data[ middle_index : ( middle_index + 1 ) ] ) / 2.0 + + else: + meta[ 'median' ] = sorted_data[ middle_index ] return response diff -r 3b9db9c4206602859dee02164aa32a925138866e -r 60757a1ab16476d3fc19b21bc1fb9bd42f567cf3 static/scripts/templates/compiled/template-visualization-chartSettings.js --- a/static/scripts/templates/compiled/template-visualization-chartSettings.js +++ b/static/scripts/templates/compiled/template-visualization-chartSettings.js @@ -13,7 +13,7 @@ foundHelper = helpers.maxDataPoints; if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); } else { stack1 = depth0.maxDataPoints; stack1 = typeof stack1 === functionType ? stack1() : stack1; } - buffer += escapeExpression(stack1) + "</div>\n <div class=\"slider\"></div>\n <p class=\"form-help help-text-small\">\n Change the maximum number of data points displayable on this graph (higher values will\n load significantly slower)\n </p>\n </div>\n\n <div id=\"datapointSize\" class=\"form-input numeric-slider-input\">\n <label for=\"datapointSize\">Size of data point: </label>\n <div class=\"slider-output\">"; + buffer += escapeExpression(stack1) + "</div>\n <div style=\"clear: both;\"></div>\n <div class=\"slider\"></div>\n <p class=\"form-help help-text-small\">\n Change the maximum number of data points displayable on this graph (higher values will\n load significantly slower)\n </p>\n </div>\n\n <div id=\"datapointSize\" class=\"form-input numeric-slider-input\">\n <label for=\"datapointSize\">Size of data point: </label>\n <div class=\"slider-output\">"; foundHelper = helpers.datapointSize; if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); } else { stack1 = depth0.datapointSize; stack1 = typeof stack1 === functionType ? stack1() : stack1; } diff -r 3b9db9c4206602859dee02164aa32a925138866e -r 60757a1ab16476d3fc19b21bc1fb9bd42f567cf3 static/scripts/templates/visualization-templates.html --- a/static/scripts/templates/visualization-templates.html +++ b/static/scripts/templates/visualization-templates.html @@ -97,6 +97,7 @@ <div id="maxDataPoints" class="form-input numeric-slider-input"><label for="maxDataPoints">Maximum data points allowed on graph: </label><div class="slider-output">{{maxDataPoints}}</div> + <div style="clear: both;"></div><div class="slider"></div><p class="form-help help-text-small"> Change the maximum number of data points displayable on this graph (higher values will @@ -152,4 +153,4 @@ </div><input id="render-button" type="button" value="Draw" /> -</script> \ No newline at end of file +</script> diff -r 3b9db9c4206602859dee02164aa32a925138866e -r 60757a1ab16476d3fc19b21bc1fb9bd42f567cf3 static/scripts/viz/scatterplot.js --- a/static/scripts/viz/scatterplot.js +++ b/static/scripts/viz/scatterplot.js @@ -1,6 +1,4 @@ define([ - //"../libs/jquery/jquery", - "../libs/underscore", "../mvc/base-mvc", "../templates/compiled/template-visualization-scatterplotControlForm", @@ -13,8 +11,6 @@ "../libs/jquery/jquery-ui-1.8.23.custom.min" ], function(){ - - /* ============================================================================= todo: outside this: @@ -54,6 +50,9 @@ how to know what sort of Tabular the data is? smarter about headers validate columns selection (here or server) + + set stats column names by selected columns + move chart into tabbed area... Scatterplot.mako: multiple plots on one page (small multiples) @@ -103,8 +102,8 @@ yNumTicks : 10, xAxisLabelBumpY : 40, yAxisLabelBumpX : -35, - width : 500, - height : 500, + width : 320, + height : 320, //TODO: anyway to make this a sub-obj? marginTop : 50, marginRight : 50, @@ -456,16 +455,10 @@ */ var ScatterplotControlForm = BaseView.extend( LoggableMixin ).extend({ //logger : console, - tagName : 'form', className : 'scatterplot-settings-form', loadingIndicatorImage : 'loading_large_white_bg.gif', - events : { - 'click #render-button' : 'renderPlot', - 'click #include-id-checkbox' : 'toggleThirdColumnSelector' - }, - initialize : function( attributes ){ if( !attributes || !attributes.dataset ){ @@ -571,6 +564,11 @@ return $chartSettingsPanel; }, + events : { + 'click #render-button' : 'renderPlot', + 'click #include-id-checkbox' : 'toggleThirdColumnSelector' + }, + toggleThirdColumnSelector : function(){ this.$el.find( 'select[name="ID"]' ).parent().toggle(); }, @@ -709,4 +707,4 @@ return { TwoVarScatterplot : TwoVarScatterplot, ScatterplotControlForm : ScatterplotControlForm -};}); \ No newline at end of file +};}); diff -r 3b9db9c4206602859dee02164aa32a925138866e -r 60757a1ab16476d3fc19b21bc1fb9bd42f567cf3 templates/visualization/scatterplot.mako --- a/templates/visualization/scatterplot.mako +++ b/templates/visualization/scatterplot.mako @@ -20,11 +20,11 @@ .left-column { float: left; - width: 30%; + width: 40%; } .right-column { - margin-left: 32%; + margin-left: 41%; } div.tab-pane { Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket