Skip to main content

Installation

Installation options include:

Option 1: Using a bundler

Install from npm

npm install racing-bars

then you can import it:

import { race } from "racing-bars";

race("/data.json", "#race", { /* options */ });

Option 2: Load from CDN

ESM

<div id="race" style="height: 80vh"></div>
<script type="module">
import { race } from "https://cdn.jsdelivr.net/npm/racing-bars";

race("/data.json", "#race", { /* options */ });
</script>

UMD

<div id="race" style="height: 80vh"></div>
<script src="https://https://cdn.jsdelivr.net/npm/racing-bars/racing-bars.umd.js"></script>
<script>
// the UMD version provides the global object `racingBars`
racingBars.race("/data.json", "#race", { /* options */ });
</script>