0.0.10 • Published 3 years ago

@lgv/activity-clock v0.0.10

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
3 years 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-31T18:05:55-04",
        "value": 3
    },
    {
        "timestamp": "2021-07-31T16:10:55-04",
        "value": 2
    }
]

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-31T18:05:55-04",
        "value": 3
    },
    {
        "timestamp": "2021-07-31T16:10:55-04",
        "value": 2
    }
]

// 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_CLOCK_RADIUSintegernumber of arcs in clock
LGV_RADIUSintegerouter radius of clock

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-annotationam/pm ring label
lgv-annotation-backgroundarc hour label background
lgv-annotation-hourarc hour label
lgv-annotation-hour-grouparc hour group
lgv-arcring arc element
lgv-arc-groupring arc group (label + shape)
lgv-containercontent margined from artboard
lgv-labelarc value 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 startdocker

# edit src/index.js
# add const ac = new ActivityClock(data);
# add ac.render(document.body);
# replace `data` with whatever data you want to develop with

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

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago