Skip to content
XING Yun edited this page Mar 27, 2018 · 2 revisions

Stream

Quick Reference

import { stream } from 'vizart-basic';
import 'vizart-basic/dist/vizart-basic.css';

const options = {
	chart: {
		height: 420,
			margin: { left: 30, right: 30, top: 10, bottom: 30 }
		},

	data: {
		s: { name: 'Department', type: 'string', accessor: 'dep'},
		x: { name: 'Age', type: 'string', accessor: 'age'},
		y: [ { name: 'Monthly Income', type: 'number', accessor: 'income'} ],
	}
};

const data = [
	{ age: 19, income: 9, dep: 'science' }
]

const chart = stream('#chart', options);
chart.render(data);

API

Method

wiggle()

transit to wiggle layout

silhouette()

transit to silhouette layout

divergent()

transit to divergent layout

Default options:

const DefaultOptions = {
  chart: {
    type: 'stream',
  },
  plots: {
    stackMethod: 'wiggle',
    highlightNodeColor: '#F03E1E',
    opacityArea: 0.7,
    dotRadius: 8,
  },
};

stackMethod

Stack method, could be 'wiggle', 'silhouette', or 'divergent'

highlightNodeColor

Node color when is highlighted

opacityArea

area opacity

dotRadius

node radius

Clone this wiki locally