Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clockd3js

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clockd3js

Clock writen with d3js

  • 0.0.71
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

NameTypeDescriptionDefault
parent_idStringparent div idclock
show_main_circleBooleandetermines whether to show a clock circlefalse
show_hoursBooleandetermines whether to show hoursfalse
hoursArrayhours display array[12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
time_formatStringformat of digital time (d3 formats)%H:%M:%S
timesArraytime intervals to show on clock[ ]
dark_modeBooleanclock dark modefalse

Methods

NameDescriptionParamsReturn
showDigitTimewill show the digital time on the clockClock
setTextset text above the center point of the clocktext: String, link: StringClock
drawappends Clock on the pagevoid

Keywords

FAQs

Package last updated on 05 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc