Skip to main content

deephaven-plugin-clockface

A live clock for deephaven.ui panels, in seven faces — modern digital, seven-segment retro, analog, split-flap, binary, nixie tube and word clock. Every face is drawn from the Deephaven theme's own colors, so it fits whatever theme is in use.

A clock cycling through each of its faces

The clock ticks from the browser, so it keeps time without server round trips and a wall of clocks costs no more than one.

Install

pip install deephaven-plugin-clockface

Then restart the Deephaven server.

Usage

from deephaven import ui

from deephaven_plugin_clockface import clockface


@ui.component
def my_panel():
    return clockface()


my_clock = my_panel()

Pick a face, a time zone and a format:

clockface(face="analog", timezone="Asia/Tokyo", twenty_four_hour=True, show_date=True)

Faces

face Looks like
"digital" A modern digital readout. The default.
"retro" A seven-segment display, unlit segments and all.
"analog" A dial with hour, minute and second hands.
"flip" A split-flap board; each card flips as its digit changes.
"binary" Binary-coded decimal — one column of dots per digit.
"nixie" Glowing tube digits.
"word" The time spelled out, to the nearest five minutes: "quarter past ten".

Options

Option Type Default Notes
face str "digital" One of the faces above. An unknown name raises ValueError.
timezone str None IANA name, e.g. "America/New_York". Defaults to the viewer's.
twenty_four_hour bool False Ignored by "word", which always spells the hour in 12-hour form.
show_seconds bool True Ignored by "word", which reads to the nearest five minutes.
show_date bool False Adds a date line under the time.

timezone is read by the browser, so it accepts any zone the viewer's browser knows. An unrecognized name falls back to local time rather than blanking the clock.

A wall of clocks

Each instance keeps its own time, so a trading-desk row is just the component repeated:

from deephaven import ui

from deephaven_plugin_clockface import clockface

DESKS = [
    ("New York", "America/New_York"),
    ("London", "Europe/London"),
    ("Tokyo", "Asia/Tokyo"),
]


@ui.component
def desk_clocks():
    return ui.flex(
        *[
            ui.flex(
                ui.heading(city, level=4),
                clockface(face="flip", timezone=zone, twenty_four_hour=True),
                direction="column",
                align_items="center",
            )
            for city, zone in DESKS
        ],
        gap="size-400",
    )


world_clock = desk_clocks()

Letting the user pick a face

face is an ordinary prop, so anything Python can compute can drive it:

from deephaven import ui

from deephaven_plugin_clockface import FACES, clockface


@ui.component
def face_picker():
    face, set_face = ui.use_state("digital")

    return ui.flex(
        clockface(face=face),
        ui.picker(
            *[ui.item(name, key=name) for name in FACES],
            label="Face",
            selected_key=face,
            on_change=set_face,
        ),
        direction="column",
    )


picker = face_picker()

Examples

Runnable panels live in examples/:

Contributing

See AGENTS.md for the project layout and how to build, run and test it.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deephaven_plugin_clockface-0.1.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deephaven_plugin_clockface-0.1.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file deephaven_plugin_clockface-0.1.0.tar.gz.

File metadata

File hashes

Hashes for deephaven_plugin_clockface-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f3bdb759701eef6fab626cdbdf98b30dee44de5578713ee9913d7ae49fd2a1dc
MD5 f96bf1c2a3d0d8b06e30dfc67e17c6e9
BLAKE2b-256 1431a9f53b094dc39d7127a8ad494dc236f4d41a2d725acc783150fa1d742b55

See more details on using hashes here.

Provenance

The following attestation bundles were made for deephaven_plugin_clockface-0.1.0.tar.gz:

Publisher: publish.yml on mofojed/deephaven-plugin-clockface

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deephaven_plugin_clockface-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for deephaven_plugin_clockface-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e889d0782bf31f3098760a1608672d56e96bd5c6a78d88f92ca095ff4066470f
MD5 0f4e4d0b61fbeb9e613590694f08151b
BLAKE2b-256 b86a63da42a203744a1fb2a97573cc4bb163aeaad639eb45ae3979afdc7a6fbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for deephaven_plugin_clockface-0.1.0-py3-none-any.whl:

Publisher: publish.yml on mofojed/deephaven-plugin-clockface

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page