@ -19,7 +19,7 @@ block content
div.card.shadow-sm.mb-3
div.card-body
h3.h6.mb-0 Selected Blocks
h3.h6.mb-0 Block Range
hr
div.clearfix
@ -44,9 +44,9 @@ block content
button.btn.btn-outline-primary.dropdown-toggle(type="button", id="preconfigured-dropdown", data-toggle="dropdown", aria-haspopup="true", aria-expanded="false") Selections
div.dropdown-menu(aria-labelledby="preconfigured-dropdown")
a.dropdown-item(href="javascript:void(0)", data-blocks="0-199") First 200 Blocks
a.dropdown-item(href="javascript:void(0)", data-blocks="209900-210100") First Halving
a.dropdown-item(href="javascript:void(0)", data-blocks="419900-420100") Second Halving
a.dropdown-item(href="javascript:void(0)", data-blocks="481724-481924") SegWit Activation Window
a.dropdown-item(href="javascript:void(0)", data-blocks="209900-210100") First Halving ±100
a.dropdown-item(href="javascript:void(0)", data-blocks="419900-420100") Second Halving ±100
a.dropdown-item(href="javascript:void(0)", data-blocks="481724-481924") SegWit Activation ±100
div.float-left
div(id="time-range-buttons")
@ -68,52 +68,33 @@ block content
div.progress-bar(id="data-progress", role="progressbar", aria-valuenow="0", aria-valuemin="0" ,aria-valuemax="100")
div(id="main-content", style="display: none;")
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="fee-rates", height="100")
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="max-fee-rates", height="100")
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="min-fees", height="100")
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="max-fees", height="100")
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="inputs-outputs", height="100")
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="tx-sizes", height="100")
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="max-tx-sizes", height="100")
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="volumes", height="100")
- var graphIds = ["fee-rates", "max-fee-rates", "total-fee", "min-fees", "max-fees", "inputs-outputs", "tx-sizes", "max-tx-sizes", "volumes", "weights-sizes", "sw-txs", "subsidy", "mediantime", "txs", "utxo_increase"];
- var graphTitles = ["Fee Rates (avg, median, min)", "Maximum Fee Rate", "Total Fees", "Minimum Tx Fee", "Maximum Tx Fee", "Input / Output Count", "Tx Sizes (avg, median, min)", "Maximum Tx Size", "Output Volume", "Block Weight and Size", "SegWit Tx Count", "Subsidy", "Timestamp", "Tx Count", "UTXO Δ"];
div(id="main-content", style="display: none;")
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="weights-sizes", height="100")
div.clearfix
each graphId, graphIndex in graphIds
div.float-left.mr-3.mb-1
div.form-check
input.form-check-input.graph-toggle-checkbox(type="checkbox", id=("checkbox-" + graphId) checked="checked", data-graphId=graphId, autocomplete="off")
label.form-check-label(for=("checkbox-" + graphId)) #{graphTitles[graphIndex]}
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="sw-txs", height="100")
div.float-left.mr-3.mb-1
a.mr-3(id="link-show-all", href="javascript:void(0)") show all
a(id="link-hide-all", href="javascript:void(0)") hide all
div.card.shadow-sm.mb-3
div.card-body
canvas.mb-3(id="subsidy", height="100")
div.row.clearfix
each graphId, graphIndex in graphIds
div.col-lg-6.float-left
div.card.shadow-sm.mb-3.graph-wrapper(id=`graph-wrapper-${graphId}`)
div.card-body
h3.h6.mb-0 #{graphTitles[graphIndex]}
hr
canvas.mb-3(id=graphId)
block endOfBody
@ -179,7 +160,31 @@ block endOfBody
return false;
});
getData(currentBlockHeight, 144, 15);
$(".graph-toggle-checkbox").change(function() {
var graphId = $(this).attr("data-graphId");
$("#graph-wrapper-" + graphId).toggle();
});
$("#link-show-all").on("click", function() {
$(".graph-toggle-checkbox").each(function() {
$(this).prop("checked", true);
});
$(".graph-wrapper").each(function() {
$(this).show();
});
});
$("#link-hide-all").on("click", function() {
$(".graph-toggle-checkbox").each(function() {
$(this).prop("checked", false);
});
$(".graph-wrapper").each(function() {
$(this).hide();
});
});
});
function getData(blockStart, count, chunkSize) {
@ -226,6 +231,8 @@ block endOfBody
createGraph("max-fee-rates", ["max-fee-rate"], [summary.maxfeerate], [blue]);
createGraph("total-fee", ["total-fee"], [summary.totalfee], [blue]);
createGraph("min-fees", ["min-fee"], [summary.minfee], [blue]);
createGraph("max-fees", ["max-fee"], [summary.maxfee], [blue]);
@ -243,6 +250,12 @@ block endOfBody
createGraph("subsidy", ["subsidy"], [summary.subsidy], [blue]);
createGraph("mediantime", ["mediantime"], [summary.mediantime], [blue]);
createGraph("txs", ["txs"], [summary.txs], [blue]);
createGraph("utxo_increase", ["utxo_increase"], [summary.utxo_increase], [blue]);
@ -287,6 +300,8 @@ block endOfBody
summary.maxfeerate = [];
summary.totalfee = [];
summary.minfee = [];
summary.maxfee = [];
@ -308,12 +323,20 @@ block endOfBody
summary.subsidy = [];
summary.mediantime = [];
summary.txs = [];
summary.utxo_increase = [];
for (var i = results.length - 1; i >= 0; i--) {
summary.avgfeerate.push({x:results[i].height, y:results[i].avgfeerate});
summary.medianfeerate.push({x:results[i].height, y:results[i].feerate_percentiles[2]});
summary.minfeerate.push({x:results[i].height, y:results[i].minfeerate});
summary.maxfeerate.push({x:results[i].height, y:results[i].maxfeerate});
summary.totalfee.push({x:results[i].height, y:new Decimal(results[i].totalfee).dividedBy(100000000)});
summary.minfee.push({x:results[i].height, y:results[i].minfee});
summary.maxfee.push({x:results[i].height, y:results[i].maxfee});
@ -335,11 +358,18 @@ block endOfBody
summary.swtxs.push({x:results[i].height, y:results[i].swtxs});
summary.subsidy.push({x:results[i].height, y:results[i].subsidy});
summary.mediantime.push({x:results[i].height, y:results[i].mediantime});
summary.txs.push({x:results[i].height, y:results[i].txs});
summary.utxo_increase.push({x:results[i].height, y:results[i].utxo_increase});
}
return summary;
}
var graphsById = {};
function createGraph(chartid, names, datas, colors) {
var datasets = [];
var yaxes = [];
@ -350,47 +380,54 @@ block endOfBody
data: datas[i],
borderWidth: 2,
borderColor: colors[i],
backgroundColor: 'rgba(0, 0, 0, 0)'
backgroundColor: 'rgba(0, 0, 0, 0)',
});
yaxes.push({
scaleLabel: {
display: tru e,
labelString: names[i]
display: fals e,
// labelString: names[i]
}
});
}
var ctx = document.getElementById(chartid).getContext('2d');
var myChart = new Chart(ctx, {
type: 'line',
data: {
datasets: datasets
},
options: {
animation:{
duration:0
// update data in graph if we already created, otherwise create anew
if (graphsById[chartid]) {
graph = graphsById[chartid];
graph.data = { datasets: datasets };
graph.update();
} else {
var ctx = document.getElementById(chartid).getContext('2d');
var graph = new Chart(ctx, {
type: 'line',
data: {
datasets: datasets
},
title: {
display: true,
text: chartid
},
legend: {
display: true
},
scales: {
xAxes: [{
type: 'linear',
position: 'bottom',
scaleLabel: {
display: true,
labelString: 'Block'
},
}],
//yAxes: yaxes
options: {
// disable all animations
animation: { duration: 0 },
hover: { animationDuration: 0 },
responsiveAnimationDuration: 0,
legend: {
display: (datasets.length > 1)
},
scales: {
xAxes: [{
type: 'linear',
position: 'bottom',
scaleLabel: {
display: true,
labelString: 'Block'
},
}],
}
}
}
});
});
graphsById[chartid] = graph;
}
}
if (rpcApiUnsupportedError == null)