0.1.1 • Published 7 years ago

react-launch-bar v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

React Launch Bar

Inspired by SpaceX's clean display for live launch telemetry.

PeerDependencies Dependencies DevDependencies

Github Page

Prerequisites

You should be using NodeJS and ReactJS

Installation

React Launch Bar is available as an npm package.

npm install react-launch-bar [-S]

or

yarn add react-launch-bar

Usage

Using React Launch Bar is very straightforward. Once it is included in your project, you can use the components this way:

import React from 'react';
import { BarChart } from 'react-launch-bar';

let data = [
  { value: 40, max: 50, color: 'red'},
  { value: 20, max: 50, color: 'blue'},
  { value: 30, max: 50, color: 'green'},
  ...
]

const MyAwesomeReactComponent = () => (
  <BarChart title={'Points'} data={data} />
);

export default MyAwesomeReactComponent;

Customization

KeyRequiredTypeDescription
heightYInteger/StringThis will set the total height of the chart.
widthInteger/StringThis will set override the width of the chart.
valueNumberThis will set override the width of the chart.
highNumberThis value determines the upper-region that fills red.
maxNumberThis sets the ceiling of the chart's scale
titleStringTitle of the chart.
titleStyleObjectStyle for title text (SVG Text).
progressStyleObjectStyle for progress bar (SVG rect)
styleObjectStyle that is passed to SVG.
wrapStyleObjectStyle for wrapper div (div).