hive/html/js-graph/vjSVG_GenomeBrowser.js
// => add another gb viewer to the tab where the svgGenePanel is held and the rest of gb viewers
> add another gb viewer to the tab where the svgGenePanel is held and the rest of gb viewers
> add another gb viewer to the tab where the svgGenePanel is held and the rest of gb viewers
function addTrack (viewer, node,ir, ic){
        var annotListVV = viewer.relatedViewer["annotList"];
        var idArr = []; 
        var trackTitle = "";
        for (var i=0; i<annotListVV.selectedNodes.length; ++i){
            var id_ = annotListVV.selectedNodes[i].id;
            if (idArr.indexOf(id_)!=-1) continue;
            idArr.push(id_);
            trackTitle = annotListVV.selectedNodes[i].name;
        }
        var typeArr = [];
        for (var j=0; j<viewer.relatedViewer["typeList"].selectedNodes.length; ++j){
            var checkedType = viewer.relatedViewer["typeList"].selectedNodes[j].types;
            if (typeArr.indexOf(checkedType)!=-1) continue;
            typeArr.push(checkedType);
        }
        var main = vjObj[viewer.parentObjCls];
        var new_start = -1;
        var new_end = -1;
        var rangeToAdd = undefined;
        if (main.svgGene_panel) {
            var svgGene_panel = main.svgGene_panel;
            var start = svgGene_panel.tree.findByName("pos_start").value;
            new_start = start ?  start : new_start;
            var end = svgGene_panel.tree.findByName("pos_end").value;
            new_end = end ?  end : new_end;
            if (new_start!=-1 && new_end !=-1) {
                rangeToAdd += "&pos_start=" + new_start + "&pos_end=" + new_end;
            } 
        }
        if (node.isMultipleTrack) {
            for (var it=0; it<typeArr.length; ++it) {
                var cur_title = trackTitle;
                var cur_type = typeArr[it];
                var url = "http://?cmd=ionGenBankAnnotPosMap&cnt=-1&ionObjs="+ idArr[0]+"&features="+ encodeURI(cur_type)+"&seqID="+ encodeURI(main.refSeqIDList_viewer.selectedNodes[0].id);
                if (rangeToAdd!=undefined) {
                    url += rangeToAdd;
                } 
                cur_title += " [" + cur_type + "]";
                main.addTrack(cur_title, url);
                vjDS[viewer.data[1]].reload(null,true);
            }
        }
        else {
            var url = "http://?cmd=ionGenBankAnnotPosMap&cnt=-1&ionObjs="+ idArr[0]+"&features="+ encodeURI(typeArr.join(","))+"&seqID="+ encodeURI(main.refSeqIDList_viewer.selectedNodes[0].id);
            if (rangeToAdd!=undefined) {
                url += rangeToAdd;
            }
            trackTitle+= " [" + typeArr.join("|") + "]";
            main.addTrack(trackTitle, url);
            vjDS[viewer.data[1]].reload(null,true);
        }
    }
function addTrack ( viewer , node , ir , ic ) { var annotListVV = viewer . relatedViewer [ "annotList" ] ; var idArr = [ ] ; var trackTitle = "" ; for ( var i = 0 ; i < annotListVV . selectedNodes . length ; ++ i ) { var id_ = annotListVV . selectedNodes [ i ] . id ; if ( idArr . indexOf ( id_ ) != - 1 ) continue ; idArr . push ( id_ ) ; trackTitle = annotListVV . selectedNodes [ i ] . name ; } var typeArr = [ ] ; for ( var j = 0 ; j < viewer . relatedViewer [ "typeList" ] . selectedNodes . length ; ++ j ) { var checkedType = viewer . relatedViewer [ "typeList" ] . selectedNodes [ j ] . types ; if ( typeArr . indexOf ( checkedType ) != - 1 ) continue ; typeArr . push ( checkedType ) ; } var main = vjObj [ viewer . parentObjCls ] ; var new_start = - 1 ; var new_end = - 1 ; var rangeToAdd = undefined ; if ( main . svgGene_panel ) { var svgGene_panel = main . svgGene_panel ; var start = svgGene_panel . tree . findByName ( "pos_start" ) . value ; new_start = start ? start : new_start ; var end = svgGene_panel . tree . findByName ( "pos_end" ) . value ; new_end = end ? end : new_end ; if ( new_start != - 1 && new_end != - 1 ) { rangeToAdd += "&pos_start=" + new_start + "&pos_end=" + new_end ; } } if ( node . isMultipleTrack ) { for ( var it = 0 ; it < typeArr . length ; ++ it ) { var cur_title = trackTitle ; var cur_type = typeArr [ it ] ; var url = "http://?cmd=ionGenBankAnnotPosMap&cnt=-1&ionObjs=" + idArr [ 0 ] + "&features=" + encodeURI ( cur_type ) + "&seqID=" + encodeURI ( main . refSeqIDList_viewer . selectedNodes [ 0 ] . id ) ; if ( rangeToAdd != undefined ) { url += rangeToAdd ; } cur_title += " [" + cur_type + "]" ; main . addTrack ( cur_title , url ) ; vjDS [ viewer . data [ 1 ] ] . reload ( null , true ) ; } } else { var url = "http://?cmd=ionGenBankAnnotPosMap&cnt=-1&ionObjs=" + idArr [ 0 ] + "&features=" + encodeURI ( typeArr . join ( "," ) ) + "&seqID=" + encodeURI ( main . refSeqIDList_viewer . selectedNodes [ 0 ] . id ) ; if ( rangeToAdd != undefined ) { url += rangeToAdd ; } trackTitle += " [" + typeArr . join ( "|" ) + "]" ; main . addTrack ( trackTitle , url ) ; vjDS [ viewer . data [ 1 ] ] . reload ( null , true ) ; } }
> add another gb viewer to the tab where the svgGenePanel is held and the rest of gb viewers
> add another gb viewer to the tab where the svgGenePanel is held and the rest of gb viewers
//console.log("show annotation") // get the number of selected files from file list viewer // get the list of types user checked  // exchange parameters like: list of ion objects, features (=> types needed to look up) /*var url = urlExchangeParameter(viewer.relatedDataSource["boxList"].url, "ionObjs", idArr.join(","));
        url = urlExchangeParameter(viewer.relatedDataSource["boxList"].url, "features", typeArr.join(","));*/ //url = "http://?cmd=ionGenBankAnnotPosMap&cnt=-1&ionObjs=3087192&features=CDS,product,protein_id&pos_start=500&pos_end=10000&objs=3082092&mySubID=1"; //url = "http://?cmd=ionGenBankAnnotPosMap&cnt=-1&objs=3098512&mySubID=1&ionObjs=3098036&features=CDS,mat_peptide,organism,locus_tag,protein_id,strand"; //alert("Multiple Track") // clear out the type list elements // clear out the type list elements