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

plutchik-reactjs-components

v1.4.2

Published

Plutchik emotional azimuth

Downloads

10

Readme

Library PLUTCHIK-REACTJS-COMPONENTS

How to use

Flower component

Pending component

Toaster component

Release notes

  • Release 1.2.3 (2024-08-08): Componets Toast and Toaster addedd

Components

Flower

Flower component is the simple way to present Plutchik vector. It has eight leafs. Each leaf if the basic emotion.

Flower properties

Member|Type|Mandatory|Description -|-|-|- vector|IEmotionVector|Yes|Vector to show on flower width|string|Yes|Width of ocmponent in css format gridArea|string|No|You can point to special grid area where the component must be shown

Pending

Pending component shows to user that internal process is to be countinued and user's input is unaccessable. Pending component has two methods incUse and decUse which increase or decrease internal count of use. If internal count of use is equal zero then component hides any its visible elements. If the internal count is positive then Pending component cover all accessable to it area of page from user input and shows the animation with plutchik wheel

Pending component Properties

The Pending component has no properties

Pending component Methods

| Method | Description | Parameters | |-|-|-| |incUse| Increase use counter. If internal counter of useness is more zero, then pending control is visible| No parameters| |decUse|Decrease internal use counter. If internal counter of useness is equal zero, then pending control is invisible| No parameters|

Pending component example

class App extends React.Component<{}, {}>{
    pendingRef: React.RefObject<Pending> = React.createRef();
    toDoSomethingAsync() {
        this.pendingRef.current?.incUse()
        asyncFuncWithCallback (param1, (success) => {
            this.pendingRef.current?.decUse()
            ...
        }, (error) => {
            this.pendingRef.current?.decUse()
            ...
        })
    }
    render: React.Node {
        return <div>
            <Pending ref={pendingRef}/>
        </div>
    }
}

Toast and Toaster

Toast is a pop-up window with message using to inform user about something. Toast can be of three types: info, warrning and error. Use ToastType enum for choosing toast's type. Toaster creates the Toasts by addToast method

Toaster

Toaster properties Member|Type|Mandatory|Description -|-|-|- placeCount|number|Yes|The count of places to arrange the toasts. This property is the count of toasts which are visible simultaneously

Toaster methods | Method | Description | Parameters | |-|-|-| addToast|Adds new Toast to the Toaster. See the IToast interface to configure th new Toast|newToast: IToast

IToast interface members

To create new Toast use the addToast method of Toaster class. addToast method has one parameter of IToast interface with members:

Member|Type|Mandatory|Description -|-|-|- type|string of ToastType enum|Yes|One of three types: info, warning, or error| code|number|No|Reserved for future use| message|string|Yes|Main message of toast. It's always visible if the toast is visible| description|string|No|Extra message. If description is defined then Toast has ∴ button. User can see the description if ∴ button clicked by user.| autohide|number|No| Count of seconds when the toast will be dissapeared without the user interaction. If autohide is undefined and the type of Toast is info, then Toaster set the 3 seconds to autohide as default| saveInHistory|boolean|No|If this parameter is set true then the Toast won't be deleted from Toaster on hide event. It will be marked as shown and will be saved in the Toaster for future use| modal|boolean|No|If Toaster has at least one not shown modal Toast then Toaster covers all accessible area and prohibit interaction with other elements on page. Use modal parameter if you want stop user interaction while user reads the message and close the Toast

How to use

Run command in command-line npm i plutchik-reactjs-components

Add string into your javascript or Typescript

import { Charts, ComplexEmotion, Emotion, Flower, Formula, Chart, IEmotionVector, Pending, Toaster, ToastType, } from 'plutchik-reactjs-components'