Skip to content

Commit

Permalink
fix: 🐛 start parameter should be use to compute the size
Browse files Browse the repository at this point in the history
  • Loading branch information
touv committed Jan 8, 2020
1 parent 8b14e1a commit bf87f52
Show file tree
Hide file tree
Showing 3 changed files with 1,363 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/analytics/src/distribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import Store from './store';
* @param {String} [value="value"] path to use for value
* @param {String} [step=1] step between each valut
* @param {Number} [start=min value in the stream] first value to throw
* @param {Number} [size=(min value - max value) in the stream] size of the distribution
* @param {Number} [size=(max value in the stream) - start] size of the distribution
* @param {Number} [default=0] default value for missing object
* @returns {Object}
*/
Expand All @@ -48,7 +48,7 @@ export default function distribute(data, feed) {
if (this.isLast()) {
const start = Number(this.getParam('start', this.min));
const step = Number(this.getParam('step', 1));
const size = Number(this.getParam('size', (this.max - this.min)));
const size = Number(this.getParam('size', (this.max - start)));
const leng = Math.ceil(size / step);
const stop = start + size;
const defval = this.getParam('default', 0);
Expand Down
Loading

0 comments on commit bf87f52

Please sign in to comment.