Skip to content

bi partite

XING Yun edited this page Mar 28, 2018 · 2 revisions

Bi Partite

Quick Reference

import { biPartite } from 'vizart-path';
import 'vizart-path/dist/vizart-path.css';

const options = {
	data: {
		source: {
			name: 'product',
			type: 'string',
			accessor: 'product'
		},

		target: {
			name: 'customer',
			type: 'string',
			accessor: 'customer'
		},

		links: [
			{
				name: 'volume',
				type: 'number',
				accessor: 'volume'
			},
			{
				name: 'profit',
				type: 'number',
				accessor: 'profit'
			}
		],
	},
};

const _data = ...
const _chart = biPartite('#chart', options);
_chart.render(_data);

API

Default options:

{
    chart: {
        type: 'biPartite',
    },
    animation:{
        duration: {
            partite: 500,
        }
    },
    data: {
        source: {
            name: null,
            type: FieldType.STRING,
            accessor: null,
        },

        target: {
            name: null,
            type: FieldType.STRING,
            accessor: null
        },

        links: [
            {
                name: null,
                type: FieldType.NUMBER,
                accessor: null
            },
            {
                name: null,
                type: FieldType.NUMBER,
                accessor: null
            }
        ],
    },
    color: DefaultCategoricalColor,
    plots: {
        buffMargin: 1,
        minHeight: 14,
        gap: 110,
    }
}

plots.buffMargin

margin. 1 by default

plots.minHeight

minimum height of rects. 14 by default

plots.gap

determines gap between rects. 110 by default

Clone this wiki locally