Display a AUXILIARYLINE module step by step

0. Download all files in this tutorial.

Download AUXILIARYLINE.zip and click *.html file(in AUXILIARYLINE.zip) to open this demo in local browser!.

1. Including AUXILIARYLINE configuration

    Example file: AUXILIARYLINE01.js

    Data structure

    Users should prepare the input data in the following format (separated by tabs).

    var AUXILIARYLINE01 = [ "AUXILIARYLINE01" , {
           startX: -100,
           startY: 0,
           endX: 100,
           endY: 0,
           AUXILIARYLINEType:"curve",
           AUXILIARYLINEControlPointX:0,
           AUXILIARYLINEControlPointY:-100,
           AUXILIARYLINELineType:"dot",
           AUXILIARYLINEDashArray:4,
           AUXILIARYLINEColor: "black",
           AUXILIARYLINEWidth: 2,
           AUXILIARYLINEMarker:true,
           AUXILIARYLINEMarkerType:"arrow",
           AUXILIARYLINEMarkerColor:"black",
           AUXILIARYLINEMarkerPosition:2,
       }];
    

2. Initialize AUXILIARYLINE configuration with data tag : AUXILIARYLINE01

    Prepare a <div> tag with “example” id to set the picture position your will draw in html, e.g.:

    NGCircos01 = new NGCircos(AUXILIARYLINE01,NGCircosGenome,{ // Initialize with "AUXILIARYLINE01" data tag

3. Source code

    When step 1 and 2 are finished, the configuration for NGCircos:

    <button class="svg-action-btn download-img" style="height: 18px;line-height: 18px;padding: 0 11px;background: #FFFFFF;border: 1px #D9D9D9 solid;border-radius: 3px;display: inline-block;font-size: 12px;outline: none;color: black">Download png ↓</button>
    <a href="javascript:(function () { var e = document.createElement('script');if (window.location.protocol === 'https:') { e.setAttribute('src', './lib/svg-crowbar.js'); } else { e.setAttribute('src', './lib/svg-crowbar.js'); } e.setAttribute('class', 'svg-crowbar'); document.body.appendChild(e); })();" style="height: 18px;line-height: 18px;padding: 0 11px;background: #FFFFFF;border: 1px #D9D9D9 solid;border-radius: 3px;display: inline-block;font-size: 12px;outline: none;color: black" >Download svg ↓</a>
    <div id="NGCircos"></div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <div id="NGCircos"></div>
                    </div>
                </div>
    <!-- Data configuration -->
    <script src="./lib/jquery.js"></script>
    <script src="./lib/d3.js"></script>
    <script src="./lib/NGCircos.js"></script>
    <script src="js/AUXILIARYLINE01.js"></script>
    <!-- Genome configuration -->
    <script>
    var NGCircosGenome = [[
      ["EGFR",1211],
      ]];
      NGCircos01 = new NGCircos(AUXILIARYLINE01, NGCircosGenome,{
      target:"NGCircos",
      svgWidth:900,
      svgHeight:600,
      svgClassName:"lollipop",
      chrPad:0.04,
      innerRadius:246,
      outerRadius:250,
      zoom:true,
      genomeFillColor:["#999999"],
      ticks:{
      display:false,
      len:5,
      color:"#000",
      textSize:10,
      textColor:"#000",
      scale:30000000,
      realLength:false,
      },
      genomeLabel:{
      display:true,
      textSize:15,
      textColor:"#000",
      dx:0.028,
      dy:"-0.55em",
      },
      genomeBorder:{
      display:true,
      borderColor:"#000",
      borderSize:0.5,
      },
      });
      NGCircos01.draw_genome(NGCircos01.genomeLength);
      NGCircos01.draw_genome(NGCircos01.genomeLength2);
    </script>
    <script src="./lib/saveSvgAsPng.js"></script>
    <script>
    
          (function(){
            var downloadImg = getEle(".download-img"),
              imgName = getEle("."+NGCircos01.svgClassName);
    
            //          imgScale = getEle(".img-scale");
    
            downloadImg.addEventListener("click",function(){
              var mySvg = getEle("."+NGCircos01.svgClassName),
                //iImgScale = parseInt(imgScale.value) || 1,
                oImgName = imgName.value || NGCircos01.svgClassName;
    
    //          saveSvgAsPng(mySvg, oImgName+".png", iImgScale);
              saveSvgAsPng(mySvg, oImgName+".png");
    
            })
    
            function getEle(obj){
              var d = document;
              return d.querySelector(obj);
            }
          })()
    </script>

4. Visualization of AUXILIARYLINE data using NG-Circos

Download svg ↓