1.0.0 • Published 1 year ago

@lgv/radial-stacked-connections v1.0.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
1 year ago

Radial Stacked Connections

ES6 d3.js radial stacked column chart / connection hybrid visualization.

Install

# install package
npm install @lgv/radial-stacked-connections

Data Format

The following values are the expected input data structure.

[
    {
        "label": "item 1",
        "series1": 8,
        "series2": 2
    },
    {
        "label": "item 2",
        "series1": 1,
        "series2": 3
    },
    {
        "label": "item 3",
        "series1": 4,
        "series2": 8
    },
    {
        "label": "item 4",
        "series1": 4,
        "series2": 5
    }
];

Use Module

import { RadialStackedConnections } from "@lgv/radial-stacked-connections";

// have some data
let data = [
    {
        "label": "item 1",
        "series1": 8,
        "series2": 2
    },
    {
        "label": "item 2",
        "series1": 1,
        "series2": 3
    },
    {
        "label": "item 3",
        "series1": 4,
        "series2": 8
    },
    {
        "label": "item 4",
        "series1": 4,
        "series2": 5
    }
];

// initialize
const rsc = new RadialStackedConnections(data);

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

Environment Variables

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

NameTypeDescription
LGV_BRAND_NAMEstringlabel used in css class prefix

Events

The following events are dispatched from the svg element. Hover events toggle a class named active on the element.

TargetNameEvent
arcarc-clickon click
arcarc-mouseoveron hover
arcarc-mousemouton un-hover
nodenode-clickon click
nodenode-mouseoveron hover
nodenode-mousemouton un-hover

Style

Style is expected to be addressed via css. Any style not met by the visualization module is expected to be added by the importing component. The default brand is lgv.

ClassElement
<brand>-radial-stacked-connectionstop-level svg element
<brand>-contentcontent inside artboard inside padding
<brand>-arcarc
<brand>-arc-labelarc label
<brand>-connectioncurved path
<brand>-nodenode
<brand>-series-labelstack series label

Actively Develop

# clone repository
git clone <repo_url>

# update directory context
cd radial-stacked-connections

# run docker container
docker run \
  --rm \
  -it  \
  -v $(pwd):/project \
  -w /project \
  -p 8080:8080 \
  node \
  bash

# FROM INSIDE RUNNING CONTAINER

# install module
npm install .

# run development server
npm run example

# edit files in example/* or src/*

# view visualization in browser at http://localhost:8080
1.0.0

1 year ago

0.0.2

4 years ago

0.0.1

4 years ago