mirror of
https://github.com/wownero/diff-chart.git
synced 2026-10-17 23:31:26 +02:00
add nonce plots, requires data upgrade
This commit is contained in:
@@ -12,6 +12,7 @@ _These JavaScript-based interactive charts are highly memory intensive. You will
|
||||
- [Block reward](https://stoffu.github.io/diff-chart/aeon-block-reward.html)
|
||||
- [Coin supply](https://stoffu.github.io/diff-chart/aeon-coin-supply.html)
|
||||
- [Block time](https://stoffu.github.io/diff-chart/aeon-block-time.html)
|
||||
- [Nonce](https://stoffu.github.io/diff-chart/aeon-nonce.html)
|
||||
|
||||
## Monero
|
||||
|
||||
@@ -23,6 +24,7 @@ _These JavaScript-based interactive charts are highly memory intensive. You will
|
||||
- [Block reward](https://stoffu.github.io/diff-chart/monero-block-reward.html)
|
||||
- [Coin supply](https://stoffu.github.io/diff-chart/monero-coin-supply.html)
|
||||
- [Block time](https://stoffu.github.io/diff-chart/monero-block-time.html)
|
||||
- [Nonce](https://stoffu.github.io/diff-chart/monero-nonce.html)
|
||||
|
||||
## Wownero
|
||||
|
||||
@@ -34,3 +36,4 @@ _These JavaScript-based interactive charts are highly memory intensive. You will
|
||||
- [Block reward](https://stoffu.github.io/diff-chart/wownero-block-reward.html)
|
||||
- [Coin supply](https://stoffu.github.io/diff-chart/wownero-coin-supply.html)
|
||||
- [Block time](https://stoffu.github.io/diff-chart/wownero-block-time.html)
|
||||
- [Nonce](https://stoffu.github.io/diff-chart/wownero-nonce.html)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<header><title>Aeon nonce</title>
|
||||
<!-- Styles -->
|
||||
<style>
|
||||
#chartdiv {
|
||||
width : 100%;
|
||||
height : 500px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Resources -->
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script src="js/util.js"></script>
|
||||
<script src="data/aeon-data-0.js"></script>
|
||||
<script src="data/aeon-data-1.js"></script>
|
||||
<script src="data/aeon-data-2.js"></script>
|
||||
<script src="data/aeon-data-3.js"></script>
|
||||
<script src="data/aeon-data-4.js"></script>
|
||||
<script src="data/aeon-data-5.js"></script>
|
||||
<script src="data/aeon-data-6.js"></script>
|
||||
<script src="data/aeon-data-7.js"></script>
|
||||
<script src="data/aeon-data-8.js"></script>
|
||||
<script src="data/aeon-data-9.js"></script>
|
||||
<script src="data/aeon-data-10.js"></script>
|
||||
<script src="js/nonce.js"></script>
|
||||
|
||||
<!-- Chart code -->
|
||||
<script>
|
||||
var chart = get_chart([].concat(
|
||||
chartData_0,
|
||||
chartData_1,
|
||||
chartData_2,
|
||||
chartData_3,
|
||||
chartData_4,
|
||||
chartData_5,
|
||||
chartData_6,
|
||||
chartData_7,
|
||||
chartData_8,
|
||||
chartData_9,
|
||||
chartData_10,
|
||||
));
|
||||
|
||||
function togglePan() {
|
||||
chart.chartCursor.pan = document.getElementById("pan").checked;
|
||||
}
|
||||
|
||||
</script>
|
||||
</header>
|
||||
<body>
|
||||
<h1>Aeon nonce</h1>
|
||||
<div id="chartdiv"></div>
|
||||
<p><input type="checkbox" id="pan" onclick="togglePan()">Enable panning</p>
|
||||
<p><a href="./">Back to top</a></p>
|
||||
</body>
|
||||
</html>
|
||||
+2
-1
@@ -66,6 +66,7 @@ class GetData():
|
||||
block_header = res_blk['block_header']
|
||||
|
||||
timestamp = block_header['timestamp']
|
||||
nonce = block_header['nonce']
|
||||
difficulty = block_header['difficulty']
|
||||
reward = block_header['reward']
|
||||
block_size = block_header['block_size']
|
||||
@@ -97,7 +98,7 @@ class GetData():
|
||||
if j > 0:
|
||||
txs_str += ','
|
||||
txs_str += "[%d,%d,%d,%d,%d,%d]" % (unlock_time, ins, outs, ring_size, fee, extra_size)
|
||||
print('[%d,%d,%d,%d,[%s]],' % (timestamp, difficulty, reward, block_size, txs_str))
|
||||
print('[%d,%d,%d,%d,%d,[%s]],' % (timestamp, nonce, difficulty, reward, block_size, txs_str))
|
||||
print(']')
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ function get_chart(chartData) {
|
||||
for (var i = 0; i < chartData.length; ++i) {
|
||||
chartData[i].date = new Date(1000 * chartData[i][0]);
|
||||
chartData[i].height = i + 1;
|
||||
chartData[i].bc_size = chartData[i][3];
|
||||
chartData[i].bc_size = chartData[i][4];
|
||||
if (i > 0)
|
||||
chartData[i].bc_size += chartData[i - 1].bc_size;
|
||||
chartData[i].bc_size_str = formatBytes(chartData[i].bc_size, 3);
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ function get_chart(chartData, decimal_point) {
|
||||
for (var i = 0; i < chartData.length; ++i) {
|
||||
chartData[i].date = new Date(1000 * chartData[i][0]);
|
||||
chartData[i].height = i + 1;
|
||||
chartData[i].reward = print_money(chartData[i][2], decimal_point);
|
||||
chartData[i].reward = print_money(chartData[i][3], decimal_point);
|
||||
}
|
||||
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ function get_chart(chartData) {
|
||||
for (var i = 0; i < chartData.length; ++i) {
|
||||
chartData[i].date = new Date(1000 * chartData[i][0]);
|
||||
chartData[i].height = i + 1;
|
||||
chartData[i].block_size = chartData[i][3];
|
||||
chartData[i].block_size = chartData[i][4];
|
||||
chartData[i].block_size_str = formatBytes(chartData[i].block_size, 3);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@ function get_chart(chartData, decimal_point) {
|
||||
for (var i = 0; i < chartData.length; ++i) {
|
||||
chartData[i].date = new Date(1000 * chartData[i][0]);
|
||||
chartData[i].height = i;
|
||||
chartData[i].coin_supply = bigInt(chartData[i][2]);
|
||||
for (var j = 0; j < chartData[i][4].length; ++j)
|
||||
chartData[i].coin_supply = chartData[i].coin_supply.minus(chartData[i][4][j][4]);
|
||||
chartData[i].coin_supply = bigInt(chartData[i][3]);
|
||||
for (var j = 0; j < chartData[i][5].length; ++j)
|
||||
chartData[i].coin_supply = chartData[i].coin_supply.minus(chartData[i][5][j][4]);
|
||||
if (i > 0)
|
||||
chartData[i].coin_supply = chartData[i].coin_supply.plus(chartData[i - 1].coin_supply);
|
||||
chartData[i].coin_supply_str = print_money(chartData[i].coin_supply, decimal_point);
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ function get_chart(chartData, diff_targets) {
|
||||
for (var i = 0; i < chartData.length; ++i) {
|
||||
chartData[i].date = new Date(1000 * chartData[i][0]);
|
||||
chartData[i].height = i + 1;
|
||||
chartData[i].difficulty = chartData[i][1];
|
||||
chartData[i].difficulty = chartData[i][2];
|
||||
chartData[i].hashrate = formatHashrate(chartData[i].difficulty / get_diff_target(diff_targets, chartData[i].height), 2);
|
||||
}
|
||||
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
function get_chart(chartData) {
|
||||
chartData.shift();
|
||||
|
||||
for (var i = 0; i < chartData.length; ++i) {
|
||||
chartData[i].date = new Date(1000 * chartData[i][0]);
|
||||
chartData[i].height = i + 1;
|
||||
chartData[i].nonce = chartData[i][1];
|
||||
}
|
||||
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"marginRight": 80,
|
||||
"autoMarginOffset": 20,
|
||||
"marginTop": 7,
|
||||
"dataProvider": chartData,
|
||||
"valueAxes": [{
|
||||
"axisAlpha": 0,
|
||||
}],
|
||||
"mouseWheelZoomEnabled": true,
|
||||
"graphs": [{
|
||||
"id": "g1",
|
||||
"lineColor": "#800040",
|
||||
"lineAlpha": 0,
|
||||
"bulletAlpha": 1,
|
||||
"bullet": "square",
|
||||
"bulletSize": 1,
|
||||
"minBulletSize": 1,
|
||||
"balloonText": "Height: <b>[[height]]</b>\nNonce: <b>[[value]]</b>\n",
|
||||
"showBalloonAt": "close",
|
||||
"title": "nonce",
|
||||
"valueField": "nonce",
|
||||
"balloon":{
|
||||
"cornerRadius": 10,
|
||||
"animationDuration": 0,
|
||||
}
|
||||
}],
|
||||
"chartCursor": {
|
||||
"pan": false,
|
||||
"categoryBalloonEnabled": false,
|
||||
"animationDuration": 0,
|
||||
"cursorAlpha": 0,
|
||||
},
|
||||
"categoryField": "date",
|
||||
"categoryAxis": {
|
||||
"parseDates": true,
|
||||
"minPeriod": "ss",
|
||||
"axisColor": "#DADADA",
|
||||
"dashLength": 1,
|
||||
"minorGridEnabled": true
|
||||
},
|
||||
"export": {
|
||||
"enabled": true,
|
||||
"position": "bottom-right"
|
||||
}
|
||||
});
|
||||
|
||||
// this method is called when chart is first inited as we listen for "rendered" event
|
||||
function zoomChart() {
|
||||
// different zoom methods can be used - zoomToIndexes, zoomToDates, zoomToCategoryValues
|
||||
chart.zoomToIndexes(0, chartData.length - 1);
|
||||
}
|
||||
chart.addListener("rendered", zoomChart);
|
||||
zoomChart();
|
||||
|
||||
return chart;
|
||||
}
|
||||
+2
-2
@@ -18,9 +18,9 @@ function get_chart(chartData, levels) {
|
||||
num_txes_per_day[block_date] = 0;
|
||||
}
|
||||
var e = chartData_rs[chartData_rs.length - 1];
|
||||
var num_txes = chartData[i][4].length;
|
||||
var num_txes = chartData[i][5].length;
|
||||
if (num_txes > 0) {
|
||||
var ring_size = chartData[i][4][0][3];
|
||||
var ring_size = chartData[i][5][0][3];
|
||||
while (ring_size >= e.histogram.length) {
|
||||
e.histogram.push(0);
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ function get_chart(chartData) {
|
||||
"num_txes": 0,
|
||||
});
|
||||
}
|
||||
chartData_tpd[chartData_tpd.length - 1].num_txes += chartData[i][4].length;
|
||||
chartData_tpd[chartData_tpd.length - 1].num_txes += chartData[i][5].length;
|
||||
}
|
||||
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<html>
|
||||
<header><title>Monero nonce</title>
|
||||
<!-- Styles -->
|
||||
<style>
|
||||
#chartdiv {
|
||||
width : 100%;
|
||||
height : 500px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Resources -->
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script src="js/util.js"></script>
|
||||
<script src="data/monero-data-0.js"></script>
|
||||
<script src="data/monero-data-1.js"></script>
|
||||
<script src="data/monero-data-2.js"></script>
|
||||
<script src="data/monero-data-3.js"></script>
|
||||
<script src="data/monero-data-4.js"></script>
|
||||
<script src="data/monero-data-5.js"></script>
|
||||
<script src="data/monero-data-6.js"></script>
|
||||
<script src="data/monero-data-7.js"></script>
|
||||
<script src="data/monero-data-8.js"></script>
|
||||
<script src="data/monero-data-9.js"></script>
|
||||
<script src="data/monero-data-10.js"></script>
|
||||
<script src="data/monero-data-11.js"></script>
|
||||
<script src="data/monero-data-12.js"></script>
|
||||
<script src="data/monero-data-13.js"></script>
|
||||
<script src="data/monero-data-14.js"></script>
|
||||
<script src="data/monero-data-15.js"></script>
|
||||
<script src="data/monero-data-16.js"></script>
|
||||
<script src="data/monero-data-17.js"></script>
|
||||
<script src="js/nonce.js"></script>
|
||||
|
||||
<!-- Chart code -->
|
||||
<script>
|
||||
var chart = get_chart([].concat(
|
||||
chartData_0,
|
||||
chartData_1,
|
||||
chartData_2,
|
||||
chartData_3,
|
||||
chartData_4,
|
||||
chartData_5,
|
||||
chartData_6,
|
||||
chartData_7,
|
||||
chartData_8,
|
||||
chartData_9,
|
||||
chartData_10,
|
||||
chartData_11,
|
||||
chartData_12,
|
||||
chartData_13,
|
||||
chartData_14,
|
||||
chartData_15,
|
||||
chartData_16,
|
||||
chartData_17,
|
||||
));
|
||||
|
||||
function togglePan() {
|
||||
chart.chartCursor.pan = document.getElementById("pan").checked;
|
||||
}
|
||||
|
||||
</script>
|
||||
</header>
|
||||
<body>
|
||||
<h1>Monero nonce</h1>
|
||||
<div id="chartdiv"></div>
|
||||
<p><input type="checkbox" id="pan" onclick="togglePan()">Enable panning</p>
|
||||
<p><a href="./">Back to top</a></p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,37 @@
|
||||
<html>
|
||||
<header><title>Wownero nonce</title>
|
||||
<!-- Styles -->
|
||||
<style>
|
||||
#chartdiv {
|
||||
width : 100%;
|
||||
height : 500px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Resources -->
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script src="js/util.js"></script>
|
||||
<script src="data/wownero-data-0.js"></script>
|
||||
<script src="js/nonce.js"></script>
|
||||
|
||||
<!-- Chart code -->
|
||||
<script>
|
||||
var chart = get_chart(chartData_0);
|
||||
|
||||
function togglePan() {
|
||||
chart.chartCursor.pan = document.getElementById("pan").checked;
|
||||
}
|
||||
|
||||
</script>
|
||||
</header>
|
||||
<body>
|
||||
<h1>Wownero nonce</h1>
|
||||
<div id="chartdiv"></div>
|
||||
<p><input type="checkbox" id="pan" onclick="togglePan()">Enable panning</p>
|
||||
<p><a href="./">Back to top</a></p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user