Personal tools

User:Hisa: Difference between revisions

From FANTOM5_SSTAR

Jump to: navigation, search
No edit summary
No edit summary
Line 11: Line 11:
     <h1>Flot Examples</h1>
     <h1>Flot Examples</h1>


     <div id="placeholder" style="width:600px;height:300px;"></div>
     <div id="charthg19" style="width:600px;height:300px;"></div>
     Sample of clicked point: <span id="clickdata"></span>
     Sample of clicked point: <span id="samplehg19"></span>
     <div id="choices">Show:</div>
     <div id="cphg19">Show:</div>




Line 52: Line 52:


     // insert checkboxes  
     // insert checkboxes  
     var choiceContainer = $("#choices");
     var choiceContainer = $("#cphg19");
     $.each(datasets, function(key, val) {
     $.each(datasets, function(key, val) {
         choiceContainer.append('<br/><input type="checkbox" name="' + key +
         choiceContainer.append('<br/><input type="checkbox" name="' + key +
Line 59: Line 59:
                                 + val.label + '">' + val.label + '</label>');
                                 + val.label + '">' + val.label + '</label>');
     });
     });
     choiceContainer.find("input").click(plotAccordingToChoices);
     choiceContainer.find("input").click(plotAccordingTocphg19);




     function plotAccordingToChoices() {
     function plotAccordingTocphg19() {
         var data = [];
         var data = [];


Line 75: Line 75:


         if (data.length > 0)
         if (data.length > 0)
             $.plot($("#placeholder"), data, {
             $.plot($("#charthg19"), data, {
                 yaxis: { min: 0 },
                 yaxis: { min: 0 },
                 xaxis: { tickDecimals: 0, show: false },
                 xaxis: { tickDecimals: 0, show: false },
Line 84: Line 84:
     }
     }


     plotAccordingToChoices();
     plotAccordingTocphg19();


     function showTooltip(x, y, contents) {
     function showTooltip(x, y, contents) {
Line 101: Line 101:


     var previousPoint = null;
     var previousPoint = null;
     $("#placeholder").bind("plothover", function (event, pos, item) {
     $("#charthg19").bind("plothover", function (event, pos, item) {
         $("#x").text(pos.x.toFixed(2));
         $("#x").text(pos.x.toFixed(2));
         $("#y").text(pos.y.toFixed(2));
         $("#y").text(pos.y.toFixed(2));
Line 125: Line 125:
     });
     });


     $("#placeholder").bind("plotclick", function (event, pos, item) {
     $("#charthg19").bind("plotclick", function (event, pos, item) {
         if (item) {
         if (item) {
             $smpl = series[item.datapoint[0].toFixed(0)];
             $smpl = series[item.datapoint[0].toFixed(0)];
             $("#clickdata").html('<a href="/resource_browser/index.php/FF:' + $smpl.split(".").pop() + '">' + $smpl +'</a>');
             $("#samplehg19").html('<a href="/resource_browser/index.php/FF:' + $smpl.split(".").pop() + '">' + $smpl +'</a>');
 
         }
         }
     });
     });

Revision as of 12:54, 12 March 2012

motif without matrices Swissregulon:SRY.p1 Swissregulon:HOX(A,B,D)3.p1


Flot Examples

Sample of clicked point:

Show: