Commit f2b7de6d authored by Jason Rhinelander's avatar Jason Rhinelander
Browse files

Replaced effor titles with jquery-ui dialogs

parent fb5f4e0a
......@@ -13,6 +13,8 @@
<script src="pools.js?5"></script>
<link rel="stylesheet" href="pools.css?5" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="/javascript/jquery-ui/themes/base/jquery-ui.css" />
<script src="/javascript/jquery-ui/jquery-ui.min.js"></script>
</head>
<body>
<div class="top-stats">
......@@ -40,6 +42,8 @@
</div>
</div>
<div id="effort-dialog"></div>
<table id="pool-table">
<thead>
<tr>
......
......@@ -67,7 +67,8 @@ td.name, td.location {
text-align: left;
}
td.effort.significant, td.fee.high { text-decoration: underline; cursor: help; }
td.effort, td.fee.high { cursor: help; }
td.effort.significant, td.fee.high { text-decoration: underline; }
td.effort.significant .indicator { font-weight: bold; }
td.effort.significant.high.conf95 { color: #660000; } /* Bad luck */
td.effort.significant.high.conf99 { color: #990000; } /* Really bad luck */
......@@ -195,3 +196,10 @@ body.embedded .charts,
body.embedded .hashrate-chart {
display: none;
}
div#effort-dialog {
display: none;
}
div.ui-dialog {
box-shadow: 0 0 10px 5px gray;
}
......@@ -177,23 +177,32 @@ function update_pools(data) {
let eff = pool.effort_stats;
tde.text(eff.mean.toFixed(1) + '%');
let title = 'Since block ' + eff.since + ' (~' + ((data.height - eff.since) / target_blocks_per_day) + ' days ago) ' + pool.name + ' has found ' + eff.blocks + ' blocks ' +
let effort_info = 'Since block ' + eff.since + ' (~' + ((data.height - eff.since) / target_blocks_per_day) + ' days ago) ' + pool.dispname + ' has found ' + eff.blocks + ' blocks ' +
'with an average effort over those blocks of ' + eff.mean.toPrecision(4) + '%.';
if (eff.pval < .05) {
title += '\n\nStatistically, the probability of a fair pool with this many blocks being this ' + (eff.mean > 100 ? 'unlucky' : 'lucky') + ' equals ' +
eff.pval.toPrecision(4).replace('e-', '×10^-') + '.';
effort_info += '<br /><br />Statistically, the probability of a fair pool with this many blocks being this ' + (eff.mean > 100 ? 'unlucky' : 'lucky') + ' equals ' +
eff.pval.toPrecision(4).replace(/e(-\d+)/, '×10<sup>$1</sup>') + '.';
}
if (eff.pval < .0001) {
if (eff.mean > 100) {
title += '\n\nSince the probability is so low that this average effort is simply due to bad luck, we\'ve added the effective ' +
'loss due to the abnormally high effort value to this pool\'s nominal fee of ' + row.find('td.fee').text() + '%.';
effort_info += '<br /><br />Since it is so statistically unlikely that this high average effort is simply due to bad luck, we\'ve added ' +
'the effective loss due to the abnormally high effort value as an effective fee in addition to this ' +
'pool\'s nominal fee of ' + row.find('td.fee').text() + '%.';
}
else {
title += '\n\nThis pool seems impossibly lucky: treat this reported luck value with suspicion.';
effort_info += '<br /><br />This pool seems impossibly lucky: treat this reported luck value with suspicion.';
}
}
tde.attr('title', title);
var dialog_creator = function(name, text) { return function(e) {
var dialog = $('div#effort-dialog');
dialog.empty().append($('<div>' + effort_info + '</div>'));
dialog.dialog({
title: name + ' effort statistics',
position: { my: 'center', at: 'center', of: e } });
}; };
tde.on('click', dialog_creator(pool.dispname, effort_info));
if (eff.pval < 0.05) {
tde.addClass('significant');
......@@ -212,8 +221,8 @@ function update_pools(data) {
fee += 100.0 * (1.0 - 100.0/eff.mean)
tdfee.text(fee.toFixed(1) + ' *');
tdfee.attr('sortkey', fee);
tdfee.attr('title', title);
tdfee.addClass('high').addClass('conf9999');
tdfee.on('click', dialog_creator(pool.dispname, effort_info));
}
tde.attr("sortkey", eff.mean);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment