1.2.0 • Published 11 months ago

@lgv/activity-clock v1.2.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
11 months ago

Activity Clock

ES6 d3.js activity clock visualization.

Install

# install package
npm install @lgv/activity-clock

Data Format

The following values are the expected input data structure.

[
    {
        "timestamp": "2021-07-31T16:05:55-04",
        "value": 1
    },
    {
        "timestamp": "2021-07-01T18:05:55-04",
        "value": 3
    },
    {
        "timestamp": "2021-07-30T16:10:55-04",
        "value": 2
    },
    {
        "timestamp": "2022-09-02T02:10:55-04",
        "value": 5
    }
]

Use Module

import { ActivityClock } from "@lgv/activity-clock";

// have some data
let data = [
    {
        "timestamp": "2021-07-31T16:05:55-04",
        "value": 1
    },
    {
        "timestamp": "2021-07-01T18:05:55-04",
        "value": 3
    },
    {
        "timestamp": "2021-07-30T16:10:55-04",
        "value": 2
    },
    {
        "timestamp": "2022-09-02T02:10:55-04",
        "value": 5
    }
]

// initialize
const ac = new ActivityClock(data);

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

Environment Variables

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

NameTypeDescription
LGV_HEIGHTintegerheight of artboard
LGV_WIDTHintegerwidth of artboard

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.

ClassElement
lgv-activity-clocktop-level svg element
lgv-arcarc element
lgv-contentcontent margined from artboard
lgv-labelarc value label element
lgv-label-arcarc label element
lgv-label-ringring label element

Actively Develop

# clone repository
git clone <repo_url>

# update directory context
cd activity-clock

# 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

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

11 months ago

1.1.1

1 year ago

1.0.2

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.1.3

11 months ago

1.0.4

1 year ago

1.1.2

1 year ago

1.0.3

1 year ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

5 years ago