Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #12

Open
ndarville opened this issue Jun 1, 2014 · 3 comments
Open

Documentation #12

ndarville opened this issue Jun 1, 2014 · 3 comments

Comments

@ndarville
Copy link

A guide would probably be better than a wiki; personally, I am trying to use loess.js for a project of mine, but some documentation beyond the included loess example would definitely help. :)

I’ve created a basic docco webpage for science.v1.js here as an alternative to the basic GitHub inspection.

#d3.js at freenode is really low on activity, but maybe I could try asking around to see which other parts of science.js people would like to see documentation/guides for.

@jasondavies
Copy link
Owner

The problem with your code is that you’re calling loess(x, y), for each point, instead of loess(xs, ys) where xs and ys are arrays. (Sorry for the lack of documentation.)

@ndarville
Copy link
Author

Thanks, @jasondavies.

I’ll try to get loess() to plot the trend, and do a post mortem with instructions, once/if I’m done. :)

@curran
Copy link

curran commented Dec 4, 2015

Here's another example that uses the loess function with D3.

I made this to try to understand the API.

Here's a stab at partial API documentation (in the style of @mbostock) based on my limited understanding so far:

# stats.loess()

Constructs a LOESS curve generator instance.

var myLoess = science.stats.loess();

# loess.bandwidth(bandwidth)

Specifies the bandwidth (smoothing parameter) that controls how fine or coarse the smoothing is. Lower values fit the curve closer to the data, higher values make the curve more straight.

myLoess.bandwidth(0.2);

# loess(xValues,yValues)

Invokes the LOESS algorithm to generate the smoothed curve. Accepts as input two arrays of values in data space. These two arrays must be of the same length. Returns an array of smoothed Y values that has the same number of elements as the input arrays.

var yValuesSmooth = myLoess(xValues, yValues);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants