@zac-apps/helium 1.3.0-beta.2 → 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 +217 -30
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -28,11 +28,11 @@ import Checkbox from '@mui/material/Checkbox';
|
|
|
28
28
|
import Button from '@mui/material/Button';
|
|
29
29
|
import moment$1 from 'moment/moment.js';
|
|
30
30
|
import Typography from '@mui/material/Typography';
|
|
31
|
-
import { LineChart, Line, CartesianGrid, XAxis, Label, YAxis, ReferenceLine, ReferenceArea, Tooltip } from 'recharts';
|
|
32
|
-
import Grid2 from '@mui/material/Grid2';
|
|
33
31
|
import Paper from '@mui/material/Paper';
|
|
32
|
+
import { LineChart, Line, CartesianGrid, XAxis, Label, YAxis, ReferenceLine, ReferenceArea, Tooltip } from 'recharts';
|
|
34
33
|
import ButtonGroup from '@mui/material/ButtonGroup';
|
|
35
34
|
import Switch from '@mui/material/Switch';
|
|
35
|
+
import regression from 'regression';
|
|
36
36
|
|
|
37
37
|
function NumField(_ref) {
|
|
38
38
|
var input = _ref.input,
|
|
@@ -377,8 +377,8 @@ function SelectSpecs(_ref) {
|
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
-
function ownKeys$
|
|
381
|
-
function _objectSpread$
|
|
380
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
381
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
382
382
|
|
|
383
383
|
// Admonition colors
|
|
384
384
|
|
|
@@ -441,7 +441,7 @@ function HePrognosisSum(_ref2) {
|
|
|
441
441
|
var boilOff = heliumLookupData.boilOff;
|
|
442
442
|
var boilData = {};
|
|
443
443
|
Object.keys(heliumData).map(function (spec) {
|
|
444
|
-
boilData = _objectSpread$
|
|
444
|
+
boilData = _objectSpread$5(_objectSpread$5({}, boilData), {}, _defineProperty({}, spec, Math.round(heliumData[spec] + days * boilOff[spec])));
|
|
445
445
|
return null;
|
|
446
446
|
});
|
|
447
447
|
var toMaxSum = Object.keys(boilData).reduce(function (total, current) {
|
|
@@ -610,7 +610,7 @@ function HePrognosis(_ref6) {
|
|
|
610
610
|
var specDefault = {};
|
|
611
611
|
var specList = Object.keys(heliumData.helium);
|
|
612
612
|
specList.map(function (spec) {
|
|
613
|
-
return specDefault = _objectSpread$
|
|
613
|
+
return specDefault = _objectSpread$5(_objectSpread$5({}, specDefault), {}, _defineProperty({}, spec, true));
|
|
614
614
|
});
|
|
615
615
|
var _useImmer = useImmer(specDefault),
|
|
616
616
|
_useImmer2 = _slicedToArray(_useImmer, 2),
|
|
@@ -624,13 +624,13 @@ function HePrognosis(_ref6) {
|
|
|
624
624
|
Object.keys(specs).filter(function (spec) {
|
|
625
625
|
return specs[spec];
|
|
626
626
|
}).map(function (spec) {
|
|
627
|
-
return currHeliumData = _objectSpread$
|
|
627
|
+
return currHeliumData = _objectSpread$5(_objectSpread$5({}, currHeliumData), {}, _defineProperty({}, spec, heliumData.helium[spec]));
|
|
628
628
|
});
|
|
629
629
|
var dates = {};
|
|
630
630
|
for (var i in increments) {
|
|
631
631
|
var d = new Date();
|
|
632
632
|
d.setDate(d.getDate() + increments[i]);
|
|
633
|
-
dates = _objectSpread$
|
|
633
|
+
dates = _objectSpread$5(_objectSpread$5({}, dates), {}, _defineProperty({}, increments[i], moment(d).format("ll")));
|
|
634
634
|
}
|
|
635
635
|
return /*#__PURE__*/jsxs(Grid, {
|
|
636
636
|
container: true,
|
|
@@ -921,8 +921,8 @@ function FindTriple(_ref2) {
|
|
|
921
921
|
return minTriple;
|
|
922
922
|
}
|
|
923
923
|
|
|
924
|
-
function ownKeys$
|
|
925
|
-
function _objectSpread$
|
|
924
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
925
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
926
926
|
function TupleResult(_ref) {
|
|
927
927
|
var children = _ref.children,
|
|
928
928
|
title = _ref.title;
|
|
@@ -1007,7 +1007,7 @@ function PairWizard(_ref4) {
|
|
|
1007
1007
|
var boilOff = heliumLookupData.boilOff;
|
|
1008
1008
|
var defaultSpecs = {};
|
|
1009
1009
|
Object.keys(boilOff).map(function (spec) {
|
|
1010
|
-
return defaultSpecs = _objectSpread$
|
|
1010
|
+
return defaultSpecs = _objectSpread$4(_objectSpread$4({}, defaultSpecs), {}, _defineProperty({}, spec, true));
|
|
1011
1011
|
});
|
|
1012
1012
|
var _useImmer = useImmer(defaultSpecs),
|
|
1013
1013
|
_useImmer2 = _slicedToArray(_useImmer, 2),
|
|
@@ -1024,13 +1024,13 @@ function PairWizard(_ref4) {
|
|
|
1024
1024
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1025
1025
|
limit = _useState4[0],
|
|
1026
1026
|
SetLimit = _useState4[1];
|
|
1027
|
-
var minPair = FindPair(_objectSpread$
|
|
1027
|
+
var minPair = FindPair(_objectSpread$4({}, {
|
|
1028
1028
|
currSpecs: currSpecs,
|
|
1029
1029
|
heliumData: heliumData,
|
|
1030
1030
|
boilOff: boilOff,
|
|
1031
1031
|
limit: limit
|
|
1032
1032
|
}));
|
|
1033
|
-
var minTriple = FindTriple(_objectSpread$
|
|
1033
|
+
var minTriple = FindTriple(_objectSpread$4({}, {
|
|
1034
1034
|
currSpecs: currSpecs,
|
|
1035
1035
|
heliumData: heliumData,
|
|
1036
1036
|
boilOff: boilOff,
|
|
@@ -1236,8 +1236,8 @@ function FillTarget(_ref) {
|
|
|
1236
1236
|
});
|
|
1237
1237
|
}
|
|
1238
1238
|
|
|
1239
|
-
function ownKeys$
|
|
1240
|
-
function _objectSpread$
|
|
1239
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1240
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1241
1241
|
function EstimateConsumption() {
|
|
1242
1242
|
// Get data
|
|
1243
1243
|
|
|
@@ -1263,7 +1263,7 @@ function EstimateConsumption() {
|
|
|
1263
1263
|
// Calculate consumption per day, month, year from values above
|
|
1264
1264
|
|
|
1265
1265
|
specCons = specCons.map(function (spec) {
|
|
1266
|
-
return _objectSpread$
|
|
1266
|
+
return _objectSpread$3(_objectSpread$3({}, spec), {}, {
|
|
1267
1267
|
perDay: spec.liters / spec.days,
|
|
1268
1268
|
perMonth: (spec.liters / spec.days * 30).toFixed(1),
|
|
1269
1269
|
perYear: (spec.liters / spec.days * 365).toFixed(1)
|
|
@@ -1331,6 +1331,130 @@ function EstimateConsumption() {
|
|
|
1331
1331
|
});
|
|
1332
1332
|
}
|
|
1333
1333
|
|
|
1334
|
+
function EstimateSlope(_ref) {
|
|
1335
|
+
var data = _ref.data;
|
|
1336
|
+
// define slope and intercept
|
|
1337
|
+
|
|
1338
|
+
var slope = 0;
|
|
1339
|
+
var intercept = 0;
|
|
1340
|
+
|
|
1341
|
+
// find last time when spectrometer was filled - for this start from last point and go back until the first maximum is found
|
|
1342
|
+
|
|
1343
|
+
var firstMax = Number(data[data.length - 1].level);
|
|
1344
|
+
var firstMaxIndex = data.length - 1;
|
|
1345
|
+
for (var i = data.length - 2; i >= 0; i--) {
|
|
1346
|
+
var level = Number(data[i].level);
|
|
1347
|
+
if (level > firstMax) {
|
|
1348
|
+
firstMax = level;
|
|
1349
|
+
firstMaxIndex = i;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
// stop if level decreases from maximum
|
|
1353
|
+
|
|
1354
|
+
if (level < firstMax) {
|
|
1355
|
+
break;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
// minimum level is the level at firstMaxIndex
|
|
1360
|
+
|
|
1361
|
+
var minLevelIndex = firstMaxIndex - 1;
|
|
1362
|
+
|
|
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%
|
|
1364
|
+
|
|
1365
|
+
var maxLevel = Number(data[minLevelIndex].level);
|
|
1366
|
+
var maxLevelIndex = minLevelIndex;
|
|
1367
|
+
for (var _i = minLevelIndex - 1; _i >= 0; _i--) {
|
|
1368
|
+
var _level = Number(data[_i].level);
|
|
1369
|
+
if (_level > maxLevel) {
|
|
1370
|
+
maxLevel = _level;
|
|
1371
|
+
maxLevelIndex = _i;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
// stop if level is decreases from maximum or if level is above 90%
|
|
1375
|
+
|
|
1376
|
+
if (_level < maxLevel - 1 || _level >= 90) {
|
|
1377
|
+
break;
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
// Create an array of points between maximum and minimum in the form [[x1, y1], [x2, y2], ...]
|
|
1382
|
+
|
|
1383
|
+
var points = [];
|
|
1384
|
+
for (var _i2 = maxLevelIndex; _i2 <= minLevelIndex; _i2++) {
|
|
1385
|
+
points.push([_i2, Number(data[_i2].level)]);
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
// Perform linear regression on the points
|
|
1389
|
+
|
|
1390
|
+
var result = regression.linear(points, {
|
|
1391
|
+
precision: 3
|
|
1392
|
+
});
|
|
1393
|
+
slope = result.equation[0];
|
|
1394
|
+
intercept = result.equation[1];
|
|
1395
|
+
return {
|
|
1396
|
+
slope: slope,
|
|
1397
|
+
intercept: intercept
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1402
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1403
|
+
function ShowEstimate(_ref) {
|
|
1404
|
+
var data = _ref.data,
|
|
1405
|
+
spec = _ref.spec;
|
|
1406
|
+
var heliumLookupData = useContext(LookupContext);
|
|
1407
|
+
|
|
1408
|
+
// Get estimated data
|
|
1409
|
+
|
|
1410
|
+
var estimateResult = EstimateSlope(_objectSpread$2({}, {
|
|
1411
|
+
data: data,
|
|
1412
|
+
spec: spec
|
|
1413
|
+
}));
|
|
1414
|
+
var estimatedBoiloff = estimateResult.slope.toFixed(3) || "N/A";
|
|
1415
|
+
|
|
1416
|
+
// Get stored data
|
|
1417
|
+
|
|
1418
|
+
var storedBoiloff = heliumLookupData.boilOff[spec].toFixed(3) || "N/A";
|
|
1419
|
+
|
|
1420
|
+
// Warn if values differ
|
|
1421
|
+
|
|
1422
|
+
var renderEstimatedBoiloff = Math.abs(estimatedBoiloff - storedBoiloff) < 0.1 ? estimatedBoiloff : /*#__PURE__*/jsx("strong", {
|
|
1423
|
+
style: {
|
|
1424
|
+
color: AppTheme.palette.primary.main
|
|
1425
|
+
},
|
|
1426
|
+
children: estimatedBoiloff
|
|
1427
|
+
});
|
|
1428
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1429
|
+
children: [/*#__PURE__*/jsx("h4", {
|
|
1430
|
+
children: "Boiloff coefficients (%/day)"
|
|
1431
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
1432
|
+
container: true,
|
|
1433
|
+
children: /*#__PURE__*/jsxs(AppTable, {
|
|
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
|
+
})
|
|
1442
|
+
}), /*#__PURE__*/jsx(TableBody, {
|
|
1443
|
+
children: /*#__PURE__*/jsxs(TableRow, {
|
|
1444
|
+
children: [/*#__PURE__*/jsx(TableCell, {
|
|
1445
|
+
children: renderEstimatedBoiloff
|
|
1446
|
+
}), /*#__PURE__*/jsx(TableCell, {
|
|
1447
|
+
children: storedBoiloff
|
|
1448
|
+
})]
|
|
1449
|
+
})
|
|
1450
|
+
})]
|
|
1451
|
+
})
|
|
1452
|
+
})]
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1457
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1334
1458
|
function RenderGraph(_ref) {
|
|
1335
1459
|
var data = _ref.data,
|
|
1336
1460
|
height = _ref.height,
|
|
@@ -1340,6 +1464,15 @@ function RenderGraph(_ref) {
|
|
|
1340
1464
|
|
|
1341
1465
|
var heliumLookupData = useContext(LookupContext);
|
|
1342
1466
|
|
|
1467
|
+
// Get estimated data
|
|
1468
|
+
|
|
1469
|
+
var estimateResult = EstimateSlope(_objectSpread$1({}, {
|
|
1470
|
+
data: data,
|
|
1471
|
+
spec: spec
|
|
1472
|
+
}));
|
|
1473
|
+
var estimatedBoiloff = estimateResult.slope;
|
|
1474
|
+
var estimatedIntercept = estimateResult.intercept;
|
|
1475
|
+
|
|
1343
1476
|
// Custom Tooltip for LineChart
|
|
1344
1477
|
|
|
1345
1478
|
var CustomTooltip = function CustomTooltip(_ref2) {
|
|
@@ -1395,6 +1528,10 @@ function RenderGraph(_ref) {
|
|
|
1395
1528
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1396
1529
|
showMinima = _useState4[0],
|
|
1397
1530
|
setShowMinima = _useState4[1];
|
|
1531
|
+
var _useState5 = useState(false),
|
|
1532
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1533
|
+
showEstimate = _useState6[0],
|
|
1534
|
+
setShowEstimate = _useState6[1];
|
|
1398
1535
|
|
|
1399
1536
|
// Add days ago to data
|
|
1400
1537
|
|
|
@@ -1402,14 +1539,32 @@ function RenderGraph(_ref) {
|
|
|
1402
1539
|
item.days = -moment(item.date, "ddd MMM D HH:mm:ss YYYY").diff(moment(), "days");
|
|
1403
1540
|
});
|
|
1404
1541
|
|
|
1542
|
+
// Get chart data from estimate
|
|
1543
|
+
|
|
1544
|
+
showEstimate && (data = data.map(function (item) {
|
|
1545
|
+
var days = item.days;
|
|
1546
|
+
var level = item.level;
|
|
1547
|
+
var estimate = estimatedBoiloff * (data.length - days) + estimatedIntercept;
|
|
1548
|
+
return {
|
|
1549
|
+
date: item.date,
|
|
1550
|
+
days: days,
|
|
1551
|
+
level: level,
|
|
1552
|
+
estimate: estimate
|
|
1553
|
+
};
|
|
1554
|
+
}));
|
|
1555
|
+
|
|
1405
1556
|
// Get last n elements of array
|
|
1406
1557
|
|
|
1407
|
-
|
|
1558
|
+
var slicedData = data.slice(Math.max(data.length - days, 0));
|
|
1559
|
+
|
|
1560
|
+
// Improve visibility of estimate
|
|
1561
|
+
|
|
1562
|
+
var lineColor = showEstimate ? AppTheme.palette.grey[300] : AppTheme.palette.primary.main;
|
|
1408
1563
|
return /*#__PURE__*/jsxs(React.Fragment, {
|
|
1409
1564
|
children: [/*#__PURE__*/jsxs(LineChart, {
|
|
1410
1565
|
height: height,
|
|
1411
1566
|
width: width,
|
|
1412
|
-
data:
|
|
1567
|
+
data: slicedData,
|
|
1413
1568
|
margin: {
|
|
1414
1569
|
top: 5,
|
|
1415
1570
|
right: 20,
|
|
@@ -1418,13 +1573,20 @@ function RenderGraph(_ref) {
|
|
|
1418
1573
|
},
|
|
1419
1574
|
children: [/*#__PURE__*/jsx(Line, {
|
|
1420
1575
|
dataKey: "level",
|
|
1421
|
-
stroke:
|
|
1422
|
-
fill:
|
|
1576
|
+
stroke: lineColor,
|
|
1577
|
+
fill: lineColor,
|
|
1423
1578
|
type: "linear",
|
|
1424
1579
|
dot: {
|
|
1425
1580
|
r: 1.5
|
|
1426
1581
|
}
|
|
1427
|
-
}), /*#__PURE__*/jsx(
|
|
1582
|
+
}), showEstimate ? /*#__PURE__*/jsx(Line, {
|
|
1583
|
+
dataKey: "estimate",
|
|
1584
|
+
stroke: AppTheme.palette.action.main,
|
|
1585
|
+
type: "monotone",
|
|
1586
|
+
strokeDasharray: "5 5",
|
|
1587
|
+
strokeWidth: 2,
|
|
1588
|
+
dot: false
|
|
1589
|
+
}) : null, /*#__PURE__*/jsx(CartesianGrid, {
|
|
1428
1590
|
stroke: AppTheme.palette.divider,
|
|
1429
1591
|
strokeDasharray: "5 5"
|
|
1430
1592
|
}), /*#__PURE__*/jsx(XAxis, {
|
|
@@ -1478,8 +1640,8 @@ function RenderGraph(_ref) {
|
|
|
1478
1640
|
}), /*#__PURE__*/jsx(DayButton, {
|
|
1479
1641
|
value: 365
|
|
1480
1642
|
})]
|
|
1481
|
-
}), /*#__PURE__*/
|
|
1482
|
-
children: /*#__PURE__*/jsx(FormControlLabel, {
|
|
1643
|
+
}), /*#__PURE__*/jsxs(FormGroup, {
|
|
1644
|
+
children: [/*#__PURE__*/jsx(FormControlLabel, {
|
|
1483
1645
|
control: /*#__PURE__*/jsx(Switch, {
|
|
1484
1646
|
label: "Show Minimum",
|
|
1485
1647
|
checked: showMinima,
|
|
@@ -1491,16 +1653,41 @@ function RenderGraph(_ref) {
|
|
|
1491
1653
|
sx: {
|
|
1492
1654
|
justifyContent: "center"
|
|
1493
1655
|
}
|
|
1494
|
-
})
|
|
1656
|
+
}), /*#__PURE__*/jsx(FormControlLabel, {
|
|
1657
|
+
control: /*#__PURE__*/jsx(Switch, {
|
|
1658
|
+
label: "Show Estimate",
|
|
1659
|
+
checked: showEstimate,
|
|
1660
|
+
onChange: function onChange() {
|
|
1661
|
+
return setShowEstimate(!showEstimate);
|
|
1662
|
+
}
|
|
1663
|
+
}),
|
|
1664
|
+
label: "Show Estimate",
|
|
1665
|
+
sx: {
|
|
1666
|
+
justifyContent: "center"
|
|
1667
|
+
}
|
|
1668
|
+
})]
|
|
1669
|
+
}), /*#__PURE__*/jsx(ShowEstimate, {
|
|
1670
|
+
spec: spec,
|
|
1671
|
+
data: data
|
|
1495
1672
|
})]
|
|
1496
1673
|
});
|
|
1497
1674
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1675
|
+
|
|
1676
|
+
function HeliumGraph(_ref) {
|
|
1677
|
+
var graphData = _ref.graphData,
|
|
1678
|
+
graphDataMeta = _ref.graphDataMeta,
|
|
1679
|
+
matches = _ref.matches;
|
|
1502
1680
|
var height = matches ? 250 : 200;
|
|
1503
1681
|
var width = matches ? 300 : 280;
|
|
1682
|
+
var heliumLookupData = useContext(LookupContext);
|
|
1683
|
+
|
|
1684
|
+
// remove spectrometers not existing in heliumLookupData
|
|
1685
|
+
|
|
1686
|
+
Object.keys(graphData).forEach(function (spec) {
|
|
1687
|
+
if (!heliumLookupData.boilOff[spec]) {
|
|
1688
|
+
delete graphData[spec];
|
|
1689
|
+
}
|
|
1690
|
+
});
|
|
1504
1691
|
|
|
1505
1692
|
// Catch missing data
|
|
1506
1693
|
|
|
@@ -1510,7 +1697,7 @@ function HeliumGraph(_ref4) {
|
|
|
1510
1697
|
children: /*#__PURE__*/jsx("strong", {
|
|
1511
1698
|
children: "Helium level monitoring"
|
|
1512
1699
|
})
|
|
1513
|
-
}), /*#__PURE__*/jsx(
|
|
1700
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
1514
1701
|
sx: {
|
|
1515
1702
|
display: "flex",
|
|
1516
1703
|
justifyContent: "center"
|
|
@@ -1531,7 +1718,7 @@ function HeliumGraph(_ref4) {
|
|
|
1531
1718
|
}), " ", /*#__PURE__*/jsxs("em", {
|
|
1532
1719
|
children: ["(updated ", moment(graphDataMeta.date).fromNow(), ")"]
|
|
1533
1720
|
})]
|
|
1534
|
-
}), /*#__PURE__*/jsx(
|
|
1721
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
1535
1722
|
container: true,
|
|
1536
1723
|
sx: {
|
|
1537
1724
|
display: "flex",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zac-apps/helium",
|
|
3
|
-
"version": "1.3.0-beta.
|
|
3
|
+
"version": "1.3.0-beta.4",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"rollup": "node_modules/rollup/dist/rollup.js",
|
|
6
6
|
"dev": "next dev",
|
|
@@ -30,9 +30,10 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@mui/icons-material": "^5.17.1",
|
|
32
32
|
"@mui/material": "^5.17.1",
|
|
33
|
-
"@zac-apps/commons": "^1
|
|
33
|
+
"@zac-apps/commons": "^1",
|
|
34
34
|
"moment": "^2.30.1",
|
|
35
35
|
"recharts": "^2.15.1",
|
|
36
|
+
"regression": "^2.0.1",
|
|
36
37
|
"use-immer": "^0.11.0"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
@@ -63,10 +64,10 @@
|
|
|
63
64
|
"storybook": "^8.6.10"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
67
|
+
"@zac-apps/commons": "^1",
|
|
66
68
|
"next": "^14",
|
|
67
69
|
"react": "^18 || ^19",
|
|
68
|
-
"react-dom": "^18 || ^19"
|
|
69
|
-
"@zac-apps/commons": "^1"
|
|
70
|
+
"react-dom": "^18 || ^19"
|
|
70
71
|
},
|
|
71
72
|
"description": "A React component to manage and visualize the helium consumption of a set of NMR spectrometers."
|
|
72
73
|
}
|