Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: extra lines and commented code
  • Loading branch information
jkga committed Apr 13, 2020
commit 6f0bc9fabd01fee5177a29364e5d66b7a4722cf2
5 changes: 1 addition & 4 deletions lib/cli/gfx/server-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ function OutputBuffer(options) {
this.columns = options.cols;
this.rows = options.rows;
this.write = function(s) {
s = s.replace('\x1b8', ''); //not clear from where in blessed this code comes from. It forces the terminal to clear and loose existing content.
s = s.replace('\x1b8', '');
options.stream.write(s)
};

this.on = function() {};
}

Expand All @@ -25,7 +24,6 @@ function InputBuffer() {
this.on = function() {};
}


createScreen = (opt = {}) => {
const output = new OutputBuffer({stream: opt.stream, cols: 250, rows: 50});
const input = new InputBuffer(); //required to run under forever since it replaces stdin to non-tty
Expand All @@ -35,7 +33,6 @@ createScreen = (opt = {}) => {
return screen
}


loadTemplate = (gridTemplateClass, json, callback) => {

blessed.Screen.global = null
Expand Down
8 changes: 2 additions & 6 deletions lib/cli/gfx/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const
contrib = require('blessed-contrib'),
chalk = require('chalk');

// <Grid>:new contrib.grid({rows: 14, cols: 14, screen: screen});
exports.load = (grid, data) => {

let markdown = grid.set(0, 0, 2, 2, contrib.markdown,{
Expand Down Expand Up @@ -65,11 +64,8 @@ exports.load = (grid, data) => {
}
}})

screen.append(bar) //must append before setting data
bar.setData(
{ titles: ['Cases', 'Deaths', 'Recovered', 'Active']
, data: [data.cases, data.deaths, data.recovered, data.active]})

screen.append(bar) //must append before setting data
bar.setData({ titles: ['Cases', 'Deaths', 'Recovered', 'Active'], data: [data.cases, data.deaths, data.recovered, data.active]})

let donut = grid.set(2, 7, 3, 2, contrib.donut,{
label: 'Mortality Rate',
Expand Down