0.0.1 • Published 4 years ago

@lgv/dendrogram v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Dendrogram

ES6 d3.js dendrogram visualization.

Style

Style is expected to be addressed via css. The top-level svg is assigned a class lgv-dendrogram. Any style not met by the visualization module is expected to be added by the importing component.

Environment Variables

The following values can be set via environment or passed into the class.

NameTypeDescription
DIMENSION_HEIGHTintegerheight of artboard
DIMENSION_WIDTHintegerwidth of artboard
PARSE_DELIMETERstringseparator on source data hierarchy path value

Install

# install package
npm install @lgv/dendrogram

Dendrogram

Data Format

The following values are the expected input data structure.

[
    {
        id: "some|path",
        value: 1
    },
    {
        id: "some",
        value: 3
    }
]

Use Module

import { Dendrogram } from "@lgv/dendrogram";

// initialize
const dg = new Dendrogram(data);

// render visualization
dg.render(document.body);