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

d3-chosen

v2.0.2

Published

[![image](https://img.shields.io/badge/component-vanilla-green.svg?style=flat-square)](https://github.com/pemrouz/vanilla/#vanilla) [![Build Status](https://travis-ci.org/pemrouz/d3-chosen.svg)](https://travis-ci.org/pemrouz/d3-chosen) <br>[![Browser Re

Downloads

10

Readme

d3-chosen

image Build Status Browser Results

A lean collection of lookup and select components. Highlights:

Usage

lookup-multiple

State

  • options = []: An array of all options. The options can be strings or objects.

  • value = []: The current value of the component: this will be a subset of options.

  • placeholder = '': The placeholder label to display.

  • match: This function should return true or false for every option to determine whether the item should be visible or not. By default, it does case-insensitive fuzzy filtering. For example, "js" would match "JavaScript".

  • focused = false: The current focused state of the component

  • renderer: This function is used to render each individual option. By default, it underlines the parts of the text that match the fuzzy filter.

  • val =str: This function returns the value of an option. If your options are an array of objects, this is used by the default matching function and to determine the label to display for each option. For example:

{ options: [ { firstname: 'John', lastname: 'Smith' } , { firstname: 'Jane', lastname: 'Smith' } , { firstname: 'Jack', lastname: 'Smith' } ] , val: d => d.firstname + ' ' + d.lastname }


* **`suggestion`**: The index of the currently suggested option. This is used internally, you will rarely set this.

* **`query = ''`**: The text currently entered into the textfield

<br>
### Events

* **`change`**: Notifies of all changes to the value (select and deselect).

* **`select`**: Notifies when an option has been selected. `e.detail` is the selected option.

* **`deselect`**: Notifies when an option has been deselected. `e.detail` is the deselecte option.

---
# `lookup-single`

<img src="https://cloud.githubusercontent.com/assets/2184177/18619331/7b52c876-7df1-11e6-80ee-7275b5fa2280.gif" width="300">

### State

* **`options = []`**: An array of all options. The options can be strings or objects. 

* **`value = []`**: The current value of the component: this will be an element in `options`.

* **`placeholder = ''`**: The placeholder label to display.

* **`query = ''`**: The text currently entered into the textfield.

* **`match`**: This function should return `true` or `false` for every option to determine whether the item should be visible or not. By default, it does case-insensitive fuzzy filtering. For example, "js" would match "JavaScript".

* **`focused = false`**: The current focused state of the component

* **`renderer`**: This function is used to render each individual option. By default, it underlines the parts of the text that match the fuzzy filter.

* **`val =`[`str`](https://github.com/utilise/utilise#--str)**: This function returns the value of an option. If your options are an array of objects, this is used by the default matching function and to determine the label to display for each option. For example:

  ```js
{ 
  options: [
    { firstname: 'John', lastname: 'Smith' }
  , { firstname: 'Jane', lastname: 'Smith' }
  , { firstname: 'Jack', lastname: 'Smith' }
  ]
, val: d => d.firstname + ' ' + d.lastname
}
  • suggestion: The index of the currently suggested option. This is used internally, you will rarely set this.
  • change: Notifies of all changes to the value.

  • blur: Notifies components has lost focus.


select-multiple

// TODO

select-single


// TODO