Skip to content

michaellyons/react-launch-line

Repository files navigation

React Launch Line

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

PeerDependencies Dependencies DevDependencies

Prerequisites

You should be using NodeJS and ReactJS

Installation

React Launch Line is available as an npm package.

npm install react-launch-line [-S]

or

yarn add react-launch-line

Usage

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

import React from 'react';
import { LineChart } from 'react-launch-line';

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

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

export default MyAwesomeReactComponent;

Customization

Key Required Type Description
height Y Integer/String This will set the total height of the chart.
width Integer/String This will set override the width of the chart.
value Number This will set override the width of the chart.
high Number This value determines the upper-region that fills red.
max Number This sets the ceiling of the chart's scale
title String Title of the chart.
titleStyle Object Style for title text (SVG Text).
progressStyle Object Style for progress bar (SVG rect)
style Object Style that is passed to SVG.
wrapStyle Object Style for wrapper div (div).

About

React wrapper for D3 Line Charts with styles inspired by SpaceX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published