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

peel-dashboard-kit

v3.1.3

Published

[![npm version](https://badge.fury.io/js/angular2-expandable-list.svg)](https://badge.fury.io/js/angular2-expandable-list) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier

Downloads

831

Readme

npm version code style: prettier

Peel Dashboard Kit

Library for embedding Peel's dashboard in third party applications.

Prerequisites

This project requires NodeJS (version 8 or later) and NPM. You can install them from here Node and NPM.

To make sure you have them available on your machine, try running the following command.

$ npm -v && node -v
6.4.1
v8.16.0

React >=16 is also needed.

Installation

$ cd PROJECT
$ npm i peel-dashboard-kit

Usage

Example with custom columns layout:

import { PeelDashboard } from 'peel-dashboard-kit'

const App = () => {
  return (
    <div className="App">
      <PeelDashboard
        dashboardID="f123d932215e74e2b6dcfdf710be923f1eda9a8d"
        studyID="43"
        token={/* YOUR_PEEL_DASHBOARD_TOKEN */}
      />
    </div>
  );
};

Peel dashboard kit props


/*
  ID of the dashboard that is being shown
*/
dashboardID: string = ''

/*
  ID of the study the dashboard belongs to
*/
studyID: string = ''

/*
  base url for api requests (token has to be generated for the particular host)
*/
host?: string = 'https://app.peelinsights.com'

/*
  grouping string that specifies the grouping option for the dashboard. Useful when grouping is selected outside the peel dashboard component
*/
goruping?: string: DAY | WEEK | MONTH | QUARTERLY | YEAR | WEEKDAY | ROLLING_7DAY | ROLLING_30DAY | ROLLING_6WEEK | WEEK_TO_DATE | MONTH_TO_DATE | QUARTER_TO_DATE | YEAR_TO_DATE | PACING.

/*
  An array string with start and end dates to filter the information from the dashboard.
  format: YYYY-MM-DD
  e.g.: ['2023-10-01', '2023-12-01']
*/
customDatesRange?: Array<string> = false;

/*
  This prop enables showing the filters on the dashboard.
  Filters include a datepicker and a time grouping.
*/
showFilters?: boolean = false;

/*
  This prop enables showing the header of the dashboard,
  which displays the dashboard name and the description.
*/
showHeader?: boolean = false;

/*
  If set to true, it shows the read only version of a dashboard.
  It hides the edit widget button on hover.
*/
isReadOnly?: boolean = false;

/*
  If set to true, it shows a spinner indicator.
*/
isLoading?: boolean = false;

/*
  flag that tells the peel dashboard kit when to go fetch multi metric widget information again.
  When set to true it fetches the multi metric widget information again.
  Useful when stats are added/removed from the outside and we need to update the widget without having to refresh the page
*/
reloadMultiline?: boolean = false

/*
  This prop sets the rowHeight of react-grid-layout.
  refer to https://github.com/react-grid-layout/react-grid-layout
*/
rowHeight?: number = 150;

/*
  Margin between items [x, y] in px.
  refer to https://github.com/react-grid-layout/react-grid-layout
*/
margin: ?[number, number] = [10, 10]


// Number of columns in this layout.
// refer to https://github.com/react-grid-layout/react-grid-layout
cols: ?number = 12,

/*
  Theme prop currently support 'default' theme which has the look and feel of Peel, and the 'polaris' theme which has the shopify polaris look and feel
*/
theme?: string = 'default'

/*
  chartColors prop is an array of strings that accepts n colors for the different segments of the charts
*/
chartColors?: Array<string> = 'https://app.peelinsights.com'

/*
  If set to true, it shows headlines on each widget. If set to false it only shows the descriptions.
*/
showInsightsAndAnnotations?: boolean = false

/*
  Callback function when the edit widget button is clicked.
  widget: widget information of the current widget on which the user clicked the edit button
  callback: callback function that the user can execute once edition has been made on the widget. It expects either newWidget information
  or newLayout information. (newWidget, newLayout) => void
*/
onEditWidget?: (widget, callback) => void

/*
  Callback function when the user clicks on "Ask Differently" button. This happens when the AI couldn't generate a response for a query.
  It sends the newQuery string, which is the new query/question the user is asking.
*/
onAskDifferently?: (newQuery: string) => void

/*
  Callback function that executes when the user clicks "Talk to Human" button when the AI couldn't create a response for the query.
  e.g. you can open up intercom chat on this callback
*/
onTalkToHuman?: () => void

Run storybook

npm run storybook

Deploy a new version to npm

Create locally the dist folder which gets published to npm

npm run build-lib

Publish the new version to npm

npm publish

Test new version locally (without publishing it to npm)

Create locally the dist folder which gets published to npm

npm run build-lib

Create .tgz file on the destination project/folder. This creates a .tgz file in the destination folder that exists in the create-pack script. You might to change that destination folder to match your own local folder.

npm run create-pack

Install the version inside the project

Once you created the tgz file, make sure to change the peel-dashboard-kit reference in the package.json to point to that file.

// package.json
//...
"peel-dashboard-kit": "file:[email protected]"
//...

Then run:

npm install

Note on React 18 and strict mode.

google-map-react has a known bug when using React 18 and strict mode.

We use google-map-react to display the audience widget on dashboards.

A workaround to make the audience widget work on React 18 is to disable strict mode by removing <React.StrictMode>...</React.StrictMode>

License

MIT License