Skip to content

Commit

Permalink
[Fix] intervals rendered incorrectly in time widget (#2183)
Browse files Browse the repository at this point in the history
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
Co-authored-by: Xun Li <lixun910@gmail.com>
  • Loading branch information
igorDykhta and lixun910 committed Apr 4, 2023
1 parent c847573 commit b364f3d
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/components/src/common/histogram-plot.tsx
Expand Up @@ -105,18 +105,22 @@ function HistogramPlotFactory() {
const inRange =
undefinedToZero(bar.x1) <= value[1] && undefinedToZero(bar.x0) >= value[0];
const wRatio = inRange ? histogramStyle.highlightW : histogramStyle.unHighlightedW;
return (
<Bar
inRange={inRange}
key={bar.x0}
height={y(getValue(bar))}
width={barWidth * wRatio}
x={x(undefinedToZero(bar.x0)) + (barWidth * (1 - wRatio)) / 2}
rx={1}
ry={1}
y={height - y(getValue(bar))}
/>
);
const startX = x(undefinedToZero(bar.x0)) + (barWidth * (1 - wRatio)) / 2;
if (startX > 0 && startX + barWidth * histogramStyle.unHighlightedW <= width) {
return (
<Bar
inRange={inRange}
key={bar.x0}
height={y(getValue(bar))}
width={barWidth * wRatio}
x={startX}
rx={1}
ry={1}
y={height - y(getValue(bar))}
/>
);
}
return null;
})}
</g>
<g transform={`translate(${isRanged ? 0 : barWidth / 2}, 0)`}>{brushComponent}</g>
Expand Down

0 comments on commit b364f3d

Please sign in to comment.