@zac-apps/helium 1.3.0-beta.2 → 1.3.0-beta.3
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 +211 -28
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -28,11 +28,12 @@ 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
|
+
import 'next/app.js';
|
|
36
37
|
|
|
37
38
|
function NumField(_ref) {
|
|
38
39
|
var input = _ref.input,
|
|
@@ -377,8 +378,8 @@ function SelectSpecs(_ref) {
|
|
|
377
378
|
});
|
|
378
379
|
}
|
|
379
380
|
|
|
380
|
-
function ownKeys$
|
|
381
|
-
function _objectSpread$
|
|
381
|
+
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; }
|
|
382
|
+
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
383
|
|
|
383
384
|
// Admonition colors
|
|
384
385
|
|
|
@@ -441,7 +442,7 @@ function HePrognosisSum(_ref2) {
|
|
|
441
442
|
var boilOff = heliumLookupData.boilOff;
|
|
442
443
|
var boilData = {};
|
|
443
444
|
Object.keys(heliumData).map(function (spec) {
|
|
444
|
-
boilData = _objectSpread$
|
|
445
|
+
boilData = _objectSpread$5(_objectSpread$5({}, boilData), {}, _defineProperty({}, spec, Math.round(heliumData[spec] + days * boilOff[spec])));
|
|
445
446
|
return null;
|
|
446
447
|
});
|
|
447
448
|
var toMaxSum = Object.keys(boilData).reduce(function (total, current) {
|
|
@@ -610,7 +611,7 @@ function HePrognosis(_ref6) {
|
|
|
610
611
|
var specDefault = {};
|
|
611
612
|
var specList = Object.keys(heliumData.helium);
|
|
612
613
|
specList.map(function (spec) {
|
|
613
|
-
return specDefault = _objectSpread$
|
|
614
|
+
return specDefault = _objectSpread$5(_objectSpread$5({}, specDefault), {}, _defineProperty({}, spec, true));
|
|
614
615
|
});
|
|
615
616
|
var _useImmer = useImmer(specDefault),
|
|
616
617
|
_useImmer2 = _slicedToArray(_useImmer, 2),
|
|
@@ -624,13 +625,13 @@ function HePrognosis(_ref6) {
|
|
|
624
625
|
Object.keys(specs).filter(function (spec) {
|
|
625
626
|
return specs[spec];
|
|
626
627
|
}).map(function (spec) {
|
|
627
|
-
return currHeliumData = _objectSpread$
|
|
628
|
+
return currHeliumData = _objectSpread$5(_objectSpread$5({}, currHeliumData), {}, _defineProperty({}, spec, heliumData.helium[spec]));
|
|
628
629
|
});
|
|
629
630
|
var dates = {};
|
|
630
631
|
for (var i in increments) {
|
|
631
632
|
var d = new Date();
|
|
632
633
|
d.setDate(d.getDate() + increments[i]);
|
|
633
|
-
dates = _objectSpread$
|
|
634
|
+
dates = _objectSpread$5(_objectSpread$5({}, dates), {}, _defineProperty({}, increments[i], moment(d).format("ll")));
|
|
634
635
|
}
|
|
635
636
|
return /*#__PURE__*/jsxs(Grid, {
|
|
636
637
|
container: true,
|
|
@@ -921,8 +922,8 @@ function FindTriple(_ref2) {
|
|
|
921
922
|
return minTriple;
|
|
922
923
|
}
|
|
923
924
|
|
|
924
|
-
function ownKeys$
|
|
925
|
-
function _objectSpread$
|
|
925
|
+
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; }
|
|
926
|
+
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
927
|
function TupleResult(_ref) {
|
|
927
928
|
var children = _ref.children,
|
|
928
929
|
title = _ref.title;
|
|
@@ -1007,7 +1008,7 @@ function PairWizard(_ref4) {
|
|
|
1007
1008
|
var boilOff = heliumLookupData.boilOff;
|
|
1008
1009
|
var defaultSpecs = {};
|
|
1009
1010
|
Object.keys(boilOff).map(function (spec) {
|
|
1010
|
-
return defaultSpecs = _objectSpread$
|
|
1011
|
+
return defaultSpecs = _objectSpread$4(_objectSpread$4({}, defaultSpecs), {}, _defineProperty({}, spec, true));
|
|
1011
1012
|
});
|
|
1012
1013
|
var _useImmer = useImmer(defaultSpecs),
|
|
1013
1014
|
_useImmer2 = _slicedToArray(_useImmer, 2),
|
|
@@ -1024,13 +1025,13 @@ function PairWizard(_ref4) {
|
|
|
1024
1025
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1025
1026
|
limit = _useState4[0],
|
|
1026
1027
|
SetLimit = _useState4[1];
|
|
1027
|
-
var minPair = FindPair(_objectSpread$
|
|
1028
|
+
var minPair = FindPair(_objectSpread$4({}, {
|
|
1028
1029
|
currSpecs: currSpecs,
|
|
1029
1030
|
heliumData: heliumData,
|
|
1030
1031
|
boilOff: boilOff,
|
|
1031
1032
|
limit: limit
|
|
1032
1033
|
}));
|
|
1033
|
-
var minTriple = FindTriple(_objectSpread$
|
|
1034
|
+
var minTriple = FindTriple(_objectSpread$4({}, {
|
|
1034
1035
|
currSpecs: currSpecs,
|
|
1035
1036
|
heliumData: heliumData,
|
|
1036
1037
|
boilOff: boilOff,
|
|
@@ -1236,8 +1237,8 @@ function FillTarget(_ref) {
|
|
|
1236
1237
|
});
|
|
1237
1238
|
}
|
|
1238
1239
|
|
|
1239
|
-
function ownKeys$
|
|
1240
|
-
function _objectSpread$
|
|
1240
|
+
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; }
|
|
1241
|
+
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
1242
|
function EstimateConsumption() {
|
|
1242
1243
|
// Get data
|
|
1243
1244
|
|
|
@@ -1263,7 +1264,7 @@ function EstimateConsumption() {
|
|
|
1263
1264
|
// Calculate consumption per day, month, year from values above
|
|
1264
1265
|
|
|
1265
1266
|
specCons = specCons.map(function (spec) {
|
|
1266
|
-
return _objectSpread$
|
|
1267
|
+
return _objectSpread$3(_objectSpread$3({}, spec), {}, {
|
|
1267
1268
|
perDay: spec.liters / spec.days,
|
|
1268
1269
|
perMonth: (spec.liters / spec.days * 30).toFixed(1),
|
|
1269
1270
|
perYear: (spec.liters / spec.days * 365).toFixed(1)
|
|
@@ -1331,6 +1332,125 @@ function EstimateConsumption() {
|
|
|
1331
1332
|
});
|
|
1332
1333
|
}
|
|
1333
1334
|
|
|
1335
|
+
function EstimateSlope(_ref) {
|
|
1336
|
+
var data = _ref.data;
|
|
1337
|
+
// define slope and intercept
|
|
1338
|
+
|
|
1339
|
+
var slope = 0;
|
|
1340
|
+
var intercept = 0;
|
|
1341
|
+
|
|
1342
|
+
// find last time when spectrometer was filled - for this start from last point and go back until a minimum is found
|
|
1343
|
+
|
|
1344
|
+
var lastLevel = Number(data[data.length - 1].level);
|
|
1345
|
+
var minLevel = lastLevel;
|
|
1346
|
+
var minLevelIndex = data.length - 1;
|
|
1347
|
+
for (var i = data.length - 2; i >= 0; i--) {
|
|
1348
|
+
var level = Number(data[i].level);
|
|
1349
|
+
if (level < minLevel) {
|
|
1350
|
+
minLevel = level;
|
|
1351
|
+
minLevelIndex = i;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
// stop if level is increases from minimum
|
|
1355
|
+
|
|
1356
|
+
if (level > minLevel + 1) {
|
|
1357
|
+
break;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
// 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
|
+
|
|
1363
|
+
var maxLevel = Number(data[minLevelIndex].level);
|
|
1364
|
+
var maxLevelIndex = minLevelIndex;
|
|
1365
|
+
for (var _i = minLevelIndex - 1; _i >= 0; _i--) {
|
|
1366
|
+
var _level = Number(data[_i].level);
|
|
1367
|
+
if (_level > maxLevel) {
|
|
1368
|
+
maxLevel = _level;
|
|
1369
|
+
maxLevelIndex = _i;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
// stop if level is decreases from maximum or if level is above 90%
|
|
1373
|
+
|
|
1374
|
+
if (_level < maxLevel - 1 || _level >= 90) {
|
|
1375
|
+
break;
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
// Create an array of points between maximum and minimum in the form [[x1, y1], [x2, y2], ...]
|
|
1380
|
+
|
|
1381
|
+
var points = [];
|
|
1382
|
+
for (var _i2 = maxLevelIndex; _i2 <= minLevelIndex; _i2++) {
|
|
1383
|
+
points.push([_i2, Number(data[_i2].level)]);
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
// Perform linear regression on the points
|
|
1387
|
+
|
|
1388
|
+
var result = regression.linear(points, {
|
|
1389
|
+
precision: 3
|
|
1390
|
+
});
|
|
1391
|
+
slope = result.equation[0];
|
|
1392
|
+
intercept = result.equation[1];
|
|
1393
|
+
return {
|
|
1394
|
+
slope: slope,
|
|
1395
|
+
intercept: intercept
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
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; }
|
|
1400
|
+
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; }
|
|
1401
|
+
function ShowEstimate(_ref) {
|
|
1402
|
+
var data = _ref.data,
|
|
1403
|
+
spec = _ref.spec;
|
|
1404
|
+
var heliumLookupData = useContext(LookupContext);
|
|
1405
|
+
|
|
1406
|
+
// Get estimated data
|
|
1407
|
+
|
|
1408
|
+
var estimateResult = EstimateSlope(_objectSpread$2({}, {
|
|
1409
|
+
data: data,
|
|
1410
|
+
spec: spec
|
|
1411
|
+
}));
|
|
1412
|
+
var estimatedBoiloff = estimateResult.slope.toFixed(3) || "N/A";
|
|
1413
|
+
|
|
1414
|
+
// Get stored data
|
|
1415
|
+
|
|
1416
|
+
var storedBoiloff = heliumLookupData.boilOff[spec].toFixed(3) || "N/A";
|
|
1417
|
+
|
|
1418
|
+
// Warn if values differ
|
|
1419
|
+
|
|
1420
|
+
var renderEstimatedBoiloff = Math.abs(estimatedBoiloff - storedBoiloff) < 0.1 ? estimatedBoiloff : /*#__PURE__*/jsx("strong", {
|
|
1421
|
+
style: {
|
|
1422
|
+
color: AppTheme.palette.primary.main
|
|
1423
|
+
},
|
|
1424
|
+
children: estimatedBoiloff
|
|
1425
|
+
});
|
|
1426
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1427
|
+
children: [/*#__PURE__*/jsx("h4", {
|
|
1428
|
+
children: "Boiloff coefficients (%/day)"
|
|
1429
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
1430
|
+
container: true,
|
|
1431
|
+
children: /*#__PURE__*/jsxs(AppTable, {
|
|
1432
|
+
children: [/*#__PURE__*/jsxs(TableHead, {
|
|
1433
|
+
children: [/*#__PURE__*/jsx(TableHeadCell, {
|
|
1434
|
+
children: "Estimated"
|
|
1435
|
+
}), /*#__PURE__*/jsx(TableHeadCell, {
|
|
1436
|
+
children: "Stored"
|
|
1437
|
+
})]
|
|
1438
|
+
}), /*#__PURE__*/jsx(TableBody, {
|
|
1439
|
+
children: /*#__PURE__*/jsxs(TableRow, {
|
|
1440
|
+
children: [/*#__PURE__*/jsx(TableCell, {
|
|
1441
|
+
children: renderEstimatedBoiloff
|
|
1442
|
+
}), /*#__PURE__*/jsx(TableCell, {
|
|
1443
|
+
children: storedBoiloff
|
|
1444
|
+
})]
|
|
1445
|
+
})
|
|
1446
|
+
})]
|
|
1447
|
+
})
|
|
1448
|
+
})]
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
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; }
|
|
1453
|
+
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
1454
|
function RenderGraph(_ref) {
|
|
1335
1455
|
var data = _ref.data,
|
|
1336
1456
|
height = _ref.height,
|
|
@@ -1340,6 +1460,15 @@ function RenderGraph(_ref) {
|
|
|
1340
1460
|
|
|
1341
1461
|
var heliumLookupData = useContext(LookupContext);
|
|
1342
1462
|
|
|
1463
|
+
// Get estimated data
|
|
1464
|
+
|
|
1465
|
+
var estimateResult = EstimateSlope(_objectSpread$1({}, {
|
|
1466
|
+
data: data,
|
|
1467
|
+
spec: spec
|
|
1468
|
+
}));
|
|
1469
|
+
var estimatedBoiloff = estimateResult.slope;
|
|
1470
|
+
var estimatedIntercept = estimateResult.intercept;
|
|
1471
|
+
|
|
1343
1472
|
// Custom Tooltip for LineChart
|
|
1344
1473
|
|
|
1345
1474
|
var CustomTooltip = function CustomTooltip(_ref2) {
|
|
@@ -1395,6 +1524,10 @@ function RenderGraph(_ref) {
|
|
|
1395
1524
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1396
1525
|
showMinima = _useState4[0],
|
|
1397
1526
|
setShowMinima = _useState4[1];
|
|
1527
|
+
var _useState5 = useState(false),
|
|
1528
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1529
|
+
showEstimate = _useState6[0],
|
|
1530
|
+
setShowEstimate = _useState6[1];
|
|
1398
1531
|
|
|
1399
1532
|
// Add days ago to data
|
|
1400
1533
|
|
|
@@ -1402,9 +1535,27 @@ function RenderGraph(_ref) {
|
|
|
1402
1535
|
item.days = -moment(item.date, "ddd MMM D HH:mm:ss YYYY").diff(moment(), "days");
|
|
1403
1536
|
});
|
|
1404
1537
|
|
|
1538
|
+
// Get chart data from estimate
|
|
1539
|
+
|
|
1540
|
+
showEstimate && (data = data.map(function (item) {
|
|
1541
|
+
var days = item.days;
|
|
1542
|
+
var level = item.level;
|
|
1543
|
+
var estimate = estimatedBoiloff * (data.length - days) + estimatedIntercept;
|
|
1544
|
+
return {
|
|
1545
|
+
date: item.date,
|
|
1546
|
+
days: days,
|
|
1547
|
+
level: level,
|
|
1548
|
+
estimate: estimate
|
|
1549
|
+
};
|
|
1550
|
+
}));
|
|
1551
|
+
|
|
1405
1552
|
// Get last n elements of array
|
|
1406
1553
|
|
|
1407
1554
|
data = data.slice(Math.max(data.length - days, 0));
|
|
1555
|
+
|
|
1556
|
+
// Improve visibility of estimate
|
|
1557
|
+
|
|
1558
|
+
var lineColor = showEstimate ? AppTheme.palette.grey[300] : AppTheme.palette.primary.main;
|
|
1408
1559
|
return /*#__PURE__*/jsxs(React.Fragment, {
|
|
1409
1560
|
children: [/*#__PURE__*/jsxs(LineChart, {
|
|
1410
1561
|
height: height,
|
|
@@ -1418,13 +1569,20 @@ function RenderGraph(_ref) {
|
|
|
1418
1569
|
},
|
|
1419
1570
|
children: [/*#__PURE__*/jsx(Line, {
|
|
1420
1571
|
dataKey: "level",
|
|
1421
|
-
stroke:
|
|
1422
|
-
fill:
|
|
1572
|
+
stroke: lineColor,
|
|
1573
|
+
fill: lineColor,
|
|
1423
1574
|
type: "linear",
|
|
1424
1575
|
dot: {
|
|
1425
1576
|
r: 1.5
|
|
1426
1577
|
}
|
|
1427
|
-
}), /*#__PURE__*/jsx(
|
|
1578
|
+
}), showEstimate ? /*#__PURE__*/jsx(Line, {
|
|
1579
|
+
dataKey: "estimate",
|
|
1580
|
+
stroke: AppTheme.palette.action.main,
|
|
1581
|
+
type: "monotone",
|
|
1582
|
+
strokeDasharray: "5 5",
|
|
1583
|
+
strokeWidth: 2,
|
|
1584
|
+
dot: false
|
|
1585
|
+
}) : null, /*#__PURE__*/jsx(CartesianGrid, {
|
|
1428
1586
|
stroke: AppTheme.palette.divider,
|
|
1429
1587
|
strokeDasharray: "5 5"
|
|
1430
1588
|
}), /*#__PURE__*/jsx(XAxis, {
|
|
@@ -1478,8 +1636,8 @@ function RenderGraph(_ref) {
|
|
|
1478
1636
|
}), /*#__PURE__*/jsx(DayButton, {
|
|
1479
1637
|
value: 365
|
|
1480
1638
|
})]
|
|
1481
|
-
}), /*#__PURE__*/
|
|
1482
|
-
children: /*#__PURE__*/jsx(FormControlLabel, {
|
|
1639
|
+
}), /*#__PURE__*/jsxs(FormGroup, {
|
|
1640
|
+
children: [/*#__PURE__*/jsx(FormControlLabel, {
|
|
1483
1641
|
control: /*#__PURE__*/jsx(Switch, {
|
|
1484
1642
|
label: "Show Minimum",
|
|
1485
1643
|
checked: showMinima,
|
|
@@ -1491,16 +1649,41 @@ function RenderGraph(_ref) {
|
|
|
1491
1649
|
sx: {
|
|
1492
1650
|
justifyContent: "center"
|
|
1493
1651
|
}
|
|
1494
|
-
})
|
|
1652
|
+
}), /*#__PURE__*/jsx(FormControlLabel, {
|
|
1653
|
+
control: /*#__PURE__*/jsx(Switch, {
|
|
1654
|
+
label: "Show Estimate",
|
|
1655
|
+
checked: showEstimate,
|
|
1656
|
+
onChange: function onChange() {
|
|
1657
|
+
return setShowEstimate(!showEstimate);
|
|
1658
|
+
}
|
|
1659
|
+
}),
|
|
1660
|
+
label: "Show Estimate",
|
|
1661
|
+
sx: {
|
|
1662
|
+
justifyContent: "center"
|
|
1663
|
+
}
|
|
1664
|
+
})]
|
|
1665
|
+
}), /*#__PURE__*/jsx(ShowEstimate, {
|
|
1666
|
+
spec: spec,
|
|
1667
|
+
data: data
|
|
1495
1668
|
})]
|
|
1496
1669
|
});
|
|
1497
1670
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1671
|
+
|
|
1672
|
+
function HeliumGraph(_ref) {
|
|
1673
|
+
var graphData = _ref.graphData,
|
|
1674
|
+
graphDataMeta = _ref.graphDataMeta,
|
|
1675
|
+
matches = _ref.matches;
|
|
1502
1676
|
var height = matches ? 250 : 200;
|
|
1503
1677
|
var width = matches ? 300 : 280;
|
|
1678
|
+
var heliumLookupData = useContext(LookupContext);
|
|
1679
|
+
|
|
1680
|
+
// remove spectrometers not existing in heliumLookupData
|
|
1681
|
+
|
|
1682
|
+
Object.keys(graphData).forEach(function (spec) {
|
|
1683
|
+
if (!heliumLookupData.boilOff[spec]) {
|
|
1684
|
+
delete graphData[spec];
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1504
1687
|
|
|
1505
1688
|
// Catch missing data
|
|
1506
1689
|
|
|
@@ -1510,7 +1693,7 @@ function HeliumGraph(_ref4) {
|
|
|
1510
1693
|
children: /*#__PURE__*/jsx("strong", {
|
|
1511
1694
|
children: "Helium level monitoring"
|
|
1512
1695
|
})
|
|
1513
|
-
}), /*#__PURE__*/jsx(
|
|
1696
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
1514
1697
|
sx: {
|
|
1515
1698
|
display: "flex",
|
|
1516
1699
|
justifyContent: "center"
|
|
@@ -1531,7 +1714,7 @@ function HeliumGraph(_ref4) {
|
|
|
1531
1714
|
}), " ", /*#__PURE__*/jsxs("em", {
|
|
1532
1715
|
children: ["(updated ", moment(graphDataMeta.date).fromNow(), ")"]
|
|
1533
1716
|
})]
|
|
1534
|
-
}), /*#__PURE__*/jsx(
|
|
1717
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
1535
1718
|
container: true,
|
|
1536
1719
|
sx: {
|
|
1537
1720
|
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.3",
|
|
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
|
}
|