Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

@times-visuals/line

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@times-visuals/line

Line chart

latest
npmnpm
Version
1.2.0
Version published
Weekly downloads
4
-20%
Maintainers
2
Weekly downloads
 
Created
Source

Line chart

A line chart with various styling options, and annotation support

Installation

# Yarn
$ yarn add @times-visuals/line

# npm
$ npm add @times-visuals/line

Usage

Required parameters:

  • data: an array of objects containing at least two key/value pairs (one for the x axis, one for the y axis)
  • yDomain: an array of two integers we'll use to set the domain of the y axis
import Line from '@times-visuals/line';

// simplest version
export default () => <Line data={data} yDomain={[0,100]} />;

// area chart with a custom curve
export default () => <Line data={data} curve='curveBasis' area={true} yDomain={[0, 100]} />;

// area chart with y axis formatted as percentages
export default () => <Line
      data={data}
      curve='curveBasis'
      area={true}
      percentage={true}
      yDomain={[0, 100]}
    />;

// the above, with an annotation (see section below)
export default () => <Line
  data={data}
  curve='curveBasis'
  area={true}
  percentage={true}
  yDomain={[0, 100]}
  annotation={annotation}
/>;

Annotations must be of this format:

const annotation = {
  title: "this is an annotation",
  x: new Date("2018-06-01"),
  y: 50,
  dx: 20,
  dy: -30
};

FAQs

Package last updated on 14 Jun 2019

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