Skip to content

Commit 04e01c9

Browse files
committed
Merge branch 'release/1.0.0'
2 parents a261521 + 0329390 commit 04e01c9

16 files changed

+684
-164
lines changed

.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ignore all files and directories in this repository...
2+
*
3+
*/
4+
5+
# ...and add files and directories that are the only ones that match the pattern below
6+
!dist/*.js

.release.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"package_file_location": "./package.json",
3+
"no_confirm": false,
4+
"skip_git_pull": false,
5+
"skip_git_push": false,
6+
"release_message": true,
7+
"remote": "origin",
8+
"pre_commit_commands": [
9+
"npm run build",
10+
"npm run test"
11+
],
12+
"post_commit_commands": [],
13+
"post_complete_commands": [
14+
"npm publish"
15+
]
16+
}

.travis.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: node_js
2+
3+
sudo: false
4+
5+
node_js:
6+
- '10'
7+
8+
before_script:
9+
- export TZ=Europe/Warsaw
10+
11+
notifications:
12+
email: false
13+
slack:
14+
secure: QN522hr/rtTETQak3pDRUmuBNcVZaQ9PYpchIqSQtvUVIczslVmfGj/XQrqDJLiWXKOxnxuSIMMyj8NgUkbTAlYuBL7Cgd3Mp432LCt16KE96Lt0oKQMbgZB/Irjy9/yxSkDXm4miP9J01sz9sfSHrK2z2h+1scAbFlnw/j4wcdr34H5TElhmx/Aw/ACohPr8d4zA2IkdLiw7HPXy3AZmPb7y95pEDe0AHRZu9RU53Ok2088nTI+rgneGGm1qpMFBcWn9iu5XM63hma9ao9ozPWyNhW0x/D42aYVO0nZnnJzy0EdHVI9lGtscWF8u4aKp4UqgYv9gTxROMaZB0QGajSACBwNE3XYFNPIcBDyB18W052qbNXaK66fjARgD/+9tSmYBOiIO8Vng4zzBof9rz1+x570QZZfLrv2sNZ/AxGZD7hto1ijujiRn2oIaOxX98lA5vD/gSLJLA12dJ4d/Ej9CYlFKleqJouiD61+tM+AF+McOCwtk+3/qL3NMSR1Zi5UF3DoIIycfuZTAr/YFdenYrd8k6szKmeAgpkmDJBovyKjLb+rckQUEc7IYtZswMMNhSaSWgZON5XkBunEWoZ+mYII/suztXRIquEeZruoY+7HoeMMxjbAFs04XZzs2ygqlOFNDhuFALh3CnctGrsy15sFUwt6oz2qeF+exxo=

CONTRIBUTING.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Contributing to jStat
2+
3+
Your contributions to this project are very welcome. If you want to fix a bug or propose a new feature, you can open a new Pull Request but first make sure it follows these general rules:
4+
5+
1. Sign this [Contributor License Agreement](https://goo.gl/forms/yuutGuN0RjsikVpM2) to allow us to publish your changes to the code.
6+
2. Make your changes on a separate branch. This will speed up the merging process.
7+
3. Always make the target of your pull request the `develop` branch, not `master`.
8+
4. Please review our [coding style](https://github.com/airbnb/javascript) for instructions on how to properly style the code.
9+
5. Add a thorough description of all the changes.
10+
6. When submitting pull requests, no need to check in `dist/*.js`. They'll be recompiled for distribution anyway.
11+
12+
Thank you for your commitment!

LICENSE LICENSE.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Copyright (c) 2019 HANDSONCODE sp. z o. o.
12
Copyright (c) 2013 jStat
23

34
Permission is hereby granted, free of charge, to any person obtaining a copy

Makefile

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NODE_PATH ?= ./node_modules
22
DIST_DIR = ./dist
3-
JS_COMPILER = $(NODE_PATH)/uglify-js/bin/uglifyjs
4-
JS_TESTER = $(NODE_PATH)/vows/bin/vows
3+
JS_COMPILER = $(NODE_PATH)/.bin/uglifyjs
4+
JS_TESTER = $(NODE_PATH)/.bin/vows
55

66
DOC_DIR = doc
77
BUILD_DIR = build
@@ -47,11 +47,10 @@ jstat: jstat.js
4747

4848
install:
4949
@echo 'Downloading necessary libraries for build'
50-
@mkdir -p node_modules
5150
@npm install
5251

5352
test: clean core
5453
@echo 'Running jStat unit tests'
55-
@$(JS_TESTER)
54+
@$(JS_TESTER) --spec --isolate
5655

5756
.PHONY: clean core doc install test

README.md

+42-122
Original file line numberDiff line numberDiff line change
@@ -1,160 +1,80 @@
1-
[jStat](http://www.jstat.org/) - JavaScript Statistical Library
1+
**@handsontable/jstat** - JavaScript Statistical Library
22
===============================================================
33

4-
[![npm version](https://badge.fury.io/js/jStat.svg)](https://badge.fury.io/js/jStat)
5-
6-
jStat provides native javascript implementations of statistical functions.
7-
Full details are available in the [docs](https://jstat.github.io/all.html).
4+
**jStat** provides native javascript implementations of statistical functions.
5+
Full details are available in the [docs](http://handsontable.github.io/jstat/).
86
jStat provides more functions than most libraries, including the weibull, cauchy, poisson, hypergeometric, and beta distributions.
97
For most distributions, jStat provides the pdf, cdf, inverse, mean, mode, variance, and a sample function, allowing for more complex calculations.
108

11-
Using jStat in a Browser
12-
------------------------
13-
14-
jStat can be used in the browser. The `jStat` object will be added to the window. For example:
15-
16-
```
17-
<script src="components/jstat.js"></script> <!-- include jStat, from the CDN or otherwise -->
9+
[![npm version](https://img.shields.io/npm/v/@handsontable/jstat.svg)](https://www.npmjs.com/package/@handsontable/jstat)
1810

19-
<script>
20-
...
21-
var jstat = this.jStat(dataset); // jStat will be added to the window
22-
...
23-
data[i]['cum'] = jstat.normal(jstat.mean(), jstat.stdev()).cdf(data[i].x);
24-
...
25-
</script>
11+
## Table of contents
2612

27-
```
2813

29-
CDN
30-
---
14+
1. [Installation](#installation)
15+
2. [Getting Started](#getting-started)
16+
3. [Building jStat](#building-jstat)
17+
4. [Running Tests](#Running-tests)
18+
5. [Get the Code](#get-the-code)
19+
6. [Contributing](#contributing)
20+
7. [Licensing](#licensing)
3121

32-
The library is hosted on [jsDelivr](http://www.jsdelivr.com/) using the follwing
33-
url:
22+
## Installation
23+
Use npm to download the project.
3424
```
35-
//cdn.jsdelivr.net/npm/jstat@latest/dist/jstat.min.js
25+
npm install @handsontable/jstat
3626
```
37-
Note that `'latest'` can be replaced with any released verion of jStat.
38-
39-
Module Loaders
40-
--------------
41-
42-
Currently jStat is exposed as `j$` and `jStat` inside an object, rather than
43-
exported directly. This may confuse some module loaders, however should be
44-
easily remedied with the correct configuration.
4527

46-
NodeJS & NPM
47-
------------
48-
To install via npm:
28+
## Getting Started
4929

50-
```
51-
npm install --save jStat
52-
```
53-
54-
When loading under Node be sure to reference the child object.
30+
jStat can be used in the browser. The `jStat` object will be added to the window. For example:
5531

56-
```
57-
var jStat = require('jStat').jStat;
58-
```
32+
```html
33+
<script src="https://cdn.jsdelivr.net/npm/@handsontable/jstat/dist/jstat.min.js"></script> <!-- include jStat, from the CDN or otherwise -->
34+
<script>
35+
var jstat = this.jStat(dataset); // jStat will be added to the window
5936
60-
RequireJS Shim
61-
--------------
37+
data[i]['cum'] = jstat.normal(jstat.mean(), jstat.stdev()).cdf(data[i].x);
38+
</script>
6239

63-
For RequireJS not only `exports` but also `init` function must be specified.
64-
```
65-
requirejs.config({
66-
paths: {
67-
'jstat': 'path/to/jstat/dist/jstat.min'
68-
},
69-
shim: {
70-
jstat: {
71-
exports: ['j$', 'jStat'],
72-
init: function () {
73-
return {
74-
j$: j$,
75-
jStat: jStat
76-
};
77-
}
78-
}
79-
}
80-
});
8140
```
8241

83-
Build Prerequisites
84-
-------------------
85-
86-
In order to build jStat, you need to have GNU make 3.8 or later, Node.js 0.2 or later, and git 1.7 or later.
87-
(Earlier versions might work OK, but are not tested.)
88-
89-
Windows users have two options:
90-
91-
1. Install [msysgit](https://code.google.com/p/msysgit/) (Full installer for official Git),
92-
[GNU make for Windows](http://gnuwin32.sourceforge.net/packages/make.htm), and a
93-
[binary version of Node.js](http://node-js.prcn.co.cc/). Make sure all three packages are installed to the same
94-
location (by default, this is C:\Program Files\Git).
95-
2. Install [Cygwin](http://cygwin.com/) (make sure you install the git, make, and which packages), then either follow
96-
the [Node.js build instructions](https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-%28Windows%29) or install
97-
the [binary version of Node.js](http://node-js.prcn.co.cc/).
98-
99-
Mac OS users should install Xcode (comes on your Mac OS install DVD, or downloadable from
100-
[Apple's Xcode site](http://developer.apple.com/technologies/xcode.html)) and
101-
[http://mxcl.github.com/homebrew/](Homebrew). Once Homebrew is installed, run `brew install git` to install git,
102-
and `brew install node` to install Node.js.
42+
Using jStat in Node environment.
10343

104-
Linux/BSD users should use their appropriate package managers to install make, git, and node, or build from source
105-
if you swing that way.
44+
```js
45+
const jStat = require('@handsontable/jstat');
10646

47+
data[i]['cum'] = jStat.normal(jStat.mean(), jStat.stdev()).cdf(data[i].x);
48+
```
10749

108-
Building jStat
109-
--------------
50+
## Building jStat
11051

111-
First, clone a copy of the jStat git repo by running `git clone git://github.com/jstat/jstat.git`.
52+
First, clone a copy of the jStat git repo by running `git clone https://github.com/handsontable/jstat.git`.
11253

113-
To download all necessary libraries run `npm install`.
54+
To download all necessary dependencies run `npm install` in the cloned repository.
11455

115-
Then, to get a complete, minified version of jStat and all documentation, simply `cd` to the `jstat` directory and
116-
type `make`. If you don't have Node installed and/or want to make a basic, uncompressed, unlinted version of jstat,
117-
use `make jstat` instead of `make`.
56+
Then, to get a complete, minified version of jStat and all documentation, simply type `npm run all`.
11857

11958
The built version of jStat will be put in the `dist/` subdirectory.
12059

121-
Generate just the documentation by running `make doc`. Documentation will be placed in `dist/docs` by default.
122-
123-
To remove all built files, run `make clean`.
60+
Generate just the documentation by running `npm run doc`. Documentation will be placed in `dist/docs` by default.
12461

62+
To remove all built files, run `npm run clean`.
12563

126-
Running Tests
127-
-------------
64+
## Running Tests
12865

129-
Execute all tests by running `make test`.
66+
Execute all tests by running `npm run test`.
13067

13168
Or if you wish to run a specific test, `cd` to `test/<subdir>` and run `node <some_test>-test.js`.
13269

133-
134-
Get the Code
135-
------------
70+
## Get the Code
13671

13772
Both the minified and unminified source are located in the `dist/` directory. For those who don't want to build
13873
it themselves.
13974

75+
## Contributing
76+
If you would like to help us to develop this library, please first read the [guide for contributors](//github.com/handsontable/jstat/blob/master/CONTRIBUTING.md).
14077

141-
Contribute
142-
----------
143-
144-
jStat is now going to follow most of the v8
145-
[JavaScript](https://google.github.io/styleguide/jsguide.html)
146-
guidelines. There will be plenty of source that uses the old style, but we're
147-
going to work away from that.
148-
149-
Also, we'll be going through and reimplementing a good portion of the code to
150-
run faster. Hopefully it won't take too long to get the project on one basic
151-
standard.
152-
153-
When submitting pull requests, no need to check in dist/*.js. They'll be recompiled for distribution anyway.
154-
155-
Join the Community
156-
------------------
157-
158-
We always like discussion of how to improve jStat.
159-
Join us at our [mailing list](http://groups.google.com/group/jstat-discuss/) and let us know what you'd like to see.
160-
Also come ask questions in the #jstat channel on irc.freenode.net.
78+
## Licensing
79+
This library is released under the MIT license.
80+
The project is based on the great work of [jStat](https://github.com/jstat/jstat).

doc/assets/template.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<body>
1010
<div id="container">
1111
<header>
12-
<h1>jStat {{version}} Documentation</h1>
12+
<h1>@handsontable/jstat {{version}} Documentation</h1>
1313
<div id="gtoc">
1414
<p><a href="index.html">Index</a> | <a href="all.html">View on single page</a></p>
1515
</div>
@@ -19,7 +19,7 @@ <h1>jStat {{version}} Documentation</h1>
1919
</div>
2020
<script src="assets/sh_main.js"></script>
2121
<script src="assets/sh_javascript.min.js"></script>
22-
<script src="//cdn.jsdelivr.net/npm/jstat@latest/dist/jstat.min.js"></script>
22+
<script src="https://cdn.jsdelivr.net/npm/@handsontable/jstat@latest/dist/jstat.min.js"></script>
2323
<script>highlight(undefined, undefined, 'pre');</script>
2424
</body>
2525
</html>

doc/md/overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Description
44

5-
jStat is a statistical library written in JavaScript that allows you to perform advanced statistical operations without the need of a dedicated statistical language (e.g. MATLAB or R). It is available for download on [Github](http://github.com/jstat/jstat).
5+
jStat is a statistical library written in JavaScript that allows you to perform advanced statistical operations without the need of a dedicated statistical language (e.g. MATLAB or R). It is available for download on [Github](https://github.com/handsontable/jstat).
66

77
### Architecture
88

0 commit comments

Comments
 (0)