Socket
Book a DemoInstallSign in
Socket

virtual-streamgraph

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

virtual-streamgraph

Create a virtual-dom stream graph

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

virtual-streamgraph stability

npm version build status test coverage downloads js-standard-style

Create a virtual-dom streamgraph. Useful to visualize time series data.

example

Usage

const vgraph = require('virtual-streamgraph')
const vdom = require('virtual-dom')
const hyperx = require('hyperx')
const hx = hyperx(vdom.h)

const data = [
  { name: 'apples', values: [ { x: 1, y: 55 }, { x: 2, y: 65 }, { x: 3, y: 67 }] },
  { name: 'bananas', values: [ { x: 1, y: 55 }, { x: 2, y: 65 }, { x: 3, y: 67 }] },
  { name: 'cherries', values: [ { x: 1, y: 55 }, { x: 2, y: 65 }, { x: 3, y: 67 }] },
  { name: 'dates', values: [ { x: 1, y: 55 }, { x: 2, y: 65 }, { x: 3, y: 67 }] }
]

const tree = hx`
  <section className="my-graph">
    ${vgraph({ height: 500, width: 960, data: data })}
  </section>
`
console.log(vdom.create(tree).toString())

API

vgraph(opts)

Create a new virtual-streamgraph from data. Opts can contain the following fields:

  • opts.data: set data to be rendered
  • opts.width: set width dimension of the graph
  • opts.height: set height dimension of the graph
  • opts.min: optional, set lower bound for graph
  • opts.max: optional, set upper bound for graph
  • opts.limit: optional, limit amount of data points to be displayed

See Also

Installation

$ npm install virtual-streamgraph

License

MIT

Keywords

stream

FAQs

Package last updated on 16 Feb 2016

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