ensure number for sample size

This commit is contained in:
Scott Bell 2024-10-09 12:04:28 +02:00
parent c6806944eb
commit 8e7bfd080d
2 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,3 @@
import { sampleSize } from 'lodash';
import { evaluate } from 'mathjs';
// eslint-disable-next-line no-undef
@ -84,7 +83,7 @@ function calculate(dataFrame, parameters, expression) {
accumulatedData[referenceParameter.name].push(referenceValue);
referenceValue = accumulatedData[referenceParameter.name];
}
if (referenceParameter.sampleSize && sampleSize > 0) {
if (referenceParameter.sampleSize && referenceParameter.sampleSize > 0) {
// enforce sample size by ensuring referenceValue has the latest n elements
// if we don't have at least the sample size, skip this iteration
if (referenceValue.length < referenceParameter.sampleSize) {

View File

@ -121,7 +121,7 @@
v-if="isEditing && parameter.accumulateValues"
v-model="parameter.sampleSize"
:aria-label="`Sample Size for ${parameter.name}`"
type="text"
type="number"
class="c-input--md"
@change="updateParameters"
/>