Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babar

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babar

CLI bar charts

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
135K
decreased by-2.77%
Maintainers
1
Weekly downloads
 
Created

What is babar?

The 'babar' npm package is a simple, ASCII bar chart generator for Node.js. It allows you to create bar charts directly in the terminal, which can be useful for quick visualizations of data without needing a graphical interface.

What are babar's main functionalities?

Basic Bar Chart

This feature allows you to create a basic bar chart with a set of data points. The code sample demonstrates how to generate a bar chart with data points representing a quadratic function.

const babar = require('babar');
const data = [
  { x: 0, y: 0 },
  { x: 1, y: 1 },
  { x: 2, y: 4 },
  { x: 3, y: 9 },
  { x: 4, y: 16 }
];
console.log(babar(data));

Customizing Bar Chart

This feature allows you to customize the appearance of the bar chart. The code sample shows how to set the width, height, and color of the bar chart.

const babar = require('babar');
const data = [
  { x: 0, y: 0 },
  { x: 1, y: 1 },
  { x: 2, y: 4 },
  { x: 3, y: 9 },
  { x: 4, y: 16 }
];
const options = {
  width: 40,
  height: 10,
  color: 'green'
};
console.log(babar(data, options));

Multiple Series

This feature allows you to plot multiple series of data on the same bar chart. The code sample demonstrates how to plot two different sets of data points on the same chart.

const babar = require('babar');
const data = [
  { x: 0, y: 0 },
  { x: 1, y: 1 },
  { x: 2, y: 4 },
  { x: 3, y: 9 },
  { x: 4, y: 16 }
];
const data2 = [
  { x: 0, y: 16 },
  { x: 1, y: 9 },
  { x: 2, y: 4 },
  { x: 3, y: 1 },
  { x: 4, y: 0 }
];
console.log(babar([data, data2]));

Other packages similar to babar

Keywords

FAQs

Package last updated on 12 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc