# clockd3js

> Clock writen with d3js

Latest version **0.0.71** (published 2020-07-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install clockd3js
pnpm add clockd3js
yarn add clockd3js
bun add clockd3js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.71 |
| Published | 2020-07-05 |
| First published | 2020-04-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sumarokov.world |
| Maintainers | sumarokov.world |
| Keywords | clock, d3js, d3 |

## Links

- npm: https://www.npmjs.com/package/clockd3js
- Repository: https://github.com/SumarokovV/Clockd3js
- Homepage: https://github.com/SumarokovV/Clockd3js#readme
- Issues: https://github.com/SumarokovV/Clockd3js/issues
- npm.io page: https://npm.io/package/clockd3js

## Dependencies (1)

- [d3](https://npm.io/package/d3.md) ^5.16.0

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 0.0.71 (latest) — 2020-07-05
- 0.0.7 — 2020-07-05
- 0.0.61 — 2020-06-16
- 0.0.6 — 2020-05-25
- 0.0.51 — 2020-04-30
- 0.0.5 — 2020-04-28
- 0.0.4 — 2020-04-25
- 0.0.3 — 2020-04-24
- 0.0.2 — 2020-04-24
- 0.0.1 — 2020-04-24

## README

# Clockd3js
Clock writen with d3js


**Installing clock from npm**

`npm i clockd3js`

**Usage**

```
import {Clock} from "clockd3js"
...

const clock = new Clock();
// or
const clock = new Clock({
  parent_id: "custom-clock",
  show_main_circle: false,
  show_hour: false,
  dark_mode: true,
  times: [
    {start: "07:20", end: "07:45", name: "Breakfast", color: "blue"},
    {start: "13:00", end: "14:00", name: "Dinner", color: "lightgreen", opacity: 1},
    {start: "20:00", end: "21:30", name: "Sport", width: 50}
  ]
});
// or
const clock = new Clock({
  hours: [12,,, 3,,, 6,,, 9] // or ["XII",,, "III",,, "VI",,, "IX"]
});

clock.draw();
// or
clock
  .showDigitTime()
  .setText("It's your time!", "https://your-own-site")
  .draw();

```

**Constructor params**
Name|Type|Description|Default
----|----|-----------|-------
parent_id|String|parent div id|clock
show_main_circle|Boolean|determines whether to show a clock circle|false
show_hours|Boolean|determines whether to show hours|false
hours|Array|hours display array|[12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
time_format|String|format of digital time ([d3 formats](https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format))|%H:%M:%S
times|Array|time intervals to show on clock|[ ]
dark_mode|Boolean|clock dark mode|false

**Methods**

Name|Description|Params|Return
----|-----------|------|------
showDigitTime|will show the digital time on the clock||Clock
setText|set text above the center point of the clock|text: String, link: String|Clock
draw|appends Clock on the page||void

---
_Source: https://npm.io/package/clockd3js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
