Use a Carousel Layout
masterA contrib.carousel switches between different views (pages) based on a time interval or keyboard activity. Each page is a function that sets up a view on the screen.
Options:
screen: The blessed screen instance.interval: Time in ms between automatic switches (set to 0 to disable auto-switch).controlKeys: If true, left/right arrow keys control rotation.
var blessed = require('blessed')
, contrib = require('./')
, screen = blessed.screen()
function page1(screen) {
var map = contrib.map()
screen.append(map)
}
function page2(screen) {
var line = contrib.line({ width: 80, height: 30, label: 'Title' })
screen.append(line)
line.setData([{ title: 'us-east', x: ['t1', 't2'], y: [0, 2] }])
}
var carousel = new contrib.carousel( [page1, page2], {
screen: screen,
interval: 3000,
controlKeys: true
})
carousel.start()