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 🙏

© 2026 – Pkg Stats / Ryan Hefner

integration-widget-pie-chart

v1.3.0

Published

A template for a pie chart widget

Readme

Pie chart My TS widget template

A template to build a pie chart widget.

Prerequisites

  • git
  • node 8.12
  • yarn 1.10.1

Commands

All those commands must be run in a terminal in the repository folder.

Download the dependencies

yarn install

Build the package for production

yarn build

Build the package for debug

yarn build:debug

Build the package for debug and watch for file modifications

yarn watch

Launch the testing tool

yarn display

When the widget is successfully built, it creates a folder dist with a main.bundle.js inside. When the widget is ready you can send the file to Talentsoft.

Project description

package.json: node package description

tsconfig.json: typescript compiler options

webpack.config.js: build setup

widget.conf.json: the widget configuration. The widgetName key identifies this widget for talentsoft.

resources: contains one file per supported language. Each file must contain the same set of resource keys and the corresponding text in the file's language.

asset: contains the less files needed for the widget display.

app: contains the app code. The main file (as configured in webpack.config.js is widget.tsx). This file must export a Widget class the defines a react component.

Css management

All style information must be included in the javascript bundle. With this project you can acheive this behavior by importing less files (see import '../asset/widget.less'; in widget.tsx). The less will be compiled to css and put into a function that will insert it in the widget's html body when it is loaded.

If you want to use a different preprocessor or directly css you can edit the webpack configuration.

Host api

The widget receive a number of properties that allows it to communicate with the host page. It receives data (current language, display mode, etc) and can send information using the provided methods (eg to notify the host that the loading has finished).

You can find the host api reference here: Host api reference

Testing

You can use the widget display tool to test a widget. Please see this link for more information.