vis_files/init.js
/// Based on the plots on visjson, this constructs the menus on the left hand edge
Based on the plots on visjson, this constructs the menus on the left hand edge
Based on the plots on visjson this constructs the menus on the left hand edge
function menu_structure()
{
	addtab("Model",""); addtab("Data",""); addtab("Parameters",""); addtab("Prior","");
	for(i = 0; i < visjson.plots.length; i++){
		var vis = visjson.plots[i];
		tab = vis.tab; tab2 = vis.tab2; tab3 = vis.tab3; tab4 = vis.tab4;
		var j = 0; while(j < tree.length && tab != tree[j].name) j++;
		if(j == tree.length){
			tree.push({ name:tab, child:[]});
		}
		var j2 = 0; while(j2 < tree[j].child.length && tab2 != tree[j].child[j2].name) j2++;
		if(j2 == tree[j].child.length){
			tree[j].child.push({ name:tab2, child:[]});
		}
		var j3 = 0; while(j3 < tree[j].child[j2].child.length && tab3 != tree[j].child[j2].child[j3].name) j3++;
		if(j3 == tree[j].child[j2].child.length){
			tree[j].child[j2].child.push({ name:tab3, child:[], frac:0, y:0});
		}
		var j4 = 0; while(j4 < tree[j].child[j2].child[j3].child.length && tab4 != tree[j].child[j2].child[j3].child[j4].name) j4++;
		if(j4 == tree[j].child[j2].child[j3].child.length){
			tree[j].child[j2].child[j3].child.push({ name:tab4, plot:i});
		}
		else{
			pr(tab+" "+tab2+" "+tab3+" "+tab4+" tab");
			alertp("Menu Problem");
		}
	}
	for(i = 0; i < tree.length; i++){ 
		pagesub[i] = 0; pagesubsub[i]=[]; pagesubsubsub[i]=[]; 
		for(j = 0; j < tree[i].child.length; j++){
			pagesubsub[i][j] = 0; pagesubsubsub[i][j]=[]; 
			for(j2 = 0; j2 < tree[i].child[j].child.length; j2++){
				pagesubsubsub[i][j][j2] = 0;
				tree[i].child[j].child[j2].frac = submax/tree[i].child[j].child[j2].child.length;
			}
		}
	}
}
function menu_structure ( ) { addtab ( "Model" , "" ) ; addtab ( "Data" , "" ) ; addtab ( "Parameters" , "" ) ; addtab ( "Prior" , "" ) ; for ( i = 0 ; i < visjson . plots . length ; i ++ ) { var vis = visjson . plots [ i ] ; tab = vis . tab ; tab2 = vis . tab2 ; tab3 = vis . tab3 ; tab4 = vis . tab4 ; var j = 0 ; while ( j < tree . length && tab != tree [ j ] . name ) j ++ ; if ( j == tree . length ) { tree . push ( { name : tab , child : [ ] } ) ; } var j2 = 0 ; while ( j2 < tree [ j ] . child . length && tab2 != tree [ j ] . child [ j2 ] . name ) j2 ++ ; if ( j2 == tree [ j ] . child . length ) { tree [ j ] . child . push ( { name : tab2 , child : [ ] } ) ; } var j3 = 0 ; while ( j3 < tree [ j ] . child [ j2 ] . child . length && tab3 != tree [ j ] . child [ j2 ] . child [ j3 ] . name ) j3 ++ ; if ( j3 == tree [ j ] . child [ j2 ] . child . length ) { tree [ j ] . child [ j2 ] . child . push ( { name : tab3 , child : [ ] , frac : 0 , y : 0 } ) ; } var j4 = 0 ; while ( j4 < tree [ j ] . child [ j2 ] . child [ j3 ] . child . length && tab4 != tree [ j ] . child [ j2 ] . child [ j3 ] . child [ j4 ] . name ) j4 ++ ; if ( j4 == tree [ j ] . child [ j2 ] . child [ j3 ] . child . length ) { tree [ j ] . child [ j2 ] . child [ j3 ] . child . push ( { name : tab4 , plot : i } ) ; } else { pr ( tab + " " + tab2 + " " + tab3 + " " + tab4 + " tab" ) ; alertp ( "Menu Problem" ) ; } } for ( i = 0 ; i < tree . length ; i ++ ) { pagesub [ i ] = 0 ; pagesubsub [ i ] = [ ] ; pagesubsubsub [ i ] = [ ] ; for ( j = 0 ; j < tree [ i ] . child . length ; j ++ ) { pagesubsub [ i ] [ j ] = 0 ; pagesubsubsub [ i ] [ j ] = [ ] ; for ( j2 = 0 ; j2 < tree [ i ] . child [ j ] . child . length ; j2 ++ ) { pagesubsubsub [ i ] [ j ] [ j2 ] = 0 ; tree [ i ] . child [ j ] . child [ j2 ] . frac = submax / tree [ i ] . child [ j ] . child [ j2 ] . child . length ; } } } }
Based on the plots on visjson, this constructs the menus on the left hand edge
Based on the plots on visjson this constructs the menus on the left hand edge