js-curling-scoreboard / Exports
A standalone, dependency-free JavaScript module for rendering a curling scoreboard. This package supports club-style, baseball-style, and simple scoreboard layouts.
For API documentation, see API Docs.
To show a scoreboard, you need at minimum a container (any HTMLElement
) and a GameState
.
Here's a minimal example:
const container = document.getElementById("scoreboardContainer");
scoreboard.render(container, {ends: []});
For a more full-featured example, open the file index.html
in a browser.
In the dist/
folder you will find both unminified and minified scripts.
The output file is a UMD JavaScript module. You can import this with most bundlers or module loaders. Or, you can directly load it in a <script>
tag, which will generate a global variable called scoreboard
exposing all of the module's exports. See index.html
for an example.