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

@nteract/jupyter-widgets

v4.1.19

Published

Transform for rendering Jupyter-JS-Widgets in output areas.

Downloads

2,985

Readme

@nteract/jupyter-widgets

Note: The implementation of @nteract/jupyter-widgets is currently in-progress. Please follow this issue.

This package exposes a React component for rendering ipywidgets into a notebook application. It also exposes components for building custom widget renderers.

Installation

$ yarn add @nteract/jupyter-widgets
$ npm install --save @nteract/jupyter-widgets

Note: The connected (to Redux) components in this package depend on some of the APIs provided in the @nteract/core package. This package depends on a certain version of @nteract/core but you can target a particular version by modifying your lock file.

Usage

import WidgetDisplay from "@nteract/jupyter-widgets";

export default class MyNotebookApp extends ReactComponent {
  render() {
    return <WidgetDisplay data={{ model_id: "widget-model-guid" }} />;
  }
}

Documentation

The jupyter-widgets package supports two types of widgets:

The WidgetDisplay component has an additional prop named customWidgetLoader to provide custom loaders for fetching 3rd party widgets. A reference implementation for a custom loader which serves as the default for this package can be found in widget-loader.ts.

customWidgetLoader?: (moduleName: string, moduleVersion: string) => Promise<any>;

Custom Widgets

Since custom widgets are hosted on CDN, we set https://unkpg.com as our default CDN Base URL. The default base URL can be overriden by specifying another URL via the HTML attribute "data-jupyter-widgets-cdn" on any script tag of the page.

For instance if your JavaScript bundle is loaded as bundle.js on your page and you wanted to set jsdelivr as your default CDN url for custom widgets, you could do the following:

<script data-jupyter-widgets-cdn="https://cdn.jsdelivr.net/npm" src="bundle.js"></script>

Note: Custom widgets are fetched and loaded using the requireJS library. Please ensure that the library is loaded on your page and that the require and define APIs are available on the window object. We attempt to detect the presence of these APIs and emit a warning that custom widgets won't work when requirejs is missing.

Support

If you experience an issue while using this package or have a feature request, please file an issue on the issue board and add the pkg:jupyter-widgets label.

License

BSD-3-Clause