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

formula1

v1.0.2

Published

A form library based on react-bootstrap v3

Downloads

1

Readme

Formula1

A form library based on react-bootstrap v3

Components:

Tree

A hierarchical tree structure that allows navigation through search and expand/collapse. Selection can be any node in the tree or can be limited to leaf nodes only.

JSON data is passed in to populate the tree.

{
    "name": "Associations",
    "value": null,
    "children": [
        {
            "name": "Platforms",
            "value": null,
            "type": 9,
            "children": [
                {
                    "type": 9,
                    "name": "Brain Simulation Platform",
                    "value": 2
                },
                {
                    "type": 9,
                    "name": "High Performance Analytics and Computing Platform",
                    "value": 3
                }
                .
                .
                .
            ]
        },
        {
            "name": "Website Categories",
            "value": null,
            "type": 16,
            "children": [
                {
                    "type": 16,
                    "name": "Understanding Cognition",
                    "value": 4
                }
                .
                .
                .
            ]
        }
        .
        .
        .
    ]
}

The visible labels for the nodes are specified by mappingLabel.

The callback method is specified by onSelect.

The value passed to the callback method on node selection is specified by mappingValue.

An example of rendering the tree:

  render() {
    return (
      <div>
        <Tree
          data={this.tree}
          onSelect={this.onSelect.bind(this)} 
          mappingLabel="name"
          mappingValue={["value","type"]}
          selectOnlyLeaf={true}
          showOnlySearchedNodes={true}
          defaultExpanded={['.','.']}
        />
      </div>
    );
  }

Javadoc for all parameters:

/**
 * @param {array} data {} - The tree structure to select from, must be an object with eventually an array of children
 * @param {function} onSelect {} - The callback to receive the selected node
 * @param {string} mappingLabel "label" - the name of the node object field related to the node label
 * @param {string | array} mappingValue "value" - The name(s) of the node object field(s) related to the node value, used to match passed in values to actual tree nodes
 * @param {string} mappingChildren "children" - the name of the node object field related to the node children
 * @param {boolean} selectOnlyLeaf false - If enabled, only leaves can be selected and not the intermediary nodes
 * @param {boolean} expandToSelectedNodes false - If enabled, tree selection modal will recursively expand to all the already selected values
 * @param {array} defaultExpanded [] - an array of arrays describing a path of nodes expanded by default (tested on node labels, path parts are considered as RegExp)
 * @param {boolean} showOnlySearchedNodes false - Flag that determines if nodes that doesn't match the text search should be hidden
 */

History:

I instigated the forerunner of this package, hbp-quickfire, while working on the Human Brain Project in Geneva, Switzerland.

I was product owner of two systems:

  • DataWorkbench - A metadata curation and search tool for neuroscience big-data
  • PLUS - A web-based project management tool for use by the 100+ academic institutions involved in the HBP

Both of these were based on React/Bootstrap and needed sophisticted form controls for navigation and capture.

My team included Benoit Baumatin and Florian Duerlain, two talented and productive developers. They produced the bulk of the functionality in 'quickfire' and this library aims to take their work forward.