User:Hisa: Difference between revisions
From FANTOM5_SSTAR
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
<h1>Flot Examples</h1> | <h1>Flot Examples</h1> | ||
<div id=" | <div id="charthg19" style="width:600px;height:300px;"></div> | ||
Sample of clicked point: <span id=" | Sample of clicked point: <span id="samplehg19"></span> | ||
<div id=" | <div id="cphg19">Show:</div> | ||
Line 52: | Line 52: | ||
// insert checkboxes | // insert checkboxes | ||
var choiceContainer = $("# | 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( | choiceContainer.find("input").click(plotAccordingTocphg19); | ||
function | function plotAccordingTocphg19() { | ||
var data = []; | var data = []; | ||
Line 75: | Line 75: | ||
if (data.length > 0) | if (data.length > 0) | ||
$.plot($("# | $.plot($("#charthg19"), data, { | ||
yaxis: { min: 0 }, | yaxis: { min: 0 }, | ||
xaxis: { tickDecimals: 0, show: false }, | xaxis: { tickDecimals: 0, show: false }, | ||
Line 84: | Line 84: | ||
} | } | ||
plotAccordingTocphg19(); | |||
function showTooltip(x, y, contents) { | function showTooltip(x, y, contents) { | ||
Line 101: | Line 101: | ||
var previousPoint = null; | var previousPoint = null; | ||
$("# | $("#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: | ||
}); | }); | ||
$("# | $("#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)]; | ||
$("# | $("#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: