How to use the blessed-contrib.table function in blessed-contrib

To help you get started, we’ve selected a few blessed-contrib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hustcer / star / lib / watch.js View on Github external
let initUI = function initUI(){
    table = contrib.table({
        keys          : true,
        fg            : 'white',
        selectedFg    : 'black',
        selectedBg    : 'cyan',
        interactive   : true,
        label         : '股票列表',
        width         : '55%',
        height        : '80%',
        border        : { type: 'line', fg: 'cyan' },
        columnSpacing : 5,
        columnWidth   : [10, 7, 7, 7, 9],
    });

    /* eslint no-process-exit:0 */
    screen.key(['escape', 'q', 'C-c'], () => process.exit(0) );
};
github gajus / seeql / src / index.js View on Github external
let table;

if (argv.useScreen) {
  const blessed = require('blessed');
  const contrib = require('blessed-contrib');

  screen = blessed.screen({
    smartCSR: true
  });

  screen.key(['escape', 'q', 'C-c'], () => {
    // eslint-disable-next-line no-process-exit
    return process.exit(0);
  });

  table = contrib.table({
    columnSpacing: 5,
    columnWidth: [
      15,
      15,
      50,
      10,
      30
    ],
    fg: 'white',
    height: '80%',
    interactive: true,
    keys: true,
    label: null,
    selectedBg: 'blue',
    selectedFg: 'white',
    width: '80%'
github msolters / gdax-multipong / ui.js View on Github external
const init_screen = exports.init_screen = () => {
  screen = blessed.screen()
  ui.overview_table = contrib.table({
    top: '2%',
    left: '2%',
    width: '96%',
    height: '13%',
    label: 'Overview',
    border: {type: 'line', fg: 'yellow'},
    fg: 'yellow',
    interactive: false,
    columnSpacing: 4,               //in chars
    columnWidth: [12, 8, 12, 12, 12, 8, 12, 12, 8, 8, 8, 8],  // in chars
  })
  ui.trade_table = contrib.table({
    keys: true,
    fg: 'yellow',
    interactive: false,
    label: 'Trade Buckets',
github msolters / gdax-multipong / ui.js View on Github external
const init_screen = exports.init_screen = () => {
  screen = blessed.screen()
  ui.overview_table = contrib.table({
    top: '2%',
    left: '2%',
    width: '96%',
    height: '13%',
    label: 'Overview',
    border: {type: 'line', fg: 'yellow'},
    fg: 'yellow',
    interactive: false,
    columnSpacing: 4,               //in chars
    columnWidth: [12, 8, 12, 12, 12, 8, 12, 12, 8, 8, 8, 8],  // in chars
  })
  ui.trade_table = contrib.table({
    keys: true,
    fg: 'yellow',
    interactive: false,
    label: 'Trade Buckets',
    width: '48%',
    height: '82%',
    top: '16%',
    left: '50%',
    border: {type: "line", fg: "yellow"},
    columnSpacing: 4, //in chars
    columnWidth: [4, 12, 12, 4, 17], /*in chars*/
  })
  ui.gdax_log = contrib.log({
    fg: "yellow",
    selectedFg: "yellow",
    label: 'GDAX Log',
github medialab / sandcrawler-dashboard / src / ui.js View on Github external
// Response component
  this.response = blessed.box({
    label: 'Response',
    top: '70%',
    left: '30%',
    border: {
      type: 'line',
      fg: 'blue'
    },
    width: '30%',
    height: '30%'
  });

  // Job table component
  var table = contrib.table({
    label: 'Jobs',
    top: '0',
    left: '60%',
    border: {
      type: 'line',
      fg: 'blue'
    },
    width: '40%',
    height: '60%',
    columnSpacing: [6, 70, 20]
  });
  table.jobs = {};

  table.add = function(id, rows) {
    this.jobs[id] = rows;
    return this;
github ssb-junkyard / ssb-cli-dashboard / gossip.js View on Github external
require('ssb-client')(function (err, sbot) {
  if(err) throw err

  var screen = blessed.screen()
  var grid = new contrib.grid({rows: 12, cols: 12, screen: screen})

  var table = contrib.table({
    fg: 'default',
    keys: true,
    interactive: false,
    columnSpacing: 2, //in chars
    columnWidth: [10, process.stdout.columns - (10+15+4), 15] /*in chars*/
  })
  screen.append(table)

  screen.key(['escape', 'q', 'C-c'], function(ch, key) {
    return process.exit(0);
  })

  function poll () {
    sbot.gossip.peers(function (err, peers) {
      if (err) throw err
      table.setData(peersToTableData(peers))