A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jrideout/melt.js below:

jrideout/melt.js: Javascript library inspired by the R reshape package

Javascript library inspired by the R reshape package by Hadley Wickham.

Melt provides two functions melt and cast. How do they work?

First, they presume you have your data in the form of a list of objects. That looks like this:

var data = [
  {key1: 1, key2: 2},
  {key1: 2, key2: 3},
  {key1: 3, key2: 5},
];

But if you need the keys to be represented as a value, then melt can come to the rescue. Let's take a look at some examples:

Melt: jsfiddle

Cast: jsfiddle

melt(data, keep, varName, valName, noAddId)

cast(data, keep, fun, funArgs ...)

cast.sum(name, cols) - convience function to summarize data with cast

cast.sum(name) - convience function to sum data with cast

cast.count(name) - convience function to count data with cast

Apache 2


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4