Skip to content

Commit

Permalink
[#68] Fix undefined value
Browse files Browse the repository at this point in the history
  • Loading branch information
dedenbangkit committed Nov 9, 2023
1 parent 69126da commit 6c4db60
Showing 1 changed file with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,42 +263,27 @@ const DashboardSensitivityAnalysis = ({ dashboardData = [] }) => {

if (valueName === "x-axis-driver") {
const dataValue = dataSource.find((d) => d.name === value);
if (!dataValue) {
values = {
...values,
[`${segmentId}_x-axis-driver`]: undefined,
};
}
values = {
...values,
[`${segmentId}_x-axis-driver`]: dataValue?.name,
[`${segmentId}_x-axis-min-value`]: dataValue?.current,
[`${segmentId}_x-axis-max-value`]: dataValue?.feasible,
};
}
if (valueName === "y-axis-driver") {
const dataValue = dataSource.find((d) => d.name === value);
if (!dataValue) {
values = {
...values,
[`${segmentId}_y-axis-driver`]: undefined,
};
}
values = {
...values,
[`${segmentId}_y-axis-driver`]: dataValue?.name,
[`${segmentId}_y-axis-min-value`]: dataValue?.current,
[`${segmentId}_y-axis-max-value`]: dataValue?.feasible,
};
}
if (valueName === "binning-driver-name") {
const dataValue = dataSource.find((d) => d.name === value);
if (!dataValue) {
values = {
...values,
[`${segmentId}_binning-driver-name`]: undefined,
};
}
values = {
...values,
[`${segmentId}_binning-driver-name`]: dataValue?.name,
[`${segmentId}_binning-value-1`]: dataValue?.current,
[`${segmentId}_binning-value-2`]: dataValue
? (dataValue.current + dataValue.feasible) / 2
Expand Down

0 comments on commit 6c4db60

Please # to comment.