projects
/
MojoFacets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't generate zero for null values
[MojoFacets.git]
/
public
/
facet_graph.js
diff --git
a/public/facet_graph.js
b/public/facet_graph.js
index
e20a4fc
..
21b8dd9
100644
(file)
--- 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,
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;
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 );
}
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 );
console.debug( 'data', data );
+}); // document.ready