mirror of
https://github.com/wownero/diff-chart.git
synced 2026-10-17 15:21:25 +02:00
further fixes with offsetting
This commit is contained in:
+6
-3
@@ -1,10 +1,13 @@
|
||||
function get_chart(chartData) {
|
||||
chartData.shift();
|
||||
function get_chart(chartData, offset) {
|
||||
if (offset === undefined)
|
||||
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].height = i + (offset === undefined ? 1 : offset.height);
|
||||
chartData[i].bc_size = chartData[i][4];
|
||||
if (i === 0 && offset !== undefined)
|
||||
chartData[i].bc_size += offset.bc_size;
|
||||
if (i > 0)
|
||||
chartData[i].bc_size += chartData[i - 1].bc_size;
|
||||
chartData[i].bc_size_str = formatBytes(chartData[i].bc_size, 3);
|
||||
|
||||
+4
-3
@@ -1,9 +1,10 @@
|
||||
function get_chart(chartData, cryptonote_config) {
|
||||
chartData.shift();
|
||||
function get_chart(chartData, cryptonote_config, offset) {
|
||||
if (offset === undefined)
|
||||
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].height = i + (offset === undefined ? 1 : offset.height);
|
||||
chartData[i].reward = print_money(chartData[i][3], cryptonote_config.CRYPTONOTE_DISPLAY_DECIMAL_POINT);
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -1,9 +1,10 @@
|
||||
function get_chart(chartData) {
|
||||
chartData.shift();
|
||||
function get_chart(chartData, offset) {
|
||||
if (offset === undefined)
|
||||
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].height = i + (offset === undefined ? 1 : offset.height);
|
||||
chartData[i].block_size = chartData[i][4];
|
||||
chartData[i].block_size_str = formatBytes(chartData[i].block_size, 3);
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
function get_chart(chartData) {
|
||||
chartData.shift();
|
||||
function get_chart(chartData, offset) {
|
||||
if (offset === undefined)
|
||||
chartData.shift();
|
||||
var chartData_bt = [];
|
||||
var block_date = null;
|
||||
|
||||
|
||||
+4
-3
@@ -1,7 +1,7 @@
|
||||
function get_chart(chartData, cryptonote_config, offset) {
|
||||
for (var i = 0; i < chartData.length; ++i) {
|
||||
chartData[i].date = new Date(1000 * chartData[i][0]);
|
||||
chartData[i].height = i;
|
||||
chartData[i].height = i + (offset === undefined ? 0 : offset.height);
|
||||
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]); // subtract fees
|
||||
@@ -15,7 +15,7 @@ function get_chart(chartData, cryptonote_config, offset) {
|
||||
var target = cryptonote_config.get_difficulty_target((offset === undefined ? 0 : offset.height) + i);
|
||||
var target_minutes = target / 60;
|
||||
var emission_speed_factor = cryptonote_config.get_emission_speed_factor(target_minutes);
|
||||
var already_generated_coins = i == 0 ? (offset === undefined ? bigInt(0) : offset.supply_proj) : chartData[i - 1].coin_supply_proj;
|
||||
var already_generated_coins = i == 0 ? (offset === undefined ? bigInt(0) : bigInt(offset.supply_proj)) : chartData[i - 1].coin_supply_proj;
|
||||
var base_reward = bigInt(cryptonote_config.MONEY_SUPPLY).minus(already_generated_coins).shiftRight(emission_speed_factor);
|
||||
if (base_reward.lesser(cryptonote_config.FINAL_SUBSIDY_PER_MINUTE * target_minutes))
|
||||
{
|
||||
@@ -26,7 +26,8 @@ function get_chart(chartData, cryptonote_config, offset) {
|
||||
chartData[i].coin_supply_proj_real = chartData[i].coin_supply_proj.toJSNumber() / Math.pow(10, cryptonote_config.CRYPTONOTE_DISPLAY_DECIMAL_POINT);
|
||||
}
|
||||
|
||||
chartData.shift();
|
||||
if (offset === undefined)
|
||||
chartData.shift();
|
||||
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "serial",
|
||||
|
||||
+4
-3
@@ -1,9 +1,10 @@
|
||||
function get_chart(chartData, cryptonote_config) {
|
||||
chartData.shift();
|
||||
function get_chart(chartData, cryptonote_config, offset) {
|
||||
if (offset === undefined)
|
||||
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].height = i + (offset === undefined ? 1 : offset.height);
|
||||
chartData[i].difficulty = chartData[i][2];
|
||||
chartData[i].hashrate = formatHashrate(chartData[i].difficulty / cryptonote_config.get_difficulty_target(chartData[i].height), 2);
|
||||
}
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
var max_num_bullets = 200000;
|
||||
|
||||
function get_chart(chartData) {
|
||||
chartData.shift();
|
||||
function get_chart(chartData, offset) {
|
||||
if (offset === undefined)
|
||||
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].height = i + (offset === undefined ? 1 : offset.height);
|
||||
chartData[i].nonce = chartData[i][1];
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
function get_chart(chartData, levels) {
|
||||
chartData.shift();
|
||||
function get_chart(chartData, levels, offset) {
|
||||
if (offset === undefined)
|
||||
chartData.shift();
|
||||
var chartData_rs = [];
|
||||
var block_date = null;
|
||||
var num_txes_per_day = {};
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
function get_chart(chartData) {
|
||||
chartData.shift();
|
||||
function get_chart(chartData, offset) {
|
||||
if (offset === undefined)
|
||||
chartData.shift();
|
||||
var chartData_tpd = [];
|
||||
var block_date = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user