examples/src/demo-app.js
function generateData() {
  var totalTransactions = 20;
  var totalAmount = 0;
  var transactions = [];

  // Generate transactions
  for (var i = 0; i < totalTransactions; i++) {
    // Transactions
    var transaction = faker.helpers.createTransaction();
    transaction.date = getDate();
    totalAmount += parseFloat(transaction.amount);

    // Other transactions
    transaction.other = [];
    for (var j = 0; j < totalTransactions; j++) {
      other = faker.helpers.createTransaction();
      other.date = getDate();
      transaction.other.push(other);
    }

    transactions.push(transaction);
  }

  dataView.transactions = transactions.sort(compare);
  dataView.selectedTransaction = transactions[0];
  dataView.totalAmount = toCurrency(totalAmount);
}
function generateData() {
  var totalTransactions = 20;
  var totalAmount = 0;
  var transactions = [];

  // Generate transactions
  for (var i = 0; i < totalTransactions; i++) {
    // Transactions
    var transaction = faker.helpers.createTransaction();
    transaction.date = getDate();
    totalAmount += parseFloat(transaction.amount);

    // Other transactions
    transaction.other = [];
    for (var j = 0; j < totalTransactions; j++) {
      other = faker.helpers.createTransaction();
      other.date = getDate();
      transaction.other.push(other);
    }

    transactions.push(transaction);
  }

  dataView.transactions = transactions.sort(compare);
  dataView.selectedTransaction = transactions[0];
  dataView.totalAmount = toCurrency(totalAmount);
}
function generateData ( ) { var totalTransactions = 20 ; var totalAmount = 0 ; var transactions = [ ] ; // Generate transactions for ( var i = 0 ; i < totalTransactions ; i ++ ) { // Transactions var transaction = faker . helpers . createTransaction ( ) ; transaction . date = getDate ( ) ; totalAmount += parseFloat ( transaction . amount ) ; // Other transactions transaction . other = [ ] ; for ( var j = 0 ; j < totalTransactions ; j ++ ) { other = faker . helpers . createTransaction ( ) ; other . date = getDate ( ) ; transaction . other . push ( other ) ; } transactions . push ( transaction ) ; } dataView . transactions = transactions . sort ( compare ) ; dataView . selectedTransaction = transactions [ 0 ] ; dataView . totalAmount = toCurrency ( totalAmount ) ; }
Generates fake data using faker.js script.
Generates fake data using faker . js script .