@zac-apps/helium 1.3.0-beta.3 → 1.3.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +22 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,7 +33,6 @@ import { LineChart, Line, CartesianGrid, XAxis, Label, YAxis, ReferenceLine, Ref
|
|
|
33
33
|
import ButtonGroup from '@mui/material/ButtonGroup';
|
|
34
34
|
import Switch from '@mui/material/Switch';
|
|
35
35
|
import regression from 'regression';
|
|
36
|
-
import 'next/app.js';
|
|
37
36
|
|
|
38
37
|
function NumField(_ref) {
|
|
39
38
|
var input = _ref.input,
|
|
@@ -1339,25 +1338,28 @@ function EstimateSlope(_ref) {
|
|
|
1339
1338
|
var slope = 0;
|
|
1340
1339
|
var intercept = 0;
|
|
1341
1340
|
|
|
1342
|
-
// find last time when spectrometer was filled - for this start from last point and go back until
|
|
1341
|
+
// find last time when spectrometer was filled - for this start from last point and go back until the first maximum is found
|
|
1343
1342
|
|
|
1344
|
-
var
|
|
1345
|
-
var
|
|
1346
|
-
var minLevelIndex = data.length - 1;
|
|
1343
|
+
var firstMax = Number(data[data.length - 1].level);
|
|
1344
|
+
var firstMaxIndex = data.length - 1;
|
|
1347
1345
|
for (var i = data.length - 2; i >= 0; i--) {
|
|
1348
1346
|
var level = Number(data[i].level);
|
|
1349
|
-
if (level
|
|
1350
|
-
|
|
1351
|
-
|
|
1347
|
+
if (level > firstMax) {
|
|
1348
|
+
firstMax = level;
|
|
1349
|
+
firstMaxIndex = i;
|
|
1352
1350
|
}
|
|
1353
1351
|
|
|
1354
|
-
// stop if level
|
|
1352
|
+
// stop if level decreases from maximum
|
|
1355
1353
|
|
|
1356
|
-
if (level
|
|
1354
|
+
if (level < firstMax) {
|
|
1357
1355
|
break;
|
|
1358
1356
|
}
|
|
1359
1357
|
}
|
|
1360
1358
|
|
|
1359
|
+
// minimum level is the level at firstMaxIndex
|
|
1360
|
+
|
|
1361
|
+
var minLevelIndex = firstMaxIndex - 1;
|
|
1362
|
+
|
|
1361
1363
|
// find previous time when spectrometer was filled - for this start from lastMinimumIndex and go back until a maximum is found or until level reaches 90%
|
|
1362
1364
|
|
|
1363
1365
|
var maxLevel = Number(data[minLevelIndex].level);
|
|
@@ -1429,12 +1431,14 @@ function ShowEstimate(_ref) {
|
|
|
1429
1431
|
}), /*#__PURE__*/jsx(Grid, {
|
|
1430
1432
|
container: true,
|
|
1431
1433
|
children: /*#__PURE__*/jsxs(AppTable, {
|
|
1432
|
-
children: [/*#__PURE__*/
|
|
1433
|
-
children:
|
|
1434
|
-
children:
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1434
|
+
children: [/*#__PURE__*/jsx(TableHead, {
|
|
1435
|
+
children: /*#__PURE__*/jsxs(TableRow, {
|
|
1436
|
+
children: [/*#__PURE__*/jsx(TableHeadCell, {
|
|
1437
|
+
children: "Estimated"
|
|
1438
|
+
}), /*#__PURE__*/jsx(TableHeadCell, {
|
|
1439
|
+
children: "Stored"
|
|
1440
|
+
})]
|
|
1441
|
+
})
|
|
1438
1442
|
}), /*#__PURE__*/jsx(TableBody, {
|
|
1439
1443
|
children: /*#__PURE__*/jsxs(TableRow, {
|
|
1440
1444
|
children: [/*#__PURE__*/jsx(TableCell, {
|
|
@@ -1551,7 +1555,7 @@ function RenderGraph(_ref) {
|
|
|
1551
1555
|
|
|
1552
1556
|
// Get last n elements of array
|
|
1553
1557
|
|
|
1554
|
-
|
|
1558
|
+
var slicedData = data.slice(Math.max(data.length - days, 0));
|
|
1555
1559
|
|
|
1556
1560
|
// Improve visibility of estimate
|
|
1557
1561
|
|
|
@@ -1560,7 +1564,7 @@ function RenderGraph(_ref) {
|
|
|
1560
1564
|
children: [/*#__PURE__*/jsxs(LineChart, {
|
|
1561
1565
|
height: height,
|
|
1562
1566
|
width: width,
|
|
1563
|
-
data:
|
|
1567
|
+
data: slicedData,
|
|
1564
1568
|
margin: {
|
|
1565
1569
|
top: 5,
|
|
1566
1570
|
right: 20,
|