feat(dashboard): 添加区域转移概率统计功能
将1-49数字分为5个区域(1-10/11-20/21-30/31-40/41-49), 统计特码从一个区域转移到另一个区域的概率矩阵, 在控制台页面以彩色表格展示
This commit is contained in:
@@ -40,6 +40,7 @@ define(['jquery'], function ($) {
|
||||
function render(data) {
|
||||
var hc = data.hotcold, cw = data.colorwave, zo = data.zodiac;
|
||||
var oe = data.oddeven, bs = data.bigsmall, sp = data.special, tn = data.tailnumbers;
|
||||
var zt = data.zonetransition;
|
||||
|
||||
var html = '';
|
||||
|
||||
@@ -88,6 +89,28 @@ define(['jquery'], function ($) {
|
||||
var hm = data.heatmap;
|
||||
html += '<div class="dash-section"><h4>🎨 特码热力图</h4><div style="font-size:12px;color:#999;margin-bottom:8px;">X轴:期号(从左往右,从远到近) | Y轴:号码1-49 | 颜色:号码波色</div><div id="heatmap-chart" style="width:100%;height:500px;"></div></div>';
|
||||
|
||||
// 区域转移概率
|
||||
if (zt && zt.matrix && zt.matrix.length > 0) {
|
||||
html += '<div class="dash-section"><h4>🔄 区域转移概率</h4><div style="font-size:12px;color:#999;margin-bottom:8px;">当前共 ' + zt.total_transitions + ' 次区域转移 | 行=上一期特码所在区域,列=下一期特码所在区域</div>';
|
||||
html += '<table class="table table-bordered table-condensed text-center" style="max-width:600px;margin:0 auto;"><thead><tr><th>区域→</th>';
|
||||
for (var z = 0; z < zt.zones.length; z++) {
|
||||
html += '<th>' + zt.zones[z] + '</th>';
|
||||
}
|
||||
html += '</tr></thead><tbody>';
|
||||
for (var r = 0; r < 5; r++) {
|
||||
html += '<tr><td style="font-weight:bold;">' + zt.zones[r] + '</td>';
|
||||
for (var c = 0; c < 5; c++) {
|
||||
var pct = zt.probabilities[r][c];
|
||||
var cnt = zt.matrix[r][c];
|
||||
var bg = pct > 30 ? '#e74c3c' : pct > 20 ? '#f39c12' : pct > 10 ? '#3498db' : pct > 0 ? '#95a5a6' : '#f5f5f5';
|
||||
var txt = pct > 10 ? '#fff' : '#333';
|
||||
html += '<td style="background-color:' + bg + ';color:' + txt + ';">' + cnt + '次<br>' + pct + '%</td>';
|
||||
}
|
||||
html += '</tr>';
|
||||
}
|
||||
html += '</tbody></table></div>';
|
||||
}
|
||||
|
||||
$('#dash-content').html(html);
|
||||
|
||||
// 波色饼图
|
||||
|
||||
Reference in New Issue
Block a user