How to use the blessed-contrib.sparkline 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 zz85 / threejs-term / play.js View on Github external
// border: {
	// 	type: 'line'
	// },
	style: {
		fg: 'white',
		// bg: 'magenta',
		border: {
			fg: '#f0f0f0'
		},
		hover: {
			bg: 'green'
		}
	}
});

const sparkline = contrib.sparkline({
	label: 'Stats'
    , tags: true
	, border: {
		type: 'line'
	}
	, style: { fg: '#f08', bg: '#201' } // 0ff 0f0 f08 / 002 020 201 (stats.js colors)
	, width: 'shrink' // 100
	, height: 'shrink' // 160
	, top: '10'
	, right: '0'
	, parent: screen
})

// Quit on Escape, q, or Control-C.
screen.key(['escape', 'q', 'C-c'], function(ch, key) {
	// TODO should flush or may cause screen corruption!