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 🙏

© 2026 – Pkg Stats / Ryan Hefner

hodf

v0.9.1

Published

Hands-on-dataframe: Handsontable wrapper to make data.frame widget

Downloads

2

Readme

HODF: Hands-on-dataframe

A wrapper around handsontable spreadsheet for collecting data.frame objects with a dynamic number of columns / rows.

hodfr screenshot

Installation / Quick start

The package can be installed via. Yarn / NPM:

npm install shuttlethread/hodf

Include the handsontable CSS in your page, either:

  • Include node_modules/handsontable/dist/handsontable.min.css
  • Use a CDN, e.g. <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/handsontable.full.min.css" rel="stylesheet" media="screen">

Then you can create the hodf element with:

var Hodataframe = require('hodf');

var h = new Hodataframe(
    template,  // Describes requested data, see later
    containing_el,  // HTML element to add HODF to
    (initial_data || {}),  // Initial data frame to populate
);

Finally you can get the content using:

console.log(h.getDataFrame());  // R data.frame-like format
console.log(h.getAofA());  // Array-of-arrays format

Templates

A template must contain a fields and values specification, which detail how data.frame columns and rows are formed, respectively.

Both should be a dimension object or array of dimension objects that describe contained data. For example, the following:

{
    "fields": [
        {"name": "species", "title": "Species"},
        {"name": "count", "title": "Count"}
    ],
    "values": {"type": "year", "min": 2000, "max": 2005},
}

...will accept / produce data frames of the form:

{
    "_headings": { "fields": ["species", "count"], "values": [2000, 2001, 2002, 2003, 2004, 2005] },
    "species": ["cow", "pig", "duck", "cat", "dog"],
    "count": [0, 1, 2, 3, 4, 5],
}

The various types of dimensions are described below.

Static dimension

A fixed single dimension that will always be present in the data frame. For example:

    {"name": "species", "title": "Species"},

The title can contain translations, e.g:

    {"name": "item_2", "title": {"en": "Item 2", "ge": "ნივთი 2"}},

Optional dimension

A single dimension that the user can turn on/off. "Enabled" specifies whether it's on by default. For example:

    {"type": "optional", "name": "width", "title": "Width", "enabled": true},

Range dimension

The columns/rows will be a range of numeric values, for which users get to select min/max value:

{"type": "range", "min": 100, "max": 200}
  • min: Initial value for minimum in range, if there isn't data provided to initial_data.
  • max: Initial value for maximum in range, if there isn't data provided to initial_data.
  • overall_min: Users cannot alter the min/max below this value
  • overall_max: Users cannot alter the min/max above this value
  • prefix: Prefix to add to numeric names/titles, e.g. {"name": "y", "title": "Year"}.

Year dimension

Special case of range dimension. Users select start/end instead of min/max.

{"type": "year", "min": 2000, "max": 2010}

Timeseries dimension

As well as selecting a year range, you can select a period:

{"type": "timeseries", "min": 2000, "max": 2010, "allowed_periods": ["monthly", "bi-annual"]}

Accepts all range dimension options, plus...

  • allowed_periods: Periods to offer user, an array containing some of 'yearly', 'bi-annual', 'quarterly', 'monthly', or '*' for all (the default).

Bins dimension

Special case of range dimension. Min is hard-coded to 1.

{"type": "bins", "max": 10}

Content type

For fields only, you can specify the type of value it can contain with content. For example

{"type": "range", "min": 100, "max": 200, "content": "numeric"}

... or ...

[
    {"name": "species", "title": "Species", "content": ["Cow", "Pig", "Duck"]},
    {"name": "count", "title": "Count", "content": "numeric"}
],

Valid options are:-

  • An array of possible values, in which case a dropdown will appear
  • The name of a handsontable validator alias, i.e. date, numeric, time.
  • A handsontable cell type object

Additional optional template fields

Besides fields/values, a template can also contain the following fields:

  • title: A title for the table, put in an h3 element before it
  • description: A description for the table, put in an p element before it
  • name: A name for the element. Not used internally
  • orientation: One of "horizontal" (default), or "vertical". Vertical rotates the table, so that "fields" specifies the row metadata instead of columns

References

Acknowledgements

Developed as part of FarFish, which has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement no. 727891.