Skip to content

Commit 8598ceb

Browse files
committed
fixup! front: infra editor make slopes and curves optional values
1 parent 3297bc8 commit 8598ceb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

front/src/common/IntervalsDataViz/IntervalItem.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ const IntervalItem = <T extends { [key: string]: string | number }>({
5757
}
5858
}
5959

60-
const isNoData =
60+
const hasNoData =
6161
!!field &&
6262
(segment === undefined || segment[field] === undefined || segment[field] === emptyValue);
63-
const isHasData =
63+
const hasData =
6464
!!field &&
6565
segment !== undefined &&
6666
segment[field] !== undefined &&
@@ -73,8 +73,10 @@ const IntervalItem = <T extends { [key: string]: string | number }>({
7373
className={cx(
7474
'item',
7575
highlighted.includes(segment.index) && 'highlighted',
76-
isHasData && 'with-data',
77-
isNoData && 'no-data',
76+
{
77+
'with-data': hasData,
78+
'no-data': hasNoData
79+
},
7880
!field && isNilObject(segment, ['begin', 'end', 'index']) && 'no-data'
7981
)}
8082
style={{
@@ -151,7 +153,7 @@ const IntervalItem = <T extends { [key: string]: string | number }>({
151153
<span className="value" style={{ height: '100%' }} />
152154
)}
153155

154-
{isNoData && <div className="no-data-line" style={computeStyleForDataValue(0, min, max)} />}
156+
{hasNoData && <div className="no-data-line" style={computeStyleForDataValue(0, min, max)} />}
155157
{isDataZero && <div className="zero-line" style={computeStyleForDataValue(0, min, max)} />}
156158

157159
{/* Create a div for the resize */}

0 commit comments

Comments
 (0)