X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=public%2Ffacet_graph.js;h=21b8dd97a70afa8762f807c005e3187492f820cc;hb=53588a28617774a7323799597186209704068dec;hp=e20a4fca9e6b7dc3eaa03ce73b420374b524650c;hpb=99b603941787f3017c3002bc3ff550e0839b2afa;p=MojoFacets.git diff --git a/public/facet_graph.js b/public/facet_graph.js index e20a4fc..21b8dd9 100644 --- a/public/facet_graph.js +++ b/public/facet_graph.js @@ -1,3 +1,12 @@ +$(document).ready( function() { + +var count = parseInt( $('#facet-count').text() ); +if ( count > 5000 ) { + console.debug( 'skip graph', count ); + return; +} +console.debug( 'drawing graph', count ); + var data = { x: { min: Number.MAX_VALUE, @@ -90,7 +99,7 @@ while( i_float < elements ) { data.x.px.push( x ); } else { var x_px = i * data.x.inc_bar; - console.debug( x_px, y ); +// console.debug( x_px, y ); ctx.fillRect( x_px, 0, data.x.inc_bar, -y ); ctx.strokeRect( x_px, 0, data.x.inc_bar, -y ); } @@ -129,3 +138,4 @@ draw_labels( 'labels-y', data.y, data.height, 'bottom', 'bottom:'+data.height+'p console.debug( 'data', data ); +}); // document.ready