1.2.0 • Published 11 months ago
@lgv/activity-clock v1.2.0
Activity Clock
ES6 d3.js activity clock visualization.
Install
# install package
npm install @lgv/activity-clockData 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.
| Name | Type | Description |
|---|---|---|
LGV_HEIGHT | integer | height of artboard |
LGV_WIDTH | integer | width 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.
| Class | Element |
|---|---|
lgv-activity-clock | top-level svg element |
lgv-arc | arc element |
lgv-content | content margined from artboard |
lgv-label | arc value label element |
lgv-label-arc | arc label element |
lgv-label-ring | ring 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:80801.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