How to use the blessed-contrib.canvas 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 birgitta410 / rubikator / blessed / pipeline-widget.js View on Github external
var blessed = require('blessed'),
  contrib = require('blessed-contrib'),
  Node = blessed.Node,
  Canvas = contrib.canvas,
  _ = require('lodash');

// Started on basis of 'gauge' widget from blessed-contrib
// Differences:
// - supports option 'label' to display something other than percentage

function PipelineWidget(options) {

  var self = this

  options = options || {};
  self.options = options
  self.options.stroke = options.stroke || "magenta"
  self.options.fill = options.fill || "white"
  self.options.data = options.data || []
  self.options.showLabel = options.showLabel !== false