Build a clock · Part 1 of 6
The face
A graphic, a circle and a stylesheet: the starting point for the clock.
Creating the graphic
VisQuill.create creates an SVG inside the given div. The
second argument, "clock-", is a prefix that VisQuill adds to every
class name, so the clock's CSS does not affect the rest of the page.
rvg.canvas is the group that everything is drawn into.
The face
canvas.visuals.circle("face") creates an empty circle visual
with the class clock-face. Circles.circleAt computes
a circle from a center and a radius and writes it into the visual, which is
passed as the last argument.
Most GDK functions work this way: the last argument receives the result. Without it, the function returns a new object.
Styles
Fill and stroke come from the stylesheet, not from the code. The rule for
.clock-face uses the prefix from VisQuill.create.
