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

velocity-dashboard

v2.0.3

Published

Velocity Dashboard is a React component for presenting interactive dashboard components.

Downloads

24

Readme

Velocity Dashboard

Velocity Dashboard is a React component for presenting interactive dashboard components.

Features

  • Responsive design
  • User can add/remove instances
  • Allows multiple instances of each widget
  • Widgets define relative height & width in the grid
  • Configurable column and row height
  • Easily re-styled

Links

Usage

For React 15 & older use

npm i -D [email protected]

For React 16+ use

npm i -D [email protected]

Prerequisites

The default style assumes font-awesome is installed.

Include the velocity-dashboard css in your page.

@import (inline) "../../node_modules/velocity-dashboard/dist/dashboard.css";

If you are using charts then include chartist css

@import (inline) "../../node_modules/chartist/dist/chartist.css";

Dashboard

For best results, use CSS to give the Dashboard a definable size (either via absolute positioning or by setting height/width).

class MainDashboard extends React.Component {
    constructor(props) {
        super(props)
        this.state ={
            config: [
                {
                    widgetId: 'weather'
                    instanceId: '1'
                    config: location: 'orl'
                }
            ]
        }
    }

    render(){
        return <Dashboard className='example-dash' title='Dashboard Title' 
                config={this.state.config} onConfigChange={this.configChange}>
            <Widget id='weather' contentComp={weatherWidget.Content} 
                configComp={weatherWidget.Config} previewComp={weatherWidget.Preview} />
            ...
        </Dashboard>
    }
}

Properties

| property | default | description | | ---------------- |:---:| -----| | title | - | if provided, a title bar will be rendered at the top with the given text | | config | - | (required) contains the widget instances and the configuration for the instances. For the sake of usability, a reasonable initial value should be provided. If not, the user will not have any widgets in the dashboard until they add them. This data structure is what you would save in the user's preferences. | | onConfigChange | - | fires when the user updates the widgets on the screen (by adding/removing them or by configuring one) | | widgetHeight | 250 | height of a single row in pixels | | widgetWidth | 250 | width of a single column in pixels | | widgetMargin | 15 | gap between widgets in pixels | | titleHeight | 50 | height of the title | | maxColumns | 5 | when displayed on a high-resolution (wide) screen, limit the number of columns to this value (for usability/ascetics) | | doneButtonClass | - | custom class to override the 'done' button rendered on edit widget config e.g. 'btn btn-primary' |

config

| property | description | | ---------------- | ----- | | widgetId | (required) Reefers to the Widget's id. | | instanceId | (required) Uniquely identifies the instance and is used as a React key. | | config | Passed to the component as configuration |

Widget

Each Widget is simply three components representing the three states of a component and some configuration details:

<Widget id='days-since-accident'
    contentComp={() => <div className='days-since-last'>
        <div className='days'>13</div>
        <div className='text'>days since last accident</div>
    </div>}
    previewComp={ () => <div className='days-since-last preview'>
        <div className='days'>100</div>
        <div className='text'>days since last accident</div>
        </div>
    }/>

Properties

| property | default | description | | ---------------- |:---:| -----| | id | - | Unique identifier for this widget. Used to in the Dashboard state (referred to as widgetId). | | width | 1* | The number of columns this Widget will span. The default can be overridden as a property here, or in the widget configuration by adding a property width. | | height | 1* | The number of rows this Widget will span. The default can be overridden as a property here, or in the widget configuration by adding a property height. | | contentComp | - | The widget as normally displayed on the dashboard | | previewComp | - | (optional) The widget as displayed in the 'add widget' panel (usually a simplified version which doesn't depend on external data). While optional, the default is simply a 'No Preview' message. A previewComp is recommended for all Widgets. | | configComp | - | (optional) The configuration screen |