Installation

Datum is distributed as an ES module and can be installed with npm or loaded directly in the browser.

Install with npm

Install Datum from npm:

npm install @psdpainter/datum-js

Import Datum

Import the library from your application code:

import {
    Datum,
    Color
} from '@psdpainter/datum-js';

Import the stylesheet

Datum includes the styles required by its visualization components. Import the stylesheet once in your application:

import '@psdpainter/datum-js/style';

Browser usage

Datum also ships an IIFE build for applications that load JavaScript directly with a script element.

<link
    rel="stylesheet"
    href="/path/to/datum.css"
/>

<script src="/path/to/datum.min.js"></script>

The browser build exposes Datum through the globalDatum object.

Package contents

The npm package includes the ES module, browser build and Datum stylesheet.

dist/
├── datum.js
├── datum.min.js
└── datum.css