Skip to content

Quick Start

guoyixing edited this page Apr 13, 2024 · 1 revision

Initialization

npm install chronos --save

Running

npm run dev

Packaging

npm run build

After packaging, the chronos.js file will be generated in the dist directory.

Usage

Introduce the chronos.js file into the html file.

<html>
    <head>
        <meta charset="UTF-8">
        <title>Chronos</title>
    </head>
    <body>
        <div id="chronos" style="width: 1000px; height: 1000px;"></div>
        <script type="module">
            import Chronos from 'chronos';
            
            // Get the mounted div
            const chronosDiv = document.getElementById('chronos');
            
            // Configure data, refer to the configuration document for detailed configuration
            let data = {};
            
            // Instantiate Chronos
            let chronos = new Chronos(chronosDiv, data);
        </script>
    </body>
</html>

Clone this wiki locally