mirror of
https://github.com/nasa/openmct.git
synced 2025-04-20 17:11:11 +00:00
ensure number for sample size
This commit is contained in:
parent
c6806944eb
commit
8e7bfd080d
@ -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) {
|
||||
|
@ -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"
|
||||
/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user