Skip to content

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

d3clock

An analog clock implementation in d3.

Live demo

d3clock

Read the post here

I borrowed some ideas from:

Usage:

Call d3clock(config) for each clock instance

Load D3 (CDN or local)

d3clock expects D3 to be loaded before d3clock.js.

CDN (current example uses D3 v7):

<script src="https://cdn.jsdelivr.net/npm/d3@7.9.0/dist/d3.min.js" charset="utf-8"></script>
<script src="d3clock.js"></script>

Local file (for offline/dev usage):

<script src="./vendor/d3.min.js" charset="utf-8"></script>
<script src="d3clock.js"></script>

Example local layout:

index.html
d3clock.js
vendor/d3.min.js

eg:

d3clock({
	target:'#chart1',
	face:'modern',
	width:1000,
	// date:'Mon May 25 2015 10:09:37',
	TZOffset:{
		hours:0
	}
});

You can create several instances in a page (for showing multiple time zones, for example)

If you send a date value in the config object, it shows a fixed time (good for testing)

Available faces

  1. sbb: The famous Swiss Railway Clock
  2. modern: A somewhat modern/minimalist face
  3. braun: A Braun BN0021-ish face

About

an analog clock implementation in d3

Resources

Stars

18 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages