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

jupyterlab_toastify

v4.2.1

Published

Integrate 'react-toastify' nicely in JupyterLab.

Downloads

456

Readme

jupyterlab_toastify

Binder GitHub CI npm

Integrate react-toastify nicely in JupyterLab.

example

Installation

This package is not a JupyterLab extension but a regular npm package. So to add it to your project:

jlpm add jupyterlab_toastify

Usage

import { INotification } from 'jupyterlab_toastify';

// Error message notification - do not close automatically
INotification.error('Error');
// Warning message notification - do not close automatically
INotification.warning('Warning');
// Info message notification
INotification.info('Info');
// Success message notification
INotification.success('Success');

// Background task with progression animation
let id = await INotification.inProgress('Task in progress!');
// -> Update text
INotification.update({
  toastId: id,
  message: 'Updating task...'
});
// -> Update text, status and set closing delay (in ms)
INotification.update({
  toastId: id,
  message: 'Task succeed',
  type: 'success',
  autoClose: 3000
});

// Notification with two buttons
INotification.error('Error with button', {
  buttons: [
    {
      label: 'Action1',
      callback: () => alert('Action1 was clicked')
    },
    {
      label: 'Action2',
      callback: () => alert('Action2 was clicked')
    }
  ]
});

// Close a toast specified by its id
INotification.dismiss(id);

// Close all toasts
INotification.dismiss();

// Default call using `toast` function
// See https://github.com/fkhadra/react-toastify
INotification.notify('Default');

To close a notification, click on the close button.

Prerequisites

Installation

This is a pure NPM package since v4. You don't need to install a JupyterLab extension.

The toast container will be added to the DOM automatically by react-toastify.

All functions are asynchronous as react-toastify is lazy loaded if required.

Changelog

v4.2.0

  • Update to react-toastify v7
  • Security updates:
    • Bump ini from 1.3.5 to 1.3.8 (#14)
    • Bump ssri from 8.0.0 to 8.0.1 (#15)
    • Bump hosted-git-info from 2.8.8 to 2.8.9 (#16)
    • Bump lodash from 4.17.20 to 4.17.21 (#17)
    • Bump ws from 7.4.5 to 7.4.6 (#19)
    • Bump normalize-url from 4.5.0 to 4.5.1 (#20)
    • Bump tar from 6.1.0 to 6.1.5 (#21)

v4.1.2

  • New feature:
    • Support JupyterLab 3

v4.1.1

  • Bug fixes:
    • Remove dependency on @jupyterlab/ui-components

v4.1.0

  • Features
    • Use SVG icons

v4.0.0

  • Features
    • react-toastify v5 introduces the ability to add the toast container automatically. This extension uses that ability to remove the need of having a dedicated JupyterLab extension to be installed by users.
    • Lazy load react-toastify => all functions are asynchronous
    • Bump to react-toastify v6

v3.0.0

Port to JupyterLab v2

v2.3.1

  • BUG INotification.warning does not accept options.
  • Respect latest extension cookiecutter parameters

v2.3.0

  • Port to JupyterLab v1

v2.2.0

  • Different corrections
  • buttons optional in update
  • dismiss is visible through the INotification proxy

v2.1.0

  • Update to JupyterLab 0.35
  • Update to react-toastify 4.4 => change enum for notifications type to react-toastify\TypeOptions

v2.0.0

  • API change: helper functions accept options in addition to the message
  • API change: update requires object as input and not a lot of arguments
  • New option buttons to add buttons with custom callback to the notification

v1.x

  • First version using react-toastify
  • Five scenarii:
    • Error
    • Warning
    • Info
    • Success
    • InProgress

Development

For a development install (requires npm version 4 or later), do the following in the repository directory:

npm install
npm run build
jupyter labextension install .

To rebuild the package and the JupyterLab app:

npm run build
jupyter lab build