npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@highcharts/dashboards

v2.1.0

Published

Highcharts Dashboards framework

Downloads

4,846

Readme

Highcharts Dashboards

A JavaScript library for interactive dashboards.

Installation

There are multiple ways to import this package. Among the most popular are:

  • Using npm, run the following command in your terminal:
    npm install @highcharts/dashboards

Then import the package in your project:

    import Dashboards from '@highcharts/dashboards';
  • Importing as a script
    <script src="https://code.highcharts.com/dashboards/dashboards.js"></script>

To fully utilize the Dashboards potential, there might be a need to load additional modules. In the installation documentation, you can find more information on how to do that and other ways of importing the Dashboards.

Components

Each dashboard is built with different components. You can add the most basic HTMLComponent where you can add some text, image etc. To create a chart you can add a HighchartsComponent. If you would like to show your data in a tabular way use the DataGridComponent. Or use the KPIComponent to highlight some individual numbers/indications.

To properly show the component you have to declare the id of a cell, where it should be placed and the type of that component. Below is an example of what a component configuration might look like:

    {
        type: 'Highcharts',
        cell: 'cell-id-2',
        chartOptions: {
            series: [{
                type: 'pie',
                data: [1, 2, 3, 2, 3]
            }]
        }
    }

In the component documentation, you can find more information on how each one of them works and what can be configured.

Working with Data

You can import your data from multiple sources, for example CSV and Google Spreadsheet. They are going to be handled by the Connectors and distributed as DataTables.

More about this concept in the Data Handling section.

GUI

The GUI is a part of the dashboard that allows you to create a layout of the dashboard. You can add rows and cells to the layout. The layout is a grid where you can place your components. Below is an example of what a GUI configuration might look like:

    gui: {
        layouts: [{
            id: 'layout-1',
            rows: [{
                cells: [{
                    id: 'dashboard-col-0'
                }, {
                    id: 'dashboard-col-1'
                }]
            }]
        }]
    }

More about the GUI in the documentation.

Edit Mode

Edit Mode allows the user to edit the dashboard by adding, removing and editing components.

Find more information in the Edit Mode documentation.

Your first dashboard

To create your dashboard, you first have to import the Dashboards package. You also need a placeholder for your dashboard. In this example we will use a div with the id container.

    <script src="https://code.highcharts.com/dashboards/dashboards.js"></script>

    <div id="container"></div>

Your dashboard can now be created:

    Dashboards.board('container', {
        gui: {
            layouts: [{
                id: 'layout-1',
                rows: [{
                    cells: [{
                        id: 'dashboard-col-0'
                    }, {
                        id: 'dashboard-col-1'
                    }]
                }]
            }]
        },
        components: [{
            type: 'html',
            cell: 'dashboard-col-0',
            elements: [
                {
                    tagName: 'h1',
                    style: {
                        height: '400px',
                        'text-align': 'center'
                    },
                    textContent: 'Your first dashboard'
                }
            ]
        }, {
            cell: 'dashboard-col-1',
            type: 'Highcharts',
            chartOptions: {
                series: [{
                    data: [1, 2, 3, 4]
                }]
            }
        }]
    });

See it in action: demo.

FAQ

Answers to common questions can be found on our FAQ page.